Skip to content

Add an eleventh language to the desktop app #52

Description

@brcampidelli

Successor to #47, which was closed by adding Russian. Same task, one language further along — and one step easier than it was.

The task

Add a language the app does not have yet. The ten that exist are en pt es fr de it pl zh ja ru, all complete: 625 keys each, no pending debt. Hindi, Korean, Turkish, Indonesian, Ukrainian, Vietnamese, Dutch — whatever you speak.

Where, exactly

  1. apps/desktop/src/lib/i18n.tsx — the LANGS table at the top: { code: "xx", label: "<the language name, written in that language>" }. Not the English name: someone looking for their language is not scanning for "Korean".
  2. Same file — const xx: Dict = { ... } with all 625 keys, copied from en and translated.
  3. Same file — add it to DICTS at the bottom.
  4. README.<code>.md — a translation of the English README.
  5. The language bar (line 22) in every README, including yours.

What changed since #47

Steps 3 and 5 now fail loudly instead of silently. They used to be prose warnings; the person who forgets step 5 is the person not re-reading step 5.

  • i18n.test.tsx asserts LANGS and DICTS hold the same codes — forget step 3 and the picker offers a language it cannot load, and the test says so.
  • tests/test_readme_langbar.py reads LANGS out of the app and requires the README set to match it, then checks every bar links every other file. Forget step 5 and it names the exact file and direction: "the app offers [xx] with no README", or the reverse.

So you cannot ship this half-done by accident. Add the endonym to the expected map in that test (it is one line, and the failure tells you where).

Done when

  • npm --prefix apps/desktop run test green — the parity test compares your dictionary against English key by key
  • npm --prefix apps/desktop run build green
  • uv run pytest tests/test_readme_langbar.py -q green
  • Placeholders survive exactly: {count}, {n}, {tokens}, {version} and friends. A translated placeholder renders the literal {n} to a user.
  • No key renamed or deleted — adding is free, renaming breaks every language silently (see AGENTS.md)

Right-to-left

If your language is written right to left (Arabic, Hebrew, Persian), the dictionary is the easy half and the layout is the other one — the app has never rendered RTL and nothing in it sets dir. That is worth doing and worth saying up front rather than discovering at review. Open it as a draft and we will work out the layout part together.

On machine translation

Drafting with a model is fine — this is an agent framework, it would be odd to object. Read every line before you send it. These are short, contextless UI labels, which is exactly where machine translation produces something grammatical and wrong.

Worth saying plainly, since it applies to the language already in the tree: the Russian added in #47 was not read by a native speaker. Key parity was machine-checked; the wording was not. If you read Russian, correcting it is as welcome as adding an eleventh language, and is a smaller first PR.

Scope guard

One language per pull request. Out of scope here: splitting i18n.tsx into per-locale files, rewording the English source, and translating docs/ (the site renders those and has its own arrangement).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions