Translations
Every text a user sees comes from a translation file, in English and Greek out of the box. Use this page when you add a page or an error, change wording, or add a language.
Where texts live
| Texts | Files |
|---|---|
| Core client (layout, auth, admin, …) | libs/core/client/i18n/src/assets/i18n/{en,el}.json |
| Your product’s client | libs/<product>/client/i18n/{en,el}.json |
| Emails (verification, reset, invitation, 2FA notices) | libs/core/api/mail/src/lib/templates/*.ts |
The client merges your product’s files over core’s, so a product key with the same name wins: that is how you reword a core text for your product without editing core. A test checks that the English and Greek files have the same keys, in core and in every product.
The client uses Transloco: {{ 'todos.title' | transloco }} in a template, {{name}} placeholders for values.
Languages
defaultLanguageinproduct.config.tsis the language of new users and of the client before login.- Each user picks their language in their profile; emails and invitations use it.
- API errors arrive as stable codes (see Error codes); the client maps each code to a translated message in
CODE_KEYS(libs/core/client/i18n/src/lib/utils/http-error-key.ts). A new error code needs an entry there and a message key in both files.
Add a language
- Add it to
LanguageandLANGUAGESinlibs/core/shared/src/lib/profile.ts(for example'de'), and toenum Languageinlibs/core/db/prisma/core/user.prisma(DE), where a user’s language is stored. A core model change needs a migration in every product:pnpm nx run <product>-db:compose-schemathenpnpm nx run <product>-db:migrate-dev(see Database). - Add
de.jsonnext to everyen.json(core and each product) with every key. - Add the language to the email templates in
libs/core/api/mail/src/lib/templates. - Run the tests: the key-parity and template tests point at anything missing.