🌐 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

@@ -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>