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