/** * Language Selector Component * * A dropdown component for selecting the application language. * Automatically updates the i18n language and persists to localStorage. * * Props: * @param {boolean} compact - If true, uses compact style (default: false) */ import { useTranslation } from 'react-i18next'; import { Languages } from 'lucide-react'; import { languages } from '../i18n/languages'; function LanguageSelector({ compact = false }) { const { i18n, t } = useTranslation('settings'); const handleLanguageChange = (event) => { const newLanguage = event.target.value; i18n.changeLanguage(newLanguage); }; // Compact style for QuickSettingsPanel if (compact) { return (
{t('account.language')}
); } // Full style for Settings page return (
{t('account.languageLabel')}
{t('account.languageDescription')}
); } export default LanguageSelector;