Skip to content

Commit

Permalink
Fix locale on LangController
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickePatate committed Sep 12, 2024
1 parent b5126e4 commit da6743f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Http/LangController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function index(Request $request)
$lang = $request->has('locale') ? $request->input('locale') : app()->getLocale();
$version = sharp_version();

$strings = Cache::rememberForever("sharp.lang.$lang.$version.js", function () {
$strings = Cache::rememberForever("sharp.lang.$lang.$version.js", function () use($lang) {
$localizationStrings = [];
$files = [
'action_bar',
Expand All @@ -30,8 +30,8 @@ public function index(Request $request)
];

collect($files)
->map(function (string $filename) {
return collect(trans("sharp-front::$filename"))
->map(function (string $filename) use($lang) {
return collect(trans("sharp-front::$filename", [], $lang))
->mapWithKeys(function ($value, $key) use ($filename) {
return ["$filename.$key" => $value];
})
Expand Down

0 comments on commit da6743f

Please sign in to comment.