Skip to content

i18n: wrap hardcoded UI strings for Chinese localization - #950

Merged
bflatastic merged 2 commits into
storytold:mainfrom
seldoms:i18n/chinese-translations
Oct 10, 2026
Merged

bflatastic merged 2 commits into
storytold:mainfrom
seldoms:i18n/chinese-translations

Conversation

@seldoms

@seldoms seldoms commented Oct 10, 2026

Copy link
Copy Markdown

Summary

  • Wrap remaining hardcoded UI labels and buttons with tr()/tl!() calls
  • Add missing Simplified and Traditional Chinese translations
  • Add entries to other language catalogs for consistency

Test plan

  • cargo test -p vectorcraft-ui-egui --lib i18n passes
  • UI strings display in Simplified Chinese when macOS preferred language is Chinese

seldoms and others added 2 commits October 10, 2026 18:27
- Wrap remaining hardcoded UI labels and buttons with tr()/tl!() calls
- Add missing Simplified and Traditional Chinese translations
- Add entries to other language catalogs for consistency
The app already finds an installed font for CJK (and other) characters
the UI fonts lack, the first time a frame paints one (ui_fonts): reading
a system CJK font at every startup duplicated that, cost a font file's
read and memory for interfaces that never show CJK, and broke its test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bflatastic
bflatastic force-pushed the i18n/chinese-translations branch from ec08254 to 22443d8 Compare October 10, 2026 11:40
@bflatastic
bflatastic merged commit 5d07d64 into storytold:main Oct 10, 2026
@bflatastic

Copy link
Copy Markdown
Member

Thanks, @seldoms, and welcome! Merged after a full CI run. The newly wrapped strings, the catalogue rows and the C/POSIX locale handling all went in. One change on top (22443d8): I dropped the system CJK font loaded in theme::install_fonts. The app already does this in ui_fonts: the first time a frame paints a CJK character the UI fonts lack, it finds an installed font that covers it (in the background) and adds it as the last fallback. Loading one at every startup duplicated that, cost a large font read for interfaces that never show CJK, and broke that module's test. With your change in, Chinese text in the UI still gets PingFang, YaHei or Noto through that path.

We'd love to have you on our Discord too: https://discord.gg/artcraft

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.

2 participants