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,10 +1,12 @@
|
||||
import { useReportedPaymentsCount } from '../../features/payments/reportedPayments'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { cn } from '../../lib/utils'
|
||||
|
||||
/* Counter of a nav item: today only "Pagos para verificar" on Cobros. The
|
||||
number is in the accessible name too (sr-only), not only in the dot. */
|
||||
export function NavBadge({ kind, className }: { kind: 'reported-payments'; className?: string }) {
|
||||
const count = useReportedPaymentsCount()
|
||||
const { t } = useTranslation('layout')
|
||||
if (kind !== 'reported-payments' || count === 0) return null
|
||||
return (
|
||||
<span
|
||||
@@ -13,8 +15,8 @@ export function NavBadge({ kind, className }: { kind: 'reported-payments'; class
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{count > 99 ? '99+' : count}
|
||||
<span className="sr-only"> pagos para verificar</span>
|
||||
<span aria-hidden="true">{count > 99 ? '99+' : count}</span>
|
||||
<span className="sr-only">{t('reportedPayments', { count })}</span>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user