Skip to content

Add a String

Steps

1. Choose the namespace

NamespaceContent
commonUI chrome, buttons, navigation, labels, errors, empty states
commerceCart, checkout, shipping, payment, orders
accountLogin, register, profile, addresses
legalCookie consent, privacy, terms

2. Add the key to the source locale

Edit packages/i18n/locales/en/{namespace}.json:

{
"actions.add_to_wishlist": "Add to wishlist"
}

Follow the key naming conventions:

  • Dot notation: section.descriptive_name
  • Lowercase with underscores
  • Keys are sorted alphabetically in the file

3. Add translations

Add the same key to each target locale file:

nl-NL/common.json
{
"actions.add_to_wishlist": "Toevoegen aan verlanglijst"
}

4. Validate

Terminal window
pnpm i18n:check

This verifies:

  • No missing keys in any locale
  • Placeholder parity ({name} must match between source and target)
  • No empty values
  • No extra/unused keys

5. Update coverage report

Terminal window
pnpm i18n:report

This regenerates the Translation Status page.

Tips

  • Always start with the English source β€” it’s the ground truth
  • Keep placeholder names descriptive: {product_name} not {p}
  • Use {name} syntax only (not {{name}} or %s)
  • Sort keys alphabetically in JSON files for deterministic output
  • Run pnpm i18n:check before committing β€” it exits with code 1 if keys are missing