Skip to content

Commit

Permalink
Merge pull request #10 from killgt/patch-1
Browse files Browse the repository at this point in the history
Delay app locale resolution
  • Loading branch information
badinansoft authored Feb 28, 2023
2 parents 9192b79 + 0528e0f commit d65aea6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/LanguageSwitch.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ public function boot(): void
{
Nova::script('language-switch', __DIR__.'/../dist/js/tool.js');
Nova::provideToScript([
'nova_language_switcher' => [
'languages' => config('nova-language-switch.supported-languages'),
'current_lang' => app()->getLocale(),
],
'nova_language_switcher' => function() {
return [
'languages' => config('nova-language-switch.supported-languages'),
'current_lang' => app()->getLocale(),
];
}
]);
}

Expand Down

0 comments on commit d65aea6

Please sign in to comment.