From b44ffd9f8d3ae1514f353914310b3daac4ba97e2 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sat, 31 Oct 2015 18:21:39 +1030 Subject: [PATCH] Only attempt to get default locale if db is up to date --- src/Locale/LocaleServiceProvider.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Locale/LocaleServiceProvider.php b/src/Locale/LocaleServiceProvider.php index 71bbda9e2..93ee825c9 100644 --- a/src/Locale/LocaleServiceProvider.php +++ b/src/Locale/LocaleServiceProvider.php @@ -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]);