Skip to content

Commit

Permalink
Fix locale in asset controller
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickePatate committed Sep 12, 2024
1 parent ec6e66c commit 5e42f7f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Http/LangController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Code16\Sharp\Http;

use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Cache;

Expand All @@ -11,9 +12,9 @@ class LangController extends Controller
* Echoes out the localization messages as a JS file,
* to be used by the front code (Vue.js).
*/
public function index()
public function index(Request $request)
{
$lang = app()->getLocale();
$lang = $request->has('locale') ? $request->input('locale') : app()->getLocale();
$version = sharp_version();

$strings = Cache::rememberForever("sharp.lang.$lang.$version.js", function () {
Expand Down

0 comments on commit 5e42f7f

Please sign in to comment.