forked from cardosofelipe/fast-next-template
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user