# Internalization

# General ideas

  • Developers required to change only English text (en.yml file). Any other languages are optional.
  • We use English as the fallback language.

# Adding keys

  • Developer adds new keys only to en.yml.
  • Developer makes MR to master branch.
  • When MR is merged, the changes automatically are pushed to lokalise (opens new window)
  • QA person performs the review.
  • QA person deploys the changes DownloadBuild only.
  • (Optional) QA Person deploys the branch to a staging server.
  • Lokalise create a MR with the changes for master branch.
  • Project lead makes the review of the MR and merges.

# Renaming keys

::: warn The keys are immutable. That helps us to keep the language files compatible with previous versions of the product. :::

  1. Create a new key.
  2. Open Lokalize, find the old key.
  3. Open version.php, take first 2 version numbers. For example, file contains 9.14.20, you need to take only 9.14.
  4. Add tag deprecated-9.14 to the old keys.
  5. When 9.14 support is discontinued, we the keys assigned to deprecated-9.14 tag.

# Deleting keys

The keys are immutable. That helps us to keep the language files compatible with previous versions of the product.

  1. Open Lokalize, find the old key.
  2. Open version.php, take first 2 version numbers. For example, file contains 9.14.20, you need to take only 9.14.
  3. Add tag deprecated-9.14 to the old keys.
  4. When 9.14 support is discontinued, we the keys assigned to deprecated-9.14 tag.

# Localise export settings

  • File format — YAML (.yml, .yaml)

Languages:

  • Set zh for Chinese Traditional.

File structure

  • One file per language — selected.
  • Bundle structure — public/application/translations/%LANG_ISO%.%FORMAT%

Content to export

  • Data — By default (All)

Advanced settings

  • Disabled referencing - checked
  • Language code as root key - unchecked
  • Empty translations - Don't export
  • Sort keys by - Key name A-Z
  • Plural format - Array
  • Indentation - 2 spaces

App triggers

  • Check GitLab