Skip to content

feat(windows64): add full language selection support with Russian localisation#1229

Closed
Leeksov wants to merge 4 commits intosmartcmd:mainfrom
Leeksov:main
Closed

feat(windows64): add full language selection support with Russian localisation#1229
Leeksov wants to merge 4 commits intosmartcmd:mainfrom
Leeksov:main

Conversation

@Leeksov
Copy link

@Leeksov Leeksov commented Mar 14, 2026

What this PR does

Adds complete in-game language switching support for the Windows64 build, including Russian language localisation.

Changes

Language selection UI

  • UIScene_SettingsOptionsMenu: enable _ENABLE_LANGUAGE_SELECT for _WINDOWS64 — the Language button now appears in Settings
  • UIScene_LanguageSelector.h: expose Simplified Chinese, Slovak and Czech languages on Windows64 (previously Durango-only)

XGetLanguage / XGetLocale for Windows64 (Extrax64Stubs.cpp)

Replace the stubs { return 1; } / { return 0; } with a real implementation:

  1. Checks for an in-game language override stored in GameSettingsA
  2. Falls back to GetUserDefaultLocaleName() and maps to the correct XC_LANGUAGE_ constant

All locale regions are handled: de, fr, es, it, ko, zh-TW/CN, pt, pl, ru, sv, tr, no, nl, cs, sk, el, fi, da, ja.

UIController.cpp fixes

  • Fix typo _WINDOW64_WINDOWS64 in reloadSkinThreadProc (caused crash after skin reload on Windows)
  • SetupFont(): always trigger eAppAction_ReloadFont on language change regardless of GetGameStarted(), so changing language from the main menu refreshes the UI immediately

Consoles_App.cpp

  • getLocale(): add _WINDOWS64 to the #if guard for extended language support (Danish, Finnish, Czech, Slovak, Greek)

Russian localisation

  • Add IDS_LANG_SLOVAK (2286) and IDS_LANG_CZECH (2287) to strings.h + stringsLanguages.xml
  • Add Windows64Media/loc/ru-RU/ with all source XML files
  • Build a correct Windows64-native Russian string block by mapping IDS_* names from XML sources to Windows64 integer IDs — 2283/2288 strings translated, 5 use English fallback
  • Inject ru-RU block into languages.loc and update MediaWindows64.arc

Leeksov added 4 commits March 14, 2026 17:07
…alisation

## Language selection UI
- UIScene_SettingsOptionsMenu: enable _ENABLE_LANGUAGE_SELECT for _WINDOWS64
  so the Language button appears in the Settings menu on Windows
- UIScene_LanguageSelector.h: expose Simplified Chinese, Slovak and Czech
  language buttons on Windows64 (previously Durango-only)

## Windows64 XGetLanguage / XGetLocale implementation (Extrax64Stubs.cpp)
- Replace the stub XGetLanguage(){ return 1; } / XGetLocale(){ return 0; }
  with a real implementation that:
    1. First checks for an in-game override stored in GameSettingsA
       (SetMinecraftLanguage / SetMinecraftLocale)
    2. Falls back to GetUserDefaultLocaleName() and maps it to the
       appropriate XC_LANGUAGE_ / XC_LOCALE_ constant
  All locale regions (de-DE/AT/CH, fr-FR/CA/BE/CH, es-ES/MX/...,
  zh-CN/TW/HK, pt-PT/BR, no/nb/nn, nl-NL/BE, cs-CZ, sk-SK, el-GR,
  ru-RU, sv-SE, tr-TR, fi-FI, da-DK, ko-KR, ja-JP, it-IT, pl-PL)
  are handled.

## UIController.cpp fixes
- Fix typo _WINDOW64 -> _WINDOWS64 in reloadSkinThreadProc that caused
  NavigateBack() to be called after skin reload on Windows, crashing the game
- SetupFont(): always trigger eAppAction_ReloadFont when the font type is
  unchanged but the language changed (previously only triggered while in-game),
  so changing language from the main menu now refreshes the UI immediately

## Consoles_App.cpp
- getLocale(): add _WINDOWS64 to the #if guard for extended language support
  (Danish, Finnish, Czech, Slovak, Greek) so those locales resolve correctly

## Russian localisation (languages.loc + MediaWindows64.arc)
- Add IDS_LANG_SLOVAK (2286) and IDS_LANG_CZECH (2287) to strings.h
- Add Slovak and Czech display names to stringsLanguages.xml
- Build a complete Windows64-native Russian string block by mapping
  string names from Durango/Orbis/PS3/PSVita ru-RU XML files to the
  Windows64 integer IDs defined in strings.h (2283/2288 strings translated,
  remaining 5 use English fallback)
- Inject the ru-RU block into Windows64Media/Media/languages.loc and
  update Common/Media/MediaWindows64.arc accordingly
Copy Russian localisation XML sources from DurangoMedia/loc/ru-RU/ into
Windows64Media/loc/ru-RU/ so the build system and developers have the
original translatable strings alongside the compiled languages.loc:

  - stringsGeneric.xml
  - stringsPlatformSpecific.xml
  - stringsLeaderboards.xml
  - 4J_stringsGeneric.xml
  - 4J_stringsPlatformSpecific.xml

These XML files are the source of truth used to build the ru-RU block
in languages.loc (mapping IDS_* names to Windows64 integer IDs).
…uages.loc

Previously IDS_LANG_SLOVAK (2286) and IDS_LANG_CZECH (2287) were only
present in the ru-RU block. All other language blocks (en-US, de-DE,
es-ES, fr-FR, it-IT, ja-JP, ko-KR, pt-BR, zh-CHT) only had 2286 strings
(indices 0-2285), causing empty/blank text when displaying the Slovak and
Czech language buttons on any non-Russian UI language.

Extended all blocks to 2288 strings with localised language names:
  en-US: Slovak / Czech
  de-DE: Slowakisch / Tschechisch
  es-ES: Eslovaco / Checo
  fr-FR: Slovaque / Tcheque
  it-IT: Slovacco / Ceco
  ja-JP: Slovak / Czech (romanised)
  ko-KR: Slovak / Czech (romanised)
  pt-BR: Eslovaco / Tcheco
  zh-CHT: Slovak / Czech
  ru-RU: preserved correctly
Windows64 previously only had 10 language blocks (en-US, de-DE, es-ES,
fr-FR, it-IT, ja-JP, ko-KR, pt-BR, zh-CHT, ru-RU). All other languages
in UIScene_LanguageSelector fell back to English.

Added the 13 missing language blocks by mapping Durango/other-platform
XML source files to Windows64 integer IDs from strings.h:

  pt-PT  Portuguese (Portugal)
  da-DK  Danish
  fi-FI  Finnish
  nl-NL  Dutch
  pl-PL  Polish
  sv-SE  Swedish
  nb-NO  Norwegian
  sk-SK  Slovak
  cs-CZ  Czech
  el-GR  Greek
  zh-CN  Simplified Chinese
  es-MX  Spanish (Latin America)
  en-GB  English (UK, used as Greek fallback)

Each block contains 2288 strings with correct Slovak/Czech language name
translations, and English fallback for Windows64-specific strings not
present in Durango source files (coverage 83-98% per language).

Also enable eFont_SimpChinese for _WINDOWS64 in getFontForLanguage()
so Simplified Chinese uses MSYH.ttf (already present in Common/Media/font/CHS/)
instead of falling back to the bitmap font which cannot render CJK glyphs.
@codeHusky
Copy link
Collaborator

How was the .loc edited?

@codeHusky
Copy link
Collaborator

This PR has too much in it that seems to be AI generated and also doesn't use our PR template. Closing due to vibecoding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants