Only attempt to get default locale if db is up to date

This commit is contained in:
Toby Zerner 2015-10-31 18:21:39 +10:30
parent 953f81176b
commit b44ffd9f8d

View File

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