You are here

protected function Translator::computeFallbackLocales in Plug 7

2 calls to Translator::computeFallbackLocales()
Translator::initializeCatalogue in lib/Symfony/translation/Translator.php
Translator::loadFallbackCatalogues in lib/Symfony/translation/Translator.php

File

lib/Symfony/translation/Translator.php, line 457

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);
}