feat: add i18n system with 22 languages#10
Open
WkdXeqtr wants to merge 1 commit into
Open
Conversation
- Implement Locale class (i18n.h + locale.cc): auto-detect system
language, runtime switching, English fallback
- Add locale JSON files for all 22 languages matching Millennium
- Embed translations into binary at CMake configure time via
generated/locale_data.h (no runtime file I/O)
- Replace all hardcoded UI strings with Locale::Get() across all routes
- Add language selector dropdown to the title bar (top-right)
- Font atlas adapts to the active language:
· Geist + CJK name subsets (~21 KB embedded) always merged in
· System CJK font loaded as primary when a CJK locale is active
· Vietnamese: system Arial/LiberationSans/HelveticaNeue replaces
Geist as primary font entirely (no merging); dropdown keeps Geist
appearance via a dedicated font slot (Fonts[3])
· VietName_Standalone (~18 KB embedded) for the Vietnamese item
in the dropdown
- Rebuild font atlas on language switch
- Platform support: Windows (WinAPI lang detect + system font paths),
Linux (fc-match + LiberationSans fallback), macOS (fc-match +
PingFang/Hiragino/AppleSDGothicNeo/HelveticaNeue fallbacks)
- Add tools/generate_font_headers.py to regenerate embedded subsets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Localeclass) with auto-detection of system language and runtime switchingLocale::Get()Font system
cjk_names.handviet_name.hare pre-generated static byte arrays — no tooling required at build time. To regenerate from system fonts: