mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 06:14:33 +08:00
Only attempt to get default locale if db is up to date
This commit is contained in:
parent
953f81176b
commit
b44ffd9f8d
|
@ -37,7 +37,9 @@ class LocaleServiceProvider extends AbstractServiceProvider
|
|||
$this->app->alias('Flarum\Locale\LocaleManager', 'flarum.localeManager');
|
||||
|
||||
$this->app->singleton('translator', function () {
|
||||
$defaultLocale = $this->app->isInstalled() ? $this->app->make('flarum.settings')->get('default_locale') : 'en';
|
||||
$defaultLocale = $this->app->isInstalled() && $this->app->isUpToDate()
|
||||
? $this->app->make('flarum.settings')->get('default_locale', 'en')
|
||||
: 'en';
|
||||
|
||||
$translator = new Translator($defaultLocale, new MessageSelector());
|
||||
$translator->setFallbackLocales([$defaultLocale]);
|
||||
|
|
Loading…
Reference in New Issue
Block a user