Skip to content

feat(i18n): add internationalization support with language selection and CJK fonts#1639

Open
snnh wants to merge 13 commits into
TwilitRealm:mainfrom
snnh:feat/i18n-support
Open

feat(i18n): add internationalization support with language selection and CJK fonts#1639
snnh wants to merge 13 commits into
TwilitRealm:mainfrom
snnh:feat/i18n-support

Conversation

@snnh
Copy link
Copy Markdown

@snnh snnh commented May 19, 2026

Summary

Add full internationalization (i18n) support to Dusklight, including a language selection UI, translation token system, CJK font integration, and initial translations for English, Simplified Chinese, Japanese, and French.

Changes

  • i18n infrastructure (src/dusk/ui/i18n.cpp, src/dusk/ui/i18n.hpp): Translation token loading and language switching system
  • Language selection: UI language picker in the Interface settings tab with restart-free switching
  • String tokenization: Migrated all hardcoded English UI strings to translation tokens ([TOKEN_NAME]) across settings, overlay, controller config, achievements, graphics tuner, prelaunch, warp, menu bar, and reporting
  • CJK fonts: Bundled HarmonyOS Sans (Regular, SC, TC) for proper Chinese/Japanese rendering
  • Translation files: res/i18n/ — en.xml, zh-cn.xml, ja.xml, fr.xml
  • Automation: tools/check_i18n_tokens.py — script to detect missing translation tokens
  • Aurora submodule: Updated to include configPath split

Reference

This implementation follows RmlUi's localization system using translation tokens via Rml::Translate:
https://mikke89.github.io/RmlUiDoc/pages/localisation.html

Disclaimer

Only PR description and commit messages were generated with AI assistance.

snnh added 9 commits May 19, 2026 14:44
…and translation tokens

feat(i18n): 添加国际化支持,包括语言选择和翻译令牌
feat(translation): 添加简体中文UI本地化
fix(i18n): 将头文件引用从 String.h 更新为 Types.h 以保持兼容性
…ranslation tokens

feat(i18n): 集成CJK字体并将硬编码UI字符串迁移到翻译令牌
…ontroller config and achievements

refactor(ui): 将控制器配置和成就界面中的硬编码字符串迁移到翻译令牌
…raphics tuner, prelaunch, settings, and controller toasts
Copy link
Copy Markdown
Member

@encounter encounter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found several instances where this removes upstream changes accidentally, which makes it hard to review as a whole. Overall it seems like a reasonable approach but the team will have to decide if it's the route we want for i18n

Comment thread src/dusk/ui/overlay.cpp Outdated
Comment thread src/dusk/ui/settings.cpp Outdated
Comment thread src/dusk/ui/settings.cpp
return button;
}

SelectButton& config_int_select(Pane& leftPane, Pane& rightPane, ConfigVar<int>& var,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad merge

@snnh
Copy link
Copy Markdown
Author

snnh commented May 19, 2026

I found several instances where this removes upstream changes accidentally, which makes it hard to review as a whole. Overall it seems like a reasonable approach but the team will have to decide if it's the route we want for i18n

I am sorry, I didn't notice it during the review

snnh added 4 commits May 19, 2026 17:07
…3D11 backend

- overlay.cpp: change second arg of PADGetKeyButtonBindings from nullptr to &count
- settings.cpp: expose D3D11 backend by removing it from exclusion list
- settings.cpp: add config_int_select helper for integer selection controls
…d add framerate cap config

- Replace boolean enableFrameInterpolation with FrameInterpMode (OFF/CAPPED/UNLIMITED)
- Add integer FRAMERATE_CAP config (30-540), disabled unless interpolation is CAPPED
- Update Dusk preset to use FrameInterpMode::Unlimited instead of true
- Fix controller binding detection in overlay by initializing count pointer for PADGetKeyButtonBindings
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