mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 06:37:11 +08:00
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:
parent
f13ded1255
commit
72a2749943
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user