Przeglądaj źródła

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

Eugene Babushkin 13 lat temu
rodzic
commit
2434552aa9
1 zmienionych plików z 1 dodań i 1 usunięć
  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;