tree: 34ccea5b6c2f4aebbd8581148e13a0b456b55b86 [path history] [tgz]
  1. nvidia/
  2. README.md
src/env/locales/README.md

Vendor locale overlays

This directory contains environment/vendor-specific translation bundles that are merged on top of the base, vendor-neutral locales in src/locales/.

Structure

src/env/locales/
  <vendor>/
    en-US.json
    ka-GE.json
    ru-RU.json
    zh-CN.json
  <vendor-variant>/
    en-US.json   # optional, only when variant overrides vendor root
    ka-GE.json   # optional
    ru-RU.json   # optional
    zh-CN.json   # optional

Examples:

  • Shared vendor folder: src/env/locales/nvidia/
  • Variant folder: src/env/locales/nvidia-gb/

Merge order at runtime

  1. Base locales from src/locales/ (auto-discovered)
  2. Vendor root overlays (e.g., src/env/locales/nvidia/)
  3. Variant overlays (e.g., src/env/locales/nvidia-gb/)

Variant keys overwrite vendor root keys on conflict.

Guidelines

  • Keep src/locales/ vendor‑neutral. Put vendor‑specific strings here.
  • Prefer the vendor root folder when multiple projects share strings to avoid duplication.
  • Only add a variant folder if it truly needs to override vendor root strings.
  • File names must match locale codes (e.g., en-US.json, ru-RU.json, zh-CN.json, ka-GE.json).
  • Use 4‑space indentation; alphabetize object keys for readability.
  • JSON must be valid (no trailing commas or comments).

Environment selection

The active environment is selected by VUE_APP_ENV_NAME (e.g., nvidia, nvidia-gb). See the .env.* files at the repo root (e.g., .env.nvidia-gb).

Bundling

  • All JSON files under src/locales/ are bundled automatically.
  • Matching overlays under src/env/locales/<env> are also bundled and merged at app start.

Testing

Focused unit tests exist for overlays and fallback:

  • npm run test:unit -- i18n.vendor.spec.js
  • npm run test:unit -- i18n.locale-alias.spec.js

These verify vendor root → variant merge behavior and locale alias handling.