public function LingotekSupportedLocalesController::content in Lingotek Translation 3.4.x
Same name and namespace in other branches
- 8.2 src/Controller/LingotekSupportedLocalesController.php \Drupal\lingotek\Controller\LingotekSupportedLocalesController::content()
- 4.0.x src/Controller/LingotekSupportedLocalesController.php \Drupal\lingotek\Controller\LingotekSupportedLocalesController::content()
- 3.0.x src/Controller/LingotekSupportedLocalesController.php \Drupal\lingotek\Controller\LingotekSupportedLocalesController::content()
- 3.1.x src/Controller/LingotekSupportedLocalesController.php \Drupal\lingotek\Controller\LingotekSupportedLocalesController::content()
- 3.2.x src/Controller/LingotekSupportedLocalesController.php \Drupal\lingotek\Controller\LingotekSupportedLocalesController::content()
- 3.3.x src/Controller/LingotekSupportedLocalesController.php \Drupal\lingotek\Controller\LingotekSupportedLocalesController::content()
- 3.5.x src/Controller/LingotekSupportedLocalesController.php \Drupal\lingotek\Controller\LingotekSupportedLocalesController::content()
- 3.6.x src/Controller/LingotekSupportedLocalesController.php \Drupal\lingotek\Controller\LingotekSupportedLocalesController::content()
- 3.7.x src/Controller/LingotekSupportedLocalesController.php \Drupal\lingotek\Controller\LingotekSupportedLocalesController::content()
- 3.8.x src/Controller/LingotekSupportedLocalesController.php \Drupal\lingotek\Controller\LingotekSupportedLocalesController::content()
1 string reference to 'LingotekSupportedLocalesController::content'
File
- src/
Controller/ LingotekSupportedLocalesController.php, line 12
Class
Namespace
Drupal\lingotek\ControllerCode
public function content() {
$locales = $this->lingotek
->getLocalesInfo();
ksort($locales);
$build = [];
$build['#attached']['library'][] = 'lingotek/lingotek.locales_listing';
$build['filters'] = [
'#type' => 'container',
'#attributes' => [
'class' => [
'table-filter',
'js-show',
],
],
];
$build['filters']['text'] = [
'#type' => 'search',
'#title' => $this
->t('Filter'),
'#title_display' => 'invisible',
'#size' => 60,
'#placeholder' => $this
->t('Filter per language, locale, or country'),
'#attributes' => [
'class' => [
'locales-filter-text',
],
'data-table' => '.locales-listing-table',
'autocomplete' => 'off',
'title' => $this
->t('Enter a code or name of any language, locale, or country to filter by.'),
],
];
$build['locales'] = [
'#type' => 'table',
'#header' => [
'code' => $this
->t('Code'),
'language_code' => $this
->t('Language Code'),
'title' => $this
->t('Title'),
'language' => $this
->t('Language'),
'country_code' => $this
->t('Country Code'),
'country' => $this
->t('Country'),
],
'#rows' => $locales,
'#attributes' => [
'class' => [
'locales-listing-table',
],
],
];
return $build;
}