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 { passkey } from '@better-auth/passkey';
|
||||
import { appLocaleSchema } from '@gruperly/shared';
|
||||
import { betterAuth } from 'better-auth';
|
||||
import { prismaAdapter } from 'better-auth/adapters/prisma';
|
||||
import { organization } from 'better-auth/plugins/organization';
|
||||
@@ -11,6 +12,18 @@ export const auth = betterAuth({
|
||||
database: prismaAdapter(getPrismaClient(), {
|
||||
provider: 'postgresql',
|
||||
}),
|
||||
user: {
|
||||
additionalFields: {
|
||||
// UI language chosen in Ajustes; null means "follow the device". The web
|
||||
// saves it with updateUser and reads it back from the session.
|
||||
locale: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
input: true,
|
||||
validator: { input: appLocaleSchema.nullable() },
|
||||
},
|
||||
},
|
||||
},
|
||||
emailAndPassword: {
|
||||
enabled: true,
|
||||
minPasswordLength: 8,
|
||||
|
||||
Reference in New Issue
Block a user