Ver código fonte

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

Eugene Babushkin 13 anos atrás
pai
commit
2434552aa9
1 arquivos alterados com 1 adições e 1 exclusões
  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)
     protected function computeFallbackLocale($locale)
     {
     {
-        if (strlen($locale) > 3) {
+        if (strrchr($locale, '_') !== false) {
             return substr($locale, 0, -strlen(strrchr($locale, '_')));
             return substr($locale, 0, -strlen(strrchr($locale, '_')));
         } else {
         } else {
             return $this->fallbackLocale;
             return $this->fallbackLocale;