Changes: - Root page.tsx now detects browser language (Accept-Language header) and cookie preference to redirect to correct locale (/sr or /en) - Middleware handles old Serbian URLs (/products, /about, etc.) with 301 redirects to /sr/* while respecting locale cookie - Header component now includes language switcher dropdown with flag icons (Serbian and English) - Language selection sets NEXT_LOCALE cookie and persists preference Behavior: - User visits / → redirects to /sr or /en based on cookie/browser - User selects English from dropdown → cookie set, redirects to /en/* - User visits /products with en cookie → /en/products (301) - User visits /products with sr/no cookie → /sr/products (301)
1.4 KiB
1.4 KiB