Docs/Localization.md

Localization (planned)

Since 2026-11-28 the player chooses its language in a drop-down list (LanguageList, the languages by their own names: Loc.Choosable, Loc.NativeName) on the character screen and in the opening story; it is kept on the PC (Settings.Language; never chosen: the system's, Settings.LanguageOrSystem, applied at the start unless --lang is given). The Options tab says where (GameMenu.LanguageLine); its own list there is still to come. The string tables exist (Client.Core Loc, step 3 below) and the UI kit fits every text to its box (UI kit), but most texts do not go through them yet. This page is the plan for adding a language choice, so that new code does not make it harder.

Where the texts are today

Texts Where
Menu tabs, buttons, switches, tab lines, item details Libs/Client.Core: GameMenu, InventoryScreen, RaidBoardView
Notifications made by the client ("Teleported to the safe zone.", welcome...) Apps/Client/Scripts controllers (GameMenuController, RaidBoardController, GhostController...)
Login screens, HUD LoginUi, VrMenu, Hud, HudController; update messages: Client.Core ClientUpdates.Message
Texts sent by the servers ScoutResultMsg.Text, LobbyStatusUpdateMsg.Text, ApiServer error messages (ApiException)

Most menu texts are already built in Client.Core from enums (MenuTab, MenuAction, MenuToggle, EquipSlot). That is the place to translate them.

Plan

  1. Language setting: Settings.Language ("en" by default, saved in user://settings.cfg). The first launch takes the system language (OS.GetLocaleLanguage()) if the game has it, else English.
  2. Choice in the menu: a Language button in the Options tab (VR: on the centre screen, under the switches) that cycles through the available languages, and the same choice on the login screen (VR VrMenu and desktop LoginUi). It replaces GameMenu.LanguageLine. The change applies at once: the menu refreshes, no restart.
  3. String tables in Client.Core (done): Loc (engine-free, tested) with one table per language, keyed by stable ids (ui.cancel, plate.level; later menu.tab.inventory, action.tp_safe_zone...), with values by name ({damage}), plurals ({seconds, plural, one {...} other {...}}), numbers the language's way (1,5, 12 500) and big numbers short ({damage:short}: 12,5 K): the syntax is in UI kit. The tables are Libs/Client.Core/Lang/<code>.json (en, fr, de, nl), embedded in the assembly. A missing key falls back to English, then to the key; UiKitTests checks that every language has every English key with the same placeholders. The test language pseudo is English about 40 % longer. Only the UI kit and the nameplates use it so far.
  4. Callers ask Loc instead of writing English: GameMenu.Title(tab) becomes Loc.Get($"menu.tab.{tab}"), and so on. Numbers shown to the player go through Loc ({n} in a text, Loc.Number, Loc.Short); elsewhere (logs, files, the network) the invariant culture stays (Main sets it). To try a language now: -- --lang de (fr, nl, pseudo).
  5. Server texts: the servers send ids and values instead of English sentences (for example a ScoutResult code and the camp level). The client builds the sentence in its own language. This changes message formats, so it raises ProtocolVersion.Current (see AGENTS.md). Until then, server texts stay in English.
  6. Fonts: Godot's default font covers Latin, Greek and Cyrillic. Other scripts (CJK, Arabic...) need a font file added as a fallback in the project theme and on the Label3D of the VR widgets.
  7. Layout (done for the kit): some languages are about 30 to 40 % longer than English. The UI kit's widgets fit their texts (UiText, TextFit: the largest size that holds, down to the style's minimum, then "…"), so a long word shrinks instead of overflowing; check new screens in pseudo and de (UI kit, picture languages). Screens still built with VrWidgets.Button (fixed font size) must be checked on the --vr-menu-preview screenshots (Tools/Dev/Validate.ps1 -Screens) until they move to the kit.

Rules until then

  • New player-facing texts go through Loc (a key in every Lang/*.json), or at least into Client.Core helpers (like GameMenu and InventoryScreen), not inline in Godot scripts.
  • Build sentences from whole strings with placeholders, not by gluing pieces together ("Raid size: " + n is fine, word order in sentences is not).
  • Do not compare a displayed text to decide something. Use the enum or id behind it.