W3cubDocs

/Drupal 8

function locale_is_translatable

locale_is_translatable($langcode)

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.

File

core/modules/locale/locale.module, line 743
Enables the translation of the user interface to languages other than English.

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!locale!locale.module/function/locale_is_translatable/8.1.x