Skip to content

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

TextsFiles
Core client (layout, auth, admin, …)libs/core/client/i18n/src/assets/i18n/{en,el}.json
Your product’s clientlibs/<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

  • defaultLanguage in product.config.ts is 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

  1. Add it to Language and LANGUAGES in libs/core/shared/src/lib/profile.ts (for example 'de'), and to enum Language in libs/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-schema then pnpm nx run <product>-db:migrate-dev (see Database).
  2. Add de.json next to every en.json (core and each product) with every key.
  3. Add the language to the email templates in libs/core/api/mail/src/lib/templates.
  4. Run the tests: the key-parity and template tests point at anything missing.