Files
craft-launcher/apps
Flowershangfromthebranches bf452db810 Add a Simplified Chinese interface, drawn with the system's Chinese font
zh-CN.tsv translates the whole interface, the tray menu and tooltip, each
app's tagline and the backend's install/update messages into Simplified
Chinese, and Settings > Language offers 简体中文. Simplified Chinese
locales (zh-CN, zh-SG, zh-Hans, zh_CN.UTF-8, a bare zh) select it; an
explicit Traditional script (zh-Hant-CN) or a Traditional region (zh-TW,
zh-HK, zh-MO) doesn't. Chinese has one plural form. The tray's menu and
tooltip now follow the interface language (Russian rows added too).

The bundled faces have no Chinese glyphs, so on the desktop the
launcher borrows the system's own Chinese font (cjk_font.rs): PingFang
(in /System/Library/Fonts on older macOS, a downloaded font asset on
newer ones), Hiragino Sans GB or Heiti on macOS; Microsoft YaHei or
SimSun on Windows; Noto Sans CJK (static or variable) or WenQuanYi on
Linux and FreeBSD. The face is picked by its family name (PingFang SC,
Noto Sans CJK SC…), regular weight, rather than a hard-coded index in
the collection. Files over 100 MB are skipped and nothing panics. The
font (PingFang is 78 MB) is read only when Chinese is the language in
use, chosen or through Auto, and then kept for the session. Until then
the picker says "Simplified Chinese", and "Simplified Chinese (简体中文)"
once the font is loaded. With no Chinese font (and on the web), the
interface stays in English and Settings explains why, instead of boxes
for every character.

Rebased onto main from the original PR (#34). Changed from the original:
- No bundled font: NotoSansSC-Regular.ttf (10.6 MB), its OFL and README,
  their ATTRIBUTION and NOTICE rows and the zh-CN screenshots are left
  out; the system font replaces them, as above.
- The i18n framework fixes in that PR (trim_end in the catalog tests,
  the n == 1 plural fallback, 1-3 @plural forms, the registry-driven
  language label) landed with the Russian catalog; this adds the
  script-aware zh tag matching on top.
- zh-CN.tsv: "Verifying checksum…" mentions the checksum (正在验证校验和…),
  update.check_auto keeps "automatically" (自动检查更新), "Launcher" stays
  in English like the rest of the product name, rows were added for
  every string main gained since, and rows for messages the launcher
  never sends were dropped.
- tests/chinese.rs works with or without a system Chinese font: with
  one it switches to 简体中文 and checks the grid, table, web and saved
  setting; without one it checks the English fallback and the note. The
  glyph-coverage test now covers the system font, when there is one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 13:11:51 -04:00
..