function locale_translatable_language_list

Same name and namespace in other branches
  1. 10 core/modules/locale/locale.module \locale_translatable_language_list()
  2. 11.x core/modules/locale/locale.module \locale_translatable_language_list()
  3. 9 core/modules/locale/locale.module \locale_translatable_language_list()
  4. 8.9.x core/modules/locale/locale.module \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.

16 calls to locale_translatable_language_list()
LocaleCronHooks::cron in core/modules/locale/src/Hook/LocaleCronHooks.php
Implements hook_cron().
LocaleExtensionHooks::deleteTranslationHistory in core/modules/locale/src/Hook/LocaleExtensionHooks.php
Delete translation history of modules and themes.
LocaleExtensionHooks::extensionsInstalled in core/modules/locale/src/Hook/LocaleExtensionHooks.php
Implements hook_modules_installed().
LocaleFetch::buildFetchBatch in core/modules/locale/src/LocaleFetch.php
Builds a batch to download and import project translations.
LocaleFetch::buildUpdateBatch in core/modules/locale/src/LocaleFetch.php
Builds a batch to check, download and import project translations.

... See full list

File

core/modules/locale/locale.module, line 145

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.