function LocaleLanguages::isTranslatable

Same name and namespace in other branches
  1. main core/modules/locale/src/LocaleLanguages.php \Drupal\locale\LocaleLanguages::isTranslatable()

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.

1 call to LocaleLanguages::isTranslatable()
LocaleLanguages::getTranslatableLanguages in core/modules/locale/src/LocaleLanguages.php
Returns list of translatable languages.

File

core/modules/locale/src/LocaleLanguages.php, line 42

Class

LocaleLanguages
Manages which languages are translatable and checks a specific language.

Namespace

Drupal\locale

Code

public function isTranslatable(string $langcode) : bool {
  return $langcode != 'en' || $this->configFactory
    ->get('locale.settings')
    ->get('translate_english');
}

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