function locale_is_translatable

Same name in other branches
  1. 9 core/modules/locale/locale.module \locale_is_translatable()
  2. 8.9.x core/modules/locale/locale.module \locale_is_translatable()
  3. 10 core/modules/locale/locale.module \locale_is_translatable()

Checks whether $langcode is a language supported as a locale target.

Parameters

string $langcode: The language code.

Return value

bool Whether $langcode can be translated to in locale.

8 calls to locale_is_translatable()
ExportForm::buildForm in core/modules/locale/src/Form/ExportForm.php
Form constructor.
ImportForm::buildForm in core/modules/locale/src/Form/ImportForm.php
Form constructor for the translation import screen.
LocaleConfigManager::processTranslatableData in core/modules/locale/src/LocaleConfigManager.php
Process the translatable data array with a given language.
LocaleConfigManager::updateConfigTranslations in core/modules/locale/src/LocaleConfigManager.php
Updates all configuration translations for the names / languages provided.
LocaleConfigSubscriber::updateLocaleStorage in core/modules/locale/src/LocaleConfigSubscriber.php
Update locale storage based on configuration translations.

... See full list

File

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

Code

function locale_is_translatable($langcode) {
    return $langcode != 'en' || \Drupal::config('locale.settings')->get('translate_english');
}

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