W3cubDocs

/Drupal 8

function locale_translatable_language_list

locale_translatable_language_list()

Returns list of translatable languages.

Return value

array Array of installed languages keyed by language name. English is omitted unless it is marked as translatable.

File

core/modules/locale/locale.module, line 251
Enables the translation of the user interface to languages other than English.

Code

function locale_translatable_language_list() {
  $languages = \Drupal::languageManager()->getLanguages();
  if (!locale_is_translatable('en')) {
    unset($languages['en']);
  }
  return $languages;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!locale!locale.module/function/locale_translatable_language_list/8.1.x