Add locale switcher component and integrate internationalization improvements

- Introduced `LocaleSwitcher` component for language selection with support for locale-aware dropdown and ARIA accessibility.
- Updated layouts (`Header`, `Breadcrumbs`, `Home`) to include the new locale switcher.
- Expanded localization files (`en.json`, `it.json`) with new keys for language switching.
- Adjusted i18n configuration to enhance routing and message imports.
- Updated Jest module mappings to mock new i18n components and utilities.
This commit is contained in:
Felipe Cardoso
2025-11-19 01:31:51 +01:00
parent 0b192ce030
commit 333c9c40af
9 changed files with 110 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ import { Link } from '@/lib/i18n/routing';
import { Menu, X, Github, Star } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet';
import { LocaleSwitcher } from '@/components/i18n';
interface HeaderProps {
onOpenDemoModal: () => void;
@@ -63,6 +64,9 @@ export function Header({ onOpenDemoModal }: HeaderProps) {
</span>
</a>
{/* Locale Switcher */}
<LocaleSwitcher />
{/* CTAs */}
<Button onClick={onOpenDemoModal} variant="default" size="sm">
Try Demo
@@ -113,6 +117,11 @@ export function Header({ onOpenDemoModal }: HeaderProps) {
</a>
<div className="border-t pt-4 mt-4 space-y-3">
{/* Locale Switcher */}
<div className="flex justify-center">
<LocaleSwitcher />
</div>
<Button
onClick={() => {
setMobileMenuOpen(false);