@@ 43-53 (lines=11) @@ | ||
40 | ]; |
|
41 | } |
|
42 | ||
43 | public function boot() |
|
44 | { |
|
45 | $this->app->singleton('time_diff_translator', function ($app) { |
|
46 | $loader = $app->make('translation.loader'); |
|
47 | $locale = $app->config->get('app.locale'); |
|
48 | $translator = $app->make(TimeDiffTranslator::class, [$loader, $locale]); |
|
49 | $translator->setFallback($app->config->get('app.fallback_locale')); |
|
50 | ||
51 | return $translator; |
|
52 | }); |
|
53 | } |
|
54 | ||
55 | /** |
|
56 | * Add Twig extensions. |
@@ 17-31 (lines=15) @@ | ||
14 | /** |
|
15 | * @return void |
|
16 | */ |
|
17 | public function setUp() |
|
18 | { |
|
19 | parent::setUp(); |
|
20 | ||
21 | $this->app->setLocale('en'); |
|
22 | ||
23 | $this->app->singleton('time_diff_translator', function ($app) { |
|
24 | $loader = $app->make('translation.loader'); |
|
25 | $locale = $app->config->get('app.locale'); |
|
26 | $translator = $app->make(TimeDiffTranslator::class, [$loader, $locale]); |
|
27 | $translator->setFallback($app->config->get('app.fallback_locale')); |
|
28 | ||
29 | return $translator; |
|
30 | }); |
|
31 | } |
|
32 | ||
33 | /** |
|
34 | * Return Twig environment |