Skip to content

Translations and language workflow ​

OCP UI language support is implemented in src/OrishaPlatform.UI.App with English (en) as the default and fallback locale.

Currently supported locales:

  • en (default and fallback)
  • sv
  • fr
  • nl
  • es

Runtime behavior ​

  • Users can switch language from the user menu in the UI.
  • The selected locale is saved in the ocp-locale cookie.
  • Invalid or unknown locale values fall back to English.
  • Backend API requests include the selected language through the Accept-Language header.

Translation source and generated assets ​

  • Source-of-truth translation files: src/OrishaPlatform.UI.App/app/i18n/po/*.po
  • Generated runtime message files: src/OrishaPlatform.UI.App/i18n/locales/generated/*.json

The generated JSON files are consumed by Nuxt i18n at runtime.

Translator/developer workflow (PO-based) ​

  1. Update translations in the appropriate *.po file.
  2. Generate runtime locale assets:
bash
cd src/OrishaPlatform.UI.App
npm run i18n:generate
  1. Validate with build/tests before merge.

Adding a new language ​

  1. Add a new PO file in app/i18n/po.
  2. Register the locale in nuxt.config.ts (i18n.locales).
  3. Update app/utils/app-locale.ts (appLocales and toAcceptLanguage mapping).
  4. Run npm run i18n:generate.

No structural code changes are needed beyond locale registration and translations.