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,4 +1,5 @@
|
||||
import { Share, X } from 'lucide-react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
|
||||
type IosInstallHintProps = {
|
||||
onDismiss: () => void
|
||||
@@ -10,6 +11,7 @@ type IosInstallHintProps = {
|
||||
* no action button.
|
||||
*/
|
||||
export function IosInstallHint({ onDismiss }: IosInstallHintProps) {
|
||||
const { t } = useTranslation('pwa')
|
||||
return (
|
||||
<div
|
||||
className="fixed inset-x-0 z-30 px-4 lg:left-auto lg:right-6 lg:w-96 lg:px-0
|
||||
@@ -19,18 +21,16 @@ export function IosInstallHint({ onDismiss }: IosInstallHintProps) {
|
||||
<Share className="mt-0.5 size-5 shrink-0 text-accent" strokeWidth={2} />
|
||||
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="text-sm font-semibold text-primary">Instalá Gruperly en el iPhone</p>
|
||||
<p className="text-sm font-semibold text-primary">{t('ios.title')}</p>
|
||||
<p className="mt-0.5 text-xs leading-relaxed text-foreground/70">
|
||||
Tocá <span className="font-medium text-foreground">Compartir</span> y elegí{' '}
|
||||
<span className="font-medium text-foreground">Agregar a pantalla de inicio</span> para
|
||||
abrirla como app.
|
||||
<Trans t={t} i18nKey="ios.description" components={{ strong: <span className="font-medium text-foreground" /> }} />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={onDismiss}
|
||||
aria-label="Cerrar aviso de instalación"
|
||||
aria-label={t('banner.close')}
|
||||
className="shrink-0 rounded-lg p-1 text-foreground/40 transition-colors hover:bg-primary-soft hover:text-foreground"
|
||||
>
|
||||
<X className="size-4" />
|
||||
|
||||
Reference in New Issue
Block a user