Repository navigation
fix(i18n): translate multiplayer notices into Traditional Chinese - #2941
Conversation
Test builds for 1969e99
|
thibautgnt
left a comment
There was a problem hiding this comment.
Thanks @shamough1792, this is a careful one. Translating the HUD templates before the session data goes in, translating the chat notices before wrapping, and the tests with names like Alice {others} are exactly right; the detailed test notes are appreciated too.
Blocking
- Merge conflict in
crates/omsi-app/locales/app.yml. Main appended new keys at the end of the file (the depot and Russian translation PRs), right where your block goes. Please merge main and keep both blocks.
Smaller
crates/omsi-app/src/ui.rs:591:translated_chat_linenow runs for every visible chat line every frame (a language string clone per lookup, plus template matching and aformat!for notices). Small, but chat lines never change once pushed: translating once when the line arrives, or caching by line and language, keeps it off the frame.- The 25 new keys have only
zh-twso far; other languages keep showing English as before, so nothing regresses. Feel free to add any language you know. ui/chat.rslines 47 and 53: one-lineif ... { ... }blocks aren't rustfmt-shaped.
The local 0xc0000005 crash and the codepage failure you described don't come from this change, and CI is green on all platforms.
|
Addressed the review feedback in d9aae7b:
Validation:
|
thibautgnt
left a comment
There was a problem hiding this comment.
Thanks @shamough1792! The merge, the chat translation cache (with its language-switch test) and the rustfmt shape of ui/chat.rs are all done, nice work.
Blocking
- New merge conflict in
crates/omsi-app/locales/app.yml. Your #2961 went into main in the meantime and translates 7 of the same keys with slightly different wording:Host's mods could not be fetched: {e},Host's mods: everything the host uses is installed here,LAN: other players join with the code {} (or by an address: {}),LAN: the host's weather: {},Voice: joining the voice channel ...,Voice: start GreenTeaSpeak with the openOMSI plugin to talk,Voice: your microphone is muted. Please merge main again and keep one zh-tw line per key. Main's wording (房主 for the host) matches what your new chat notices and tests use, so taking main's side everywhere is probably simplest; with it the locale check shows 0 errors and only your 25 new keys.
Smaller
ui/chat.rsTranslationCache::line: the map only grows while the language stays the same, and it also keeps a copy of every player chat line, which never changes. ReturningCow::Borrowed(line)early for lines without the"* "prefix, and clearing the map pastCHAT_KEEPentries, keeps it small in long sessions.
CI is green on the latest commit; once the conflict is gone this is good to go from my side.
|
Addressed the review feedback in 1969e99, after merging upstream/main in ffe2a1c.
The omsi-app and omsi-lan library tests and cargo build --release passed locally. CI has passed on macOS, Android, Windows tests, Linux x64 and Windows x64 |
thibautgnt
left a comment
There was a problem hiding this comment.
Thanks @shamough1792! Both points are sorted: the app.yml conflict is gone with main's wording kept for the 7 shared keys (the locale check against main shows 0 existing translations changed and only your 25 new zh-tw keys), and in TranslationCache::line player lines return Cow::Borrowed before touching the map, which is cleared at CHAT_KEEP, with two tests for exactly that. Merges cleanly with main, size budget and arch guard pass, CI is green. Good to go from my side, thanks for the patience over three rounds.
|
Merged, thanks @shamough1792! Multiplayer notices in Traditional Chinese, and a tidy chat cache. Thanks for sticking with it over three rounds. |
What changes for the player?
Traditional Chinese now covers multiplayer HUD status and system chat notices, including connecting to a session, the player roster, joining, leaving and reconnecting. Player messages, names, room codes and vehicle identifiers remain unchanged.
How to test
The reporter tested the supplied Windows x64 build and confirmed the reported translation issue is resolved.
Local automated validation rerun on October 18, 2026 (PR commit
50e31822):cargo test --workspace: the app test process again terminated with0xc0000005(STATUS_ACCESS_VIOLATION) in the default parallel run. The locale and chat regressions passed before termination. This is an automated-test process failure, not a crash observed during the reporter's manual gameplay test.cargo test --workspace --no-fail-fast -- --test-threads=1: all test targets completed without a process crash; 2,604 tests passed, 1 failed and 103 were ignored. App: 278 passed / 3 ignored. LAN: 120 passed / 3 ignored. All added translation regressions passed.omsi-cfg::codepage::tests::detects_the_code_page: it expectedЛиАЗbut decoded咍曖on this Windows setup.crates/omsi-cfg/src/codepage.rsis unchanged from upstreammain.cargo build --release: passed (5m 19s).git diff --check upstream/main...HEAD: passed; source files remain unchanged.GitHub CI for this PR passed
windows-tests, Windows x64, Linux x64, macOS arm64 and Android builds, along with the file, secret, version and applicable CodeQL checks. The local codepage failure and parallel app-test crash were not reproduced by the completed CI checks. The combined local test/build checkbox remains unchecked because the default local workspace run did not pass.Screenshots
Before (
1.png): the connection and player-roster notices remain in English.After (
2.png): the same types of notices are displayed in Traditional Chinese, preserving player names and vehicle identifiers.The screenshots were captured in different sessions, so player names, vehicles and backgrounds differ.
What does this change, and why?
Add missing
zh-twentries toapp.ymland translate multiplayer HUD templates before inserting session data. Translate complete known system chat notices before wrapping them into display rows, then render prepared rows without translating player text again.The presentation layer handles the existing notice format; network messages and protocols are unchanged. The notice matching is shared across sessions and add-ons, with no vehicle-specific handling. Other locales can use the same notice templates by adding their translations. Unknown notices and missing translations retain their original text.
Add regressions for the Traditional Chinese locale entries, HUD client states and name preservation, and the reported chat examples, including ordinary player chat and translation fallback.
What could break?
Chat rendering now uses a prepared-text path, so system-notice matching and line wrapping deserve review. Only known system notices prefixed with
*are translated. Arbitrary diagnostic reasons and custom server announcements may remain in English.Windows x64 was tested by the reporter. Other platforms, VR and broad add-on compatibility were not manually tested. This change does not alter the save, settings, mod or network formats. Local automated-test limitations are documented above.
Checklist
cargo test --workspaceandcargo build --releasepasscrates/omsi-app/locales/app.yml, in every language I can