Explorar o código

[Translation] Fixed fallback location if location is longer than three characters (possibly by mistake).

Eugene Babushkin %!s(int64=13) %!d(string=hai) anos
pai
achega
2434552aa9
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Symfony/Component/Translation/Translator.php

+ 1 - 1
src/Symfony/Component/Translation/Translator.php

@@ -172,7 +172,7 @@ class Translator implements TranslatorInterface
 
     protected function computeFallbackLocale($locale)
     {
-        if (strlen($locale) > 3) {
+        if (strrchr($locale, '_') !== false) {
             return substr($locale, 0, -strlen(strrchr($locale, '_')));
         } else {
             return $this->fallbackLocale;