Skip to content

Commit

Permalink
Merge pull request #100 from frontChapter/develop
Browse files Browse the repository at this point in the history
feat: :sparkles add translation query string support
  • Loading branch information
lokiwich authored Mar 17, 2024
2 parents 8fd80f7 + 82a5d60 commit f93da4b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion app/Http/Middleware/Localization.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ class Localization
*/
public function handle(Request $request, Closure $next)
{
if (Session::has('locale')) {
if ($request->has('lang')) {
$locale = $request->get('lang', Session::get('locale'));
App::setlocale($locale);
Session::put('locale', $locale);
}
elseif(Session::has('locale')) {
App::setlocale(Session::get('locale'));
}

return $next($request);
}
}
4 changes: 2 additions & 2 deletions resources/views/livewire/gallery.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<x-slot:header>
<img class="w-full mx-auto rounded-t-xl" src="{{ asset('images/conference-night.jpg') }}">
</x-slot:header>
<div class="flex items-center justify-center w-full gap-2 px-2 text-center sm:justify-between">
<div class="flex items-center justify-center w-full gap-2 px-2 text-start sm:justify-between">
<h2 class="text-xl font-bold lg:text-2xl">
{{ __('Archive of the night before the conference') }}
</h2>
Expand All @@ -26,7 +26,7 @@
<x-slot:header>
<img class="w-full mx-auto rounded-t-xl" src="{{ asset('images/conference.jpg') }}">
</x-slot:header>
<div class="flex items-center justify-center w-full gap-2 px-2 text-center sm:justify-between">
<div class="flex items-center justify-center w-full gap-2 px-2 text-start sm:justify-between">
<h2 class="text-xl font-bold lg:text-2xl">
{{ __('Archives of the day of the conference') }}
</h2>
Expand Down

0 comments on commit f93da4b

Please sign in to comment.