Fall back to en after the forum's default locale

Since we'll be encouraging (requiring?) people to include an "en" translation in extensions they want to put on the Marketplace, we should have a further fallback to "en" if it can't find translations in the forum's default language. That way if people only use extensions from the Marketplace, they'll hardly ever see any key names.

Thanks to @dcsjapan for the suggestion.
This commit is contained in:
Toby Zerner 2015-11-02 17:55:31 +10:30
parent f13ded1255
commit 72a2749943

View File

@ -42,7 +42,7 @@ class LocaleServiceProvider extends AbstractServiceProvider
: 'en'; : 'en';
$translator = new Translator($defaultLocale, new MessageSelector()); $translator = new Translator($defaultLocale, new MessageSelector());
$translator->setFallbackLocales([$defaultLocale]); $translator->setFallbackLocales([$defaultLocale, 'en']);
$translator->addLoader('yaml', new YamlFileLoader()); $translator->addLoader('yaml', new YamlFileLoader());
return $translator; return $translator;