new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Better Auth · Plugins · all subjects

i18n/options

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

i18n translations option format

The translations option takes a Record<string, Record<string, string>> where the outer keys are locale codes (e.g., 'fr', 'de') and inner keys are error codes mapped to translated strings. For example: { fr: { USER_NOT_FOUND: 'Utilisateur non trouvé', INVALID_EMAIL_OR_PASSWORD: 'Email ou mot de passe invalide' }, de: { USER_NOT_FOUND: 'Benutzer nicht gefunden' } }.

i18n defaultLocale option

The defaultLocale option specifies the fallback locale when no locale can be detected or the detected locale is not in the translations. Type is string with default value 'en'.

i18n detection option

The detection option takes an array of detection strategy strings in priority order: Array<'header' | 'cookie' | 'session' | 'callback'>. Default is ['header']. The first strategy that returns a valid locale will be used.

i18n localeCookie option

The localeCookie option specifies the name of the cookie to read when using the 'cookie' detection strategy. Type is string with default value 'locale'.

i18n userLocaleField option

The userLocaleField option specifies the field name on the user object that stores their locale preference when using the 'session' detection strategy. Type is string with default value 'locale'.

i18n getLocale callback option

The getLocale option is a custom function with signature (ctx: GenericEndpointContext) => string | null | Promise<string | null> used for the 'callback' detection strategy. It receives the full endpoint context and should return the locale code or null. Note that ctx.request could be undefined for non-HTTP calls.

Give your agent this brain