feat(windows64): add full language selection support with Russian localisation#1229
Closed
Leeksov wants to merge 4 commits intosmartcmd:mainfrom
Closed
feat(windows64): add full language selection support with Russian localisation#1229Leeksov wants to merge 4 commits intosmartcmd:mainfrom
Leeksov wants to merge 4 commits intosmartcmd:mainfrom
Conversation
…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.
Collaborator
|
How was the .loc edited? |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Adds complete in-game language switching support for the Windows64 build, including Russian language localisation.
Changes
Language selection UI
_ENABLE_LANGUAGE_SELECTfor_WINDOWS64— the Language button now appears in SettingsXGetLanguage / XGetLocale for Windows64 (
Extrax64Stubs.cpp)Replace the stubs
{ return 1; }/{ return 0; }with a real implementation:GameSettingsAGetUserDefaultLocaleName()and maps to the correctXC_LANGUAGE_constantAll 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
_WINDOW64→_WINDOWS64inreloadSkinThreadProc(caused crash after skin reload on Windows)SetupFont(): always triggereAppAction_ReloadFonton language change regardless ofGetGameStarted(), so changing language from the main menu refreshes the UI immediatelyConsoles_App.cpp
getLocale(): add_WINDOWS64to the#ifguard for extended language support (Danish, Finnish, Czech, Slovak, Greek)Russian localisation
IDS_LANG_SLOVAK(2286) andIDS_LANG_CZECH(2287) tostrings.h+stringsLanguages.xmlWindows64Media/loc/ru-RU/with all source XML fileslanguages.locand updateMediaWindows64.arc