🌐 Add multilingual configuration and translation files

This commit is contained in:
HolgerHatGarKeineNode
2025-11-22 23:53:15 +01:00
parent ff2a5636f6
commit 8600f98312
27 changed files with 1090 additions and 384 deletions

View File

@@ -10,13 +10,13 @@
<flux:header container class="border-b border-zinc-200 bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-900">
<flux:sidebar.toggle class="lg:hidden" icon="bars-2" inset="left"/>
<a href="{{ route('dashboard', ['country' => 'de']) }}" class="ms-2 me-5 flex items-center space-x-2 rtl:space-x-reverse lg:ms-0"
<a href="{{ route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()]) }}" class="ms-2 me-5 flex items-center space-x-2 rtl:space-x-reverse lg:ms-0"
wire:navigate>
<x-app-logo/>
</a>
<flux:navbar class="-mb-px max-lg:hidden">
<flux:navbar.item icon="layout-grid" :href="route('dashboard', ['country' => 'de'])"
<flux:navbar.item icon="layout-grid" :href="route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()])"
:current="request()->routeIs('dashboard')" wire:navigate>
{{ __('Dashboard') }}
</flux:navbar.item>
@@ -99,14 +99,14 @@
class="lg:hidden border-e border-zinc-200 bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-900">
<flux:sidebar.toggle class="lg:hidden" icon="x-mark"/>
<a href="{{ route('dashboard', ['country' => 'de']) }}" class="ms-1 flex items-center space-x-2 rtl:space-x-reverse"
<a href="{{ route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()]) }}" class="ms-1 flex items-center space-x-2 rtl:space-x-reverse"
wire:navigate>
<x-app-logo/>
</a>
<flux:navlist variant="outline">
<flux:navlist.group :heading="__('Platform')">
<flux:navlist.item icon="layout-grid" :href="route('dashboard', ['country' => 'de'])"
<flux:navlist.item icon="layout-grid" :href="route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()])"
:current="request()->routeIs('dashboard')" wire:navigate>
{{ __('Dashboard') }}
</flux:navlist.item>

View File

@@ -6,7 +6,7 @@
<body class="min-h-screen bg-neutral-100 antialiased dark:bg-linear-to-b dark:from-neutral-950 dark:to-neutral-900">
<div class="bg-muted flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
<div class="flex w-full max-w-md flex-col gap-6">
<a href="{{ route('dashboard', ['country' => 'de']) }}" class="flex flex-col items-center gap-2 font-medium" wire:navigate>
<a href="{{ route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()]) }}" class="flex flex-col items-center gap-2 font-medium" wire:navigate>
<span class="flex h-9 w-9 items-center justify-center rounded-md">
<x-app-logo-icon class="size-9 fill-current text-black dark:text-white" />
</span>

View File

@@ -7,7 +7,7 @@
<div class="relative grid h-dvh flex-col items-center justify-center px-8 sm:px-0 lg:max-w-none lg:grid-cols-2 lg:px-0">
<div class="bg-muted relative hidden h-full flex-col p-10 text-white lg:flex dark:border-e dark:border-neutral-800">
<div class="absolute inset-0 bg-neutral-900"></div>
<a href="{{ route_with_country('home') }}" class="relative z-20 flex items-center text-lg font-medium" wire:navigate>
<a href="{{ route('welcome') }}" class="relative z-20 flex items-center text-lg font-medium" wire:navigate>
<span class="flex h-10 w-10 items-center justify-center rounded-md">
<x-app-logo-icon class="me-2 h-7 fill-current text-white" />
</span>
@@ -27,7 +27,7 @@
</div>
<div class="w-full lg:p-8">
<div class="mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px]">
<a href="{{ route('dashboard', ['country' => 'de']) }}" class="z-20 flex flex-col items-center gap-2 font-medium lg:hidden" wire:navigate>
<a href="{{ route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()]) }}" class="z-20 flex flex-col items-center gap-2 font-medium lg:hidden" wire:navigate>
<span class="flex h-9 w-9 items-center justify-center rounded-md">
<x-app-logo-icon class="size-9 fill-current text-black dark:text-white" />
</span>

View File

@@ -32,7 +32,7 @@ class extends Component {
session(['auth.password_confirmed_at' => time()]);
$this->redirectIntended(default: route('dashboard', ['country' => 'de'], absolute: false), navigate: true);
$this->redirectIntended(default: route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()], absolute: false), navigate: true);
}
}; ?>

View File

@@ -64,7 +64,7 @@ class extends Component {
Auth::loginUsingId($user->id);
Session::regenerate();
$this->redirectIntended(
default: route('dashboard', ['country' => 'de'], absolute: false),
default: route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()], absolute: false),
navigate: true,
);
return;
@@ -87,7 +87,7 @@ class extends Component {
Session::regenerate();
$this->redirectIntended(
default: route('dashboard', ['country' => 'de'], absolute: false),
default: route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()], absolute: false),
navigate: true
);
}
@@ -135,7 +135,7 @@ class extends Component {
->notify(new ModelCreatedNotification($user, 'users'));
auth()->login($user);
return to_route('dashboard', ['country' => 'de']);
return to_route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()]);
}
return true;

View File

@@ -35,7 +35,7 @@ class extends Component {
Auth::login($user);
$this->redirectIntended(route('dashboard', ['country' => 'de'],absolute: false), navigate: true);
$this->redirectIntended(route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()],absolute: false), navigate: true);
}
}; ?>

View File

@@ -17,7 +17,7 @@ class extends Component {
public function sendVerification(): void
{
if (Auth::user()->hasVerifiedEmail()) {
$this->redirectIntended(default: route('dashboard', ['country' => 'de'],absolute: false), navigate: true);
$this->redirectIntended(default: route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()],absolute: false), navigate: true);
return;
}

View File

@@ -10,6 +10,22 @@ new
class extends Component {
use SeoTrait;
public string $country = 'de';
public float $latitude = 0.0;
public float $longitude = 0.0;
public function mount(): void
{
$this->country = request()->route('country');
$geoCountry = \Lwwcas\LaravelCountries\Models\Country::query()
->where('iso_alpha_2', str($this->country)->upper())
->first()
?->coordinates()
->first();
$this->latitude = $geoCountry->latitude ?? 51.165691;
$this->longitude = $geoCountry->longitude ?? 10.451526;
}
public function with(): array
{
return [
@@ -43,10 +59,12 @@ class extends Component {
</div>
<div x-data="{
markers: @js($meetups),
latitude: $wire.entangle('latitude'),
longitude: $wire.entangle('longitude'),
initializeMap() {
const map = L.map($refs.map, {
scrollWheelZoom: false
}).setView([51.1657, 10.4515], 6);
}).setView([this.latitude, this.longitude], 6);
L.tileLayer('https://tile.openstreetmap.de/{z}/{x}/{y}.png', {
minZoom: 0,

View File

@@ -64,7 +64,7 @@ class extends Component {
$user = Auth::user();
if ($user->hasVerifiedEmail()) {
$this->redirectIntended(default: route('dashboard', ['country' => 'de'],absolute: false));
$this->redirectIntended(default: route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()],absolute: false));
return;
}

View File

@@ -13,12 +13,12 @@ class extends Component {
public function goToMeetups(): void
{
$this->redirect(route_with_country('meetups.index'), navigate: true);
$this->redirect(route('meetups.index', ['country' => str(session('lang_country', 'de'))->after('-')->lower()]), navigate: true);
}
public function goToMap(): void
{
$this->redirect(route_with_country('meetups.map'), navigate: true);
$this->redirect(route('meetups.map', ['country' => str(session('lang_country', 'de'))->after('-')->lower()]), navigate: true);
}
}; ?>
@@ -60,7 +60,7 @@ class extends Component {
{{ __('Kartenansicht öffnen') }}
</flux:button>
<flux:button :href="route('dashboard', ['country' => 'de'])" class="cursor-pointer w-full"
<flux:button :href="route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()])" class="cursor-pointer w-full"
icon="arrow-right-start-on-rectangle">
{{ __('Login') }}
</flux:button>