protected function FileTranslation::loadLanguage

Add translations for new language.

Parameters

string $langcode: The langcode of the language.

Overrides StaticTranslation::loadLanguage

File

drupal/core/lib/Drupal/Core/StringTranslation/Translator/FileTranslation.php, line 47
Contains \Drupal\Core\StringTranslation\Translator\FileTranslation.

Class

FileTranslation
File based string translation.

Namespace

Drupal\Core\StringTranslation\Translator

Code

protected function loadLanguage($langcode) {

  // If the given langcode was selected, there should be at least one .po
  // file with its name in the pattern drupal-$version.$langcode.po.
  // This might or might not be the entire filename. It is also possible
  // that multiple files end with the same suffix, even if unlikely.
  $files = $this
    ->findTranslationFiles($langcode);
  if (!empty($files)) {
    return $this
      ->filesToArray($langcode, $files);
  }
  else {
    return array();
  }
}