Skip to content

Speak Simplified Chinese and Japanese, and start in the system's language#250

Merged
JE-Chen merged 2 commits into
mainfrom
dev
Jul 26, 2026
Merged

Speak Simplified Chinese and Japanese, and start in the system's language#250
JE-Chen merged 2 commits into
mainfrom
dev

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jul 26, 2026

Copy link
Copy Markdown
Member

Languages

The editor spoke English and Traditional Chinese, always started in English
whatever the machine was set to, and a language that had not translated every
key would have shown blank labels rather than falling back to something
readable.

  • Simplified Chinese, all 425 keys. Written in mainland vocabulary rather
    than converted from the traditional file: 檔案/文件, 資料夾/文件夹, 程式/程序,
    儲存/保存, 直譯器/解释器, 執行緒/线程 and 儲存庫/仓库 all differ, and a
    character-level conversion produces Taiwan wording in simplified characters.
  • Japanese, all 425 keys.
  • Anything untranslated falls back to English. That is what makes it
    possible to add a language before finishing it -- and what stopped this change
    from being all-or-nothing.
  • The language menu is built from what is registered, rather than from two
    hard-coded entries, and each language is named the way it names itself
    (日本語, 简体中文) so someone who cannot read the current interface can still
    find theirs.

Following the system

A first run reads the system locale instead of assuming English. Chinese is
resolved by script rather than by country alone: zh-Hant and the Taiwan, Hong
Kong and Macau regions get traditional characters, and anything else -- zh_CN,
zh_SG, a bare zh -- gets simplified. Encoding suffixes and mixed case
(zh_TW.UTF-8, ZH_tw) are handled. What gets detected is recorded, so from
then on it is simply the chosen language.

Locale rules for Korean, Spanish, French, German, Russian and Portuguese are in
place; each needs only its dictionary file to become available.

Defects found

  • Two translations had dropped their placeholders. info_checkout_msg is
    "Already check out to {branch}" in English but "已切換至" in Chinese, so the
    branch name it was meant to show would have vanished; info_clone_success_msg
    lost {repo_path} the same way. Fixed in every language, with a test that
    compares each translation's placeholders against English.

Two features that could not be reached

Both were built end to end and neither had a trigger: nothing called the
editor's signature-help request, and the staged-versus-working comparison was
only ever called from its tests. Typing an opening bracket or a comma now asks
for a signature, and the staged comparison sits in Tab > Git beside the diff
against HEAD -- which shows every change, staged or not, so after staging hunk
by hunk it was the only thing missing.

Verification

ruff check . clean. 1768 tests pass on 3.11 and on 3.10, including one per
language for key coverage, placeholder agreement and no blank values.

JE-Chen added 2 commits July 26, 2026 20:09
Both were built end to end and neither could be reached: nothing called the
editor''s signature-help request, and the staged-versus-working comparison was
only ever called from its tests.

Typing an opening bracket or a comma asks for a signature, which is when one is
useful, and the right-click menu offers it too. The staged comparison sits in
the Tab > Git menu beside the diff against HEAD -- that one shows every change,
staged or not, so after staging hunk by hunk it is the only way to see what
actually went into the index.
The editor spoke English and Traditional Chinese, always started in English
whatever the machine was set to, and a language that had not translated every
key would have shown blank labels rather than falling back.

Simplified Chinese is written in mainland vocabulary rather than converted from
the traditional file, where 檔案/文件, 程式/程序 and 資料夾/文件夹 all differ.
Japanese is complete too. Anything a language has not translated now falls back
to English, which is what makes it possible to add a language before finishing
it, and the menu is built from what is registered rather than from two
hard-coded entries -- each named the way that language names itself, so someone
who cannot read the current interface can still find theirs.

A first run follows the system locale instead of assuming English, with Chinese
resolved by script: zh-Hant and the Taiwan, Hong Kong and Macau regions get
traditional characters, anything else simplified.

Two translations had dropped their {branch} and {repo_path} placeholders, which
would have silently swallowed the branch and the path they were meant to show.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 48 complexity · 0 duplication

Metric Results
Complexity 48
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@sonarqubecloud

Copy link
Copy Markdown

@JE-Chen
JE-Chen merged commit 48f8537 into main Jul 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant