Skip to content

Translating ​

PICKET is translated with Weblate. English is the source language; French is provided. Anyone can add a language.

How it works ​

  • The texts live in packages/i18n/locales/<language>.json, one file per language. The file name is the Discord locale code (fr, de, pt-BR, es-ES…).
  • Weblate watches those files. Its changes arrive as pull requests that only touch them, and are merged automatically once the checks pass.
  • A language is picked up by the bot as soon as its file exists: there is nothing to register in the code.
  • A missing translation falls back to English, so a partial translation is fine.
  • The language list of /picket settings language shows each language in its own name and is limited by Discord to 25 entries, "Automatic" included: beyond 24 languages, that command will need autocompletion.

Rules checked by the CI ​

RuleWhy
The file name is a valid Discord locale codeCommand descriptions are sent to Discord per locale.
No key that does not exist in EnglishTypos would silently never be used.
Same as the English textA missing or renamed placeholder breaks the message.
Command descriptions, option descriptions and choices are 1 to 100 charactersDiscord limit.
No empty valueAn empty message is never what you want.

Keep placeholders such as or untouched, and keep literal command names (/picket data cancel-deletion, confirm:True) as they are.

Working locally ​

sh
pnpm exec jest packages/i18n     # checks every catalog
pnpm i18n:keys                   # after adding or renaming a key in en.json

pnpm i18n:keys regenerates the MessageKey type used by the code, and the tests fail if it is out of date.

Setting up Weblate (maintainers) ​

Create a component with:

SettingValue
File maskpackages/i18n/locales/*.json
Monolingual base language filepackages/i18n/locales/en.json
File formati18next JSON file (v4)
Push method (repository settings)GitHub pull request
Automatic translation add-onsDisabled

Then set the repository variable WEBLATE_BOT_LOGIN to the account that opens the pull requests, enable Allow auto-merge in the repository settings, and require the CI checks in the branch protection of main. Without the variable, nothing is merged automatically.