Skip to content

Commit da6743f

Browse files
Fix locale on LangController
1 parent b5126e4 commit da6743f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Http/LangController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function index(Request $request)
1717
$lang = $request->has('locale') ? $request->input('locale') : app()->getLocale();
1818
$version = sharp_version();
1919

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

3232
collect($files)
33-
->map(function (string $filename) {
34-
return collect(trans("sharp-front::$filename"))
33+
->map(function (string $filename) use($lang) {
34+
return collect(trans("sharp-front::$filename", [], $lang))
3535
->mapWithKeys(function ($value, $key) use ($filename) {
3636
return ["$filename.$key" => $value];
3737
})

0 commit comments

Comments
 (0)