import type { Locale } from '../lib/i18n/types'; import { useAppDispatch, useAppSelector } from '../store/hooks'; import { setLocale } from '../store/localeSlice'; // Listed roughly by speaker count (English first as the source-of-truth locale). // Labels are intentionally rendered in each locale's own script so the picker // is recognisable to a native speaker even before the rest of the UI rerenders. interface LocaleOption { value: Locale; flag: string; label: string; } export const LOCALE_OPTIONS: LocaleOption[] = [ { value: 'en', flag: '🇬🇧', label: 'English' }, { value: 'ko', flag: '🇰🇷', label: '한국어' }, { value: 'zh-CN', flag: '🇨🇳', label: '简体中文' }, { value: 'hi', flag: '🇮🇳', label: 'हिन्दी' }, { value: 'es', flag: '🇪🇸', label: 'Español' }, { value: 'ar', flag: '🇸🇦', label: 'العربية' }, { value: 'fr', flag: '🇫🇷', label: 'Français' }, { value: 'bn', flag: '🇧🇩', label: 'বাংলা' }, { value: 'pt', flag: '🇵🇹', label: 'Português' }, { value: 'de', flag: '🇩🇪', label: 'Deutsch' }, { value: 'ru', flag: '🇷🇺', label: 'Русский' }, { value: 'id', flag: '🇮🇩', label: 'Bahasa Indonesia' }, { value: 'it', flag: '🇮🇹', label: 'Italiano' }, { value: 'pl', flag: '🇵🇱', label: 'Polski' }, ]; interface LanguageSelectProps { /** Accessible label for the underlying dispatch(setLocale(e.target.value as Locale))} aria-label={ariaLabel} className={className ?? DEFAULT_CLASS}> {LOCALE_OPTIONS.map(opt => ( ))} ); }; export default LanguageSelect;