You are here

protected function Translator::computeFallbackLocales in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/translation/Translator.php \Symfony\Component\Translation\Translator::computeFallbackLocales()
2 calls to Translator::computeFallbackLocales()
Translator::initializeCatalogue in vendor/symfony/translation/Translator.php
Translator::loadFallbackCatalogues in vendor/symfony/translation/Translator.php

File

vendor/symfony/translation/Translator.php, line 432

Class

Translator
Translator.

Namespace

Symfony\Component\Translation

Code

protected function computeFallbackLocales($locale) {
  $locales = array();
  foreach ($this->fallbackLocales as $fallback) {
    if ($fallback === $locale) {
      continue;
    }
    $locales[] = $fallback;
  }
  if (strrchr($locale, '_') !== false) {
    array_unshift($locales, substr($locale, 0, -strlen(strrchr($locale, '_'))));
  }
  return array_unique($locales);
}