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.

14 calls to locale_translatable_language_list()
LocaleHooks::cron in core/modules/locale/src/Hook/LocaleHooks.php
Implements hook_cron().
LocaleRequirements::runtime in core/modules/locale/src/Hook/LocaleRequirements.php
Implements hook_runtime_requirements().
LocaleSource::buildSources in core/modules/locale/src/LocaleSource.php
Build translation sources.
LocaleSource::loadSources in core/modules/locale/src/LocaleSource.php
Loads cached translation sources containing current translation status.
locale_system_remove in core/modules/locale/locale.module
Delete translation history of modules and themes.

... See full list

File

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

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.