mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-14 12:06:46 +00:00
🌐 Introduce dynamic domain-based locale and country handling
- Added `DomainMiddleware` to dynamically set locale, language-country session, and app name based on domain.
- Updated views and components to leverage `lang_country` session for language and region-specific content.
- Enhanced country parameter retrieval with `config('app.domain_country')` as fallback.
- Refined language filtering by scanning available language files dynamically.
- Added language-specific assets and translations (`nl.json`, `es.json`) with improved language-region associations.
- Updated `app-logo-icon` to display region-specific images or default SVGs.
- Improved views with cleaner, dynamic rendering and session-aware functionalities.
This commit is contained in:
@@ -36,9 +36,12 @@ class extends Component {
|
||||
public ?string $url = null;
|
||||
public ?string $lnurl = null;
|
||||
public ?string $qrCode = null;
|
||||
public string $currentLangCountry = 'de-DE';
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$this->currentLangCountry = session('lang_country');
|
||||
|
||||
// Nur beim ersten Mount initialisieren
|
||||
if ($this->k1 === null) {
|
||||
$this->k1 = bin2hex(str()->random(32));
|
||||
@@ -64,7 +67,7 @@ class extends Component {
|
||||
Auth::loginUsingId($user->id);
|
||||
Session::regenerate();
|
||||
$this->redirectIntended(
|
||||
default: route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()], absolute: false),
|
||||
default: route('dashboard', ['country' => str(session('lang_country', config('app.domain_country')))->after('-')->lower()], absolute: false),
|
||||
navigate: true,
|
||||
);
|
||||
return;
|
||||
@@ -85,9 +88,12 @@ class extends Component {
|
||||
|
||||
RateLimiter::clear($this->throttleKey());
|
||||
Session::regenerate();
|
||||
session([
|
||||
'lang_country' => $this->currentLangCountry,
|
||||
]);
|
||||
|
||||
$this->redirectIntended(
|
||||
default: route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()], absolute: false),
|
||||
default: route('dashboard', ['country' => str(session('lang_country', config('app.domain_country')))->after('-')->lower()], absolute: false),
|
||||
navigate: true
|
||||
);
|
||||
}
|
||||
@@ -134,8 +140,12 @@ class extends Component {
|
||||
\App\Models\User::find(1)
|
||||
->notify(new ModelCreatedNotification($user, 'users'));
|
||||
auth()->login($user);
|
||||
Session::regenerate();
|
||||
session([
|
||||
'lang_country' => $this->currentLangCountry,
|
||||
]);
|
||||
|
||||
return to_route('dashboard', ['country' => str(session('lang_country', 'de'))->after('-')->lower()]);
|
||||
return to_route('dashboard', ['country' => str(session('lang_country', config('app.domain_country')))->after('-')->lower()]);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user