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

This commit is contained in:
Eugene Babushkin 2012-02-06 21:48:03 +04:00 committed by Fabien Potencier
parent b86e6db035
commit 2434552aa9

View File

@ -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;