You are here

function locale_translatable_language_list in Drupal 9

Same name and namespace in other branches
  1. 8 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
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;
}