Update sitemaps and improve language handling

- Updated last modification dates in static and tools sitemaps to 2026-04-01.
- Enhanced language switching in the Header component to ensure language resources are loaded before changing the language.
- Added language resource loading logic in i18n configuration to support dynamic loading of language files.
- Improved SEO route page to ensure correct language is set based on URL parameters.
- Adjusted global CSS for deferred sections to optimize rendering.
- Configured Nginx to enable Brotli compression for better performance.
This commit is contained in:
Your Name
2026-04-01 07:25:24 +02:00
parent eb8d6463c5
commit 568446697c
13 changed files with 378 additions and 273 deletions

View File

@@ -3,6 +3,7 @@ import { Link } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { FileText, Moon, Sun, Menu, X, ChevronDown, UserRound } from 'lucide-react';
import { useAuthStore } from '@/stores/authStore';
import { ensureLanguageResources } from '@/i18n';
interface LangOption {
code: string;
label: string;
@@ -58,8 +59,9 @@ export default function Header() {
return () => document.removeEventListener('mousedown', handleClick);
}, []);
const switchLang = (code: string) => {
i18n.changeLanguage(code);
const switchLang = async (code: string) => {
const resolved = await ensureLanguageResources(code);
void i18n.changeLanguage(resolved);
setLangOpen(false);
};
@@ -140,7 +142,7 @@ export default function Header() {
{languages.map((lang) => (
<button
key={lang.code}
onClick={() => switchLang(lang.code)}
onClick={() => void switchLang(lang.code)}
className={`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors ${
lang.code === i18n.language
? 'bg-primary-50 text-primary-700 dark:bg-primary-900/30 dark:text-primary-400'