feat: soporte multi idioma en la web (infraestructura)
i18next + react-i18next con es-AR (fuente), es-419, pt-BR y en; el idioma sale del dispositivo (fallback a inglés) y se puede cambiar en Ajustes. La elección se guarda en localStorage y, para el profe, en users.locale. Las validaciones de shared pasan a claves y los errores de la API se traducen por code (con params para límites de plan y cupo). Migrados: layout, Ajustes, auth, PWA y lib/format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
import { Check } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useTheme } from '../../context/ThemeProvider'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { THEME_ICONS, THEME_OPTIONS } from './constants'
|
||||
|
||||
export function AppearanceCard() {
|
||||
const { theme, setTheme } = useTheme()
|
||||
const { t } = useTranslation('settings')
|
||||
|
||||
return (
|
||||
<div className="divide-y divide-border rounded-xl border border-border bg-surface">
|
||||
<div className="px-4 py-3">
|
||||
<p className="text-sm font-medium text-primary">Apariencia</p>
|
||||
<p className="text-xs text-foreground/50">Tema claro u oscuro</p>
|
||||
<p className="text-sm font-medium text-primary">{t('appearance.title')}</p>
|
||||
<p className="text-xs text-foreground/50">{t('appearance.description')}</p>
|
||||
</div>
|
||||
{THEME_OPTIONS.map((option) => {
|
||||
const Icon = THEME_ICONS[option.value]
|
||||
@@ -29,9 +31,9 @@ export function AppearanceCard() {
|
||||
</span>
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className={cn('text-sm font-medium', isSelected ? 'text-accent-fg' : 'text-primary')}>
|
||||
{option.label}
|
||||
{t(option.label)}
|
||||
</p>
|
||||
<p className="text-xs text-foreground/50">{option.description}</p>
|
||||
<p className="text-xs text-foreground/50">{t(option.description)}</p>
|
||||
</div>
|
||||
{isSelected ? <Check className="size-4 text-accent-fg" /> : null}
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user