Skip to content

Commit

Permalink
[Translation] fixed previous merge
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Sep 20, 2011
1 parent 01a24db commit 774ac80
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Symfony/Component/Translation/Translator.php
Expand Up @@ -182,10 +182,6 @@ private function loadFallbackCatalogues($locale)
{
$current = $this->catalogues[$locale];
foreach ($this->computeFallbackLocales($locale) as $fallback) {
if ($fallback === $locale) {
continue;
}

if (!isset($this->catalogues[$fallback])) {
$this->doLoadCatalogue($fallback);
}
Expand All @@ -197,7 +193,14 @@ private function loadFallbackCatalogues($locale)

private function computeFallbackLocales($locale)
{
$locales = $this->fallbackLocales;
$locales = array();
foreach ($this->fallbackLocales as $fallback) {
if ($fallback === $locale) {
continue;
}

$locales[] = $fallback;
}

if (strlen($locale) > 3) {
array_unshift($locales, substr($locale, 0, -strlen(strrchr($locale, '_'))));
Expand Down

0 comments on commit 774ac80

Please sign in to comment.