mirror of
https://github.com/flarum/core.git
synced 2025-08-15 12:54:47 +02:00
Get rid of some Application methods
These are not necessary to be available so broadly. In fact, they seem to make it too easy to use them, which has lead to some sub- optimal architecture decisions. Their equivalents have been moved to the classes where used.
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Flarum\Locale;
|
||||
|
||||
use Flarum\Event\ConfigureLocales;
|
||||
use Flarum\Foundation\AbstractServiceProvider;
|
||||
use Flarum\Settings\SettingsRepositoryInterface;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Illuminate\Contracts\Translation\Translator as TranslatorContract;
|
||||
use Symfony\Component\Translation\MessageSelector;
|
||||
@@ -54,8 +55,8 @@ class LocaleServiceProvider extends AbstractServiceProvider
|
||||
|
||||
private function getDefaultLocale(): string
|
||||
{
|
||||
return $this->app->isInstalled() && $this->app->isUpToDate()
|
||||
? $this->app->make('flarum.settings')->get('default_locale', 'en')
|
||||
: 'en';
|
||||
$repo = $this->app->make(SettingsRepositoryInterface::class);
|
||||
|
||||
return $repo->get('default_locale', 'en');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user