You are here

protected function FileTranslation::getTranslationFilesPattern in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/StringTranslation/Translator/FileTranslation.php \Drupal\Core\StringTranslation\Translator\FileTranslation::getTranslationFilesPattern()

Provides translation file name pattern.

Parameters

string $langcode: (optional) The language code corresponding to the language for which we want to find translation files.

Return value

string String file pattern.

1 call to FileTranslation::getTranslationFilesPattern()
FileTranslation::findTranslationFiles in core/lib/Drupal/Core/StringTranslation/Translator/FileTranslation.php
Finds installer translations either for a specific or all languages.

File

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

Class

FileTranslation
File based string translation.

Namespace

Drupal\Core\StringTranslation\Translator

Code

protected function getTranslationFilesPattern($langcode = NULL) {

  // The file name matches: drupal-[release version].[language code].po
  // When provided the $langcode is use as language code. If not provided all
  // language codes will match.
  return '!drupal-[0-9a-z\\.-]+\\.' . (!empty($langcode) ? preg_quote($langcode, '!') : '[^\\.]+') . '\\.po$!';
}