mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-14 12:06:46 +00:00
- Replaced inline language selection logic in `profile.blade.php` with `<x-einundzwanzig.language-selector>`. - Introduced Hungarian (`hu.json`) translations for improved multilingual support. - Updated `DomainMiddleware` to include settings for Hungarian locale and portal branding.
45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Closure;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\App;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
class DomainMiddleware
|
|
{
|
|
public function handle(Request $request, Closure $next): Response
|
|
{
|
|
$domain = $request->getHost(); // Erkennt die aktuelle Domain (via CNAME)
|
|
|
|
// domains
|
|
$domainArray = [
|
|
'portal.eenentwintig.net' => [
|
|
'locale' => 'nl',
|
|
'lang_country' => 'nl-NL',
|
|
'app_name' => 'EENENTWINTIG Portaal',
|
|
],
|
|
'portal.huszonegy.world/' => [
|
|
'locale' => 'hu',
|
|
'lang_country' => 'hu-HU',
|
|
'app_name' => ' HUSZONEGY Portál',
|
|
],
|
|
];
|
|
|
|
// App-Locale dynamisch setzen
|
|
if (isset($domainArray[$domain]['locale'])) {
|
|
session([
|
|
'lang_country' => $domainArray[$domain]['lang_country'],
|
|
]);
|
|
config([
|
|
'app.name' => $domainArray[$domain]['app_name'],
|
|
'app.domain_country' => $domainArray[$domain]['locale'],
|
|
]);
|
|
App::setLocale($domainArray[$domain]['locale']);
|
|
}
|
|
|
|
return $next($request);
|
|
}
|
|
}
|