1 <?php namespace BookStack\Providers;
3 use BookStack\Translation\Translator;
5 class TranslationServiceProvider extends \Illuminate\Translation\TranslationServiceProvider
8 * Register the service provider.
12 public function register()
14 $this->registerLoader();
16 $this->app->singleton('translator', function ($app) {
17 $loader = $app['translation.loader'];
19 // When registering the translator component, we'll need to set the default
20 // locale as well as the fallback locale. So, we'll grab the application
21 // configuration so we can easily get both of these values from there.
22 $locale = $app['config']['app.locale'];
24 $trans = new Translator($loader, $locale);
26 $trans->setFallback($app['config']['app.fallback_locale']);