Skip to content

fix(i18n): translate multiplayer notices into Traditional Chinese - #2941

Merged
thibautgnt merged 5 commits into
openOMSI-org:mainfrom
shamough1792:multiplayer-zh-tw-pr
Oct 19, 2026
Merged

thibautgnt merged 5 commits into
openOMSI-org:mainfrom
shamough1792:multiplayer-zh-tw-pr

Conversation

@shamough1792

@shamough1792 shamough1792 commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

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

  1. On two Windows x64 computers, use the same test build and select Traditional Chinese (ZHT / zh-tw).
  2. Host a multiplayer session on one computer and join it from the other. Check the HUD, connection notice and player roster.
  3. Have a player leave and rejoin, and exercise reconnect. Check that system notices are translated while player chat, names and vehicle identifiers retain their original text.
  4. Check the host-mod, LAN, server-command and voice notices when those features are used.

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 with 0xc0000005 (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.
  • The sole serial-run failure is omsi-cfg::codepage::tests::detects_the_code_page: it expected ЛиАЗ but decoded 咍曖 on this Windows setup. crates/omsi-cfg/src/codepage.rs is unchanged from upstream main.
  • Serial execution avoids the observed app test crash in this run; the root cause of the parallel failure is not established.
  • 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.

Before: English multiplayer system notices

After (2.png): the same types of notices are displayed in Traditional Chinese, preserving player names and vehicle identifiers.

After: Traditional Chinese multiplayer system notices

The screenshots were captured in different sessions, so player names, vehicles and backgrounds differ.

What does this change, and why?

Add missing zh-tw entries to app.yml and 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 --workspace and cargo build --release pass
  • The pull request contains a single change
  • Before/after screenshots are in the description if anything changes on screen
  • New or changed interface texts are in crates/omsi-app/locales/app.yml, in every language I can
  • Online play, saves, settings and mods made for the previous release still work, or the description says what changes
  • No original OMSI 2 content and no file of a megabyte or more in the commits

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Test builds for 1969e99

Platform Download
Android (arm64) android.zip
Linux x64 (game and dedicated server) linux-x64.zip
macOS (Apple silicon) macos-arm64.zip
Windows x64 (game and dedicated server) windows-x64.zip
  • Unpack the download into a new folder, not over your openOMSI. The launcher shows the version as ...-pr2941, and a test build is never updated. It shares your settings and OMSI 2 folder; mods you installed into your openOMSI folder are only seen when you unpack it into a copy of that folder.
  • Android: the download holds an APK that installs as a separate app, openOMSI PR fix(i18n): translate multiplayer notices into Traditional Chinese #2941, beside the release, and shares its openOMSI folder.
  • What to try is under How to test in the description. Please comment with what you found and the version the launcher shows.
  • The links work for 14 days after the build.

@shamough1792
shamough1792 marked this pull request as ready for review October 18, 2026 06:13

@thibautgnt thibautgnt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

  1. 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_line now runs for every visible chat line every frame (a language string clone per lookup, plus template matching and a format! 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-tw so far; other languages keep showing English as before, so nothing regresses. Feel free to add any language you know.
  • ui/chat.rs lines 47 and 53: one-line if ... { ... } 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.

@shamough1792

shamough1792 commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback in d9aae7b:

  • Merged the latest upstream/main and resolved the app.yml conflict while preserving both the multiplayer zh-tw block and the depot/Russian translation blocks. The ru entry remains correctly nested under "Weather cycle {}".
  • Cached translated multiplayer chat lines by source line and language, so template matching and formatting are no longer repeated every frame.
  • Applied rustfmt formatting to ui/chat.rs.
  • Added regression coverage for cache reuse and language switching.
  • The new multiplayer strings currently provide zh-tw; other locales retain the existing English fallback.

Validation:

  • Focused omsi-app and omsi-lan tests passed.
  • rustfmt --check and git diff --check passed.
  • cargo build --release passed locally.
  • GitHub release jobs for the latest commit are finished.

@thibautgnt thibautgnt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

  1. 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.rs TranslationCache::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. Returning Cow::Borrowed(line) early for lines without the "* " prefix, and clearing the map past CHAT_KEEP entries, 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.

@shamough1792

shamough1792 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback in 1969e99, after merging upstream/main in ffe2a1c.

  • Resolved the app.yml conflict using main's wording for the seven overlapping zh-tw keys. The PR now adds only its 25 unique locale keys.
  • Ordinary player chat lines now bypass the translation cache, and cached notices are cleared at CHAT_KEEP. Added regression tests for both behaviors.

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 thibautgnt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@thibautgnt
thibautgnt merged commit 1e654ed into openOMSI-org:main Oct 19, 2026
12 checks passed
@thibautgnt

Copy link
Copy Markdown
Contributor

Merged, thanks @shamough1792! Multiplayer notices in Traditional Chinese, and a tidy chat cache. Thanks for sticking with it over three rounds.

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