function CustomStrings::getLanguage

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/StringTranslation/Translator/CustomStrings.php \Drupal\Core\StringTranslation\Translator\CustomStrings::getLanguage()
  2. 10 core/lib/Drupal/Core/StringTranslation/Translator/CustomStrings.php \Drupal\Core\StringTranslation\Translator\CustomStrings::getLanguage()
  3. 11.x core/lib/Drupal/Core/StringTranslation/Translator/CustomStrings.php \Drupal\Core\StringTranslation\Translator\CustomStrings::getLanguage()

Retrieves translations for a given language.

Parameters

string $langcode: The langcode of the language.

Return value

array A multidimensional array of translations, indexed by the context the source string belongs to. The second level is using original strings as keys. An empty array will be returned when no translations are available.

Overrides StaticTranslation::getLanguage

File

core/lib/Drupal/Core/StringTranslation/Translator/CustomStrings.php, line 39

Class

CustomStrings
String translator using overrides from variables.

Namespace

Drupal\Core\StringTranslation\Translator

Code

protected function getLanguage($langcode) {
    return $this->settings
        ->get('locale_custom_strings_' . $langcode, []);
}

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