Skip to content

Add Thai language support and graceful Lua file loading - #400

Open
comdevx wants to merge 2 commits into
vE5li:mainfrom
comdevx:add-thai-language
Open

Add Thai language support and graceful Lua file loading#400
comdevx wants to merge 2 commits into
vE5li:mainfrom
comdevx:add-thai-language

Conversation

@comdevx

@comdevx comdevx commented May 25, 2026

Copy link
Copy Markdown

Summary

  • Thai language (ภาษาไทย): Added Thai as a selectable language in Interface Settings, with full translations for all UI strings (th-TH.ron)
  • NotoSansThai font: Added a pre-built MSDF atlas (8192×512px, 467 glyphs) generated from NotoSansThai, registered as a fallback font so Thai script renders correctly
  • Graceful Lua file loading: Changed load_from_game_files to skip missing Lua files instead of panicking — allows the client to start with incomplete game data (e.g. without kRO-specific luafiles514) while gracefully falling back to empty tables

Changes

File Change
src/state/localization/mod.rs Add Thai variant to Language enum with locale code th-TH and display name ภาษาไทย
src/settings/interface.rs Add Language::Thai to the language selector
src/lib.rs Register NotoSansThai as a fallback font
archive/data/languages/th-TH.ron Full Thai translations for all 67 UI strings
archive/data/font/NotoSansThai.* NotoSansThai MSDF atlas (ttf + png + csv.gz)
src/world/library/mod.rs Skip missing Lua files instead of panicking

Test plan

  • Build and run the client
  • Open Interface Settings → Language dropdown shows "ภาษาไทย"
  • Select Thai → all UI windows display in Thai with correct font rendering
  • Client starts successfully even without luafiles514 in game data

- Add Thai (ภาษาไทย) as a selectable language in interface settings
- Add full Thai translations for all UI strings in th-TH.ron
- Add NotoSansThai MSDF font atlas (8192×512px, 467 glyphs) for correct
  Thai script rendering
- Register NotoSansThai as a fallback font in the font loader
- Change Lua library loading to skip missing files instead of panicking,
  allowing the client to run with incomplete game data (e.g. without
  kRO-specific luafiles514)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hasenbanck

hasenbanck commented May 25, 2026

Copy link
Copy Markdown
Collaborator

Hi! And thank you for the PR! We only ship in the git source the base latin script font map. All other font maps are available in our font release:

https://github.com/vE5li/korangar/releases/tag/v0.0.1-font-map-files

We already did create a font map for Thai too! (NotoSansThai.zip)

Font maps are distributed separately via GitHub releases, not shipped
in the repository source. See:
https://github.com/vE5li/korangar/releases/tag/v0.0.1-font-map-files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@comdevx

comdevx commented May 25, 2026

Copy link
Copy Markdown
Author

Thanks for the heads up! I've removed the font files from the PR — the code changes now only include the localization and font loader registration. Users can grab the NotoSansThai font map from the release page.

@vE5li

vE5li commented Jul 21, 2026

Copy link
Copy Markdown
Owner

@comdevx can you squash the two commits? Merging them like this would clutter up the git state

Comment on lines +90 to 94
let Ok(data) = game_file_loader.get(file) else {
continue;
};

state.load(&data).exec()?;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I was unsure about this change but I think it's fair.
However, we want to at lest log an error to the console (using print_debug)

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.

3 participants