Skip to content

English / Italian: language selector, full translation, localized voices - #47

Merged
MasterCruelty merged 10 commits into
mainfrom
ccr-0218b7da-0ql5yl
Oct 21, 2026
Merged

MasterCruelty merged 10 commits into
mainfrom
ccr-0218b7da-0ql5yl

Conversation

@MasterCruelty

Copy link
Copy Markdown
Owner

Adds Italian to the game, with a language selector and radio voices in the chosen language. It also refreshes the README screenshots.

How it works

  • src/i18n/index.js: t(englishText, params) returns the translation for the current language, or the English text when none exists. English is the source and the key, so a missing translation never shows a blank. Placeholders use t('Wave {n}/{max}', { n, max }). Keys like ctx|Word cover words with two meanings, e.g. ammo "LOW" (SCARSE) vs risk "LOW" (BASSO).
  • Language choice: remembered per browser. The first launch follows the browser's language.
  • Selector (ui/LangSelect.jsx): 🇬🇧 English / 🇮🇹 Italiano, on the title screen and in the command center bar. Switching updates the whole UI and the canvas at once.
  • Display-time only: text is translated when shown. Saved data and ids, such as location and boss names, stay in English, so saves made in either language work in both.
  • Voices: radio and transmission lines speak the translation with a voice for that language. When the device has no such voice, they speak the English line with an English voice instead of mangling the Italian. Radio lines can carry {placeholders} + params.
  • Quests: side-job offers are fixed templates filled at display time, so offers from old saves translate too. Journal rewards are rebuilt per language.

Translation

src/i18n/it/ has about 880 entries, split by area:

  • ui: menus, command center, map, panels and results;
  • hud: siege and mission HUD, messages and rooms;
  • data: locations, quests, perks, research, weapons, conditions and bosses;
  • cine: cinematics, transmissions and endings;
  • radio: radio lines.

Every entry is filled in, and the placeholders match the English.

Other

  • Weapon names are translated everywhere they are shown.
  • The siege hint lines shrink to fit next to the speed button.
  • README: new screenshots of the current game, plus an Italian row (title screen with the selector, and a room) and the language feature. CODE.md explains how to add translated text.

Testing

  • Lint and build pass.
  • All regression scripts pass in English: smoke, det, van, prog, quest, flow, place, compact, chaos. They drive the game through its English labels, which confirms the English text is unchanged.
  • An Italian play-through records every canvas and DOM string through siege, command center, map, sortie, room and result screen. Nothing was left in English apart from proper names (Fort Omega, people, weapon models, Northgate Compact). Screenshots were checked for overflow.

Generated by Claude Code

…oices

- src/i18n: t(englishText, params) returns the current language's
  translation or the English text; language remembered per browser,
  first launch follows the browser language.
- LangSelect: English / Italiano pill selector.
- Radio lines and speech: lines may carry {placeholders}; speech uses a
  voice for the chosen language and falls back to the English line with
  an English voice when the device has none.
- it/data.js: locations, districts, resources, recipes, researches,
  perks, skills, weapons, wave and mission conditions, side objectives,
  bosses, the Compact, vaccine scenarios, NPCs, story and side jobs.
- Side-job offers are fixed templates filled at display time, so offers
  from old saves translate too; journal rewards rebuilt per language.
- Weapon names translated everywhere they're shown (Compact stock,
  soldier cards, reserve, armory picker).
- Siege hint lines shrink to fit next to the speed button.
- README: new screenshots of the current game, an Italian row, and the
  language feature; CODE.md: how to add translated text.
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.

1 participant