function locale_translatable_language_list

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

14 calls to locale_translatable_language_list()
locale_cron in core/modules/locale/locale.module
Implements hook_cron().
locale_requirements in core/modules/locale/locale.install
Implements hook_requirements().
locale_system_remove in core/modules/locale/locale.module
Delete translation history of modules and themes.
locale_system_update in core/modules/locale/locale.module
Imports translations when new modules or themes are installed.
locale_translate_get_interface_translation_files in core/modules/locale/locale.bulk.inc
Get interface translation files present in the translations directory.

... See full list

File

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

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.