Language Switching during Runtime and with start args#817
Open
ApfelTeeSaft wants to merge 1 commit intosmartcmd:mainfrom
Open
Language Switching during Runtime and with start args#817ApfelTeeSaft wants to merge 1 commit intosmartcmd:mainfrom
ApfelTeeSaft wants to merge 1 commit intosmartcmd:mainfrom
Conversation
Implemented runtime Language Switcher in Settings as well as with start args - System Language currently Crashes TODO: fix - Start args only sometimes trigger correctly idek?
Author
|
I noticed that sometimes trying to get the system lang via winapi crashes, i'm not sure exactly why, someone else might have to take a look |
Collaborator
|
Worth note that many strings may just not resolve properly in this version as my initial pass fixing up the translations only handled English. Someone will have to go and merge together the vita XML data with the windows data for all other languages before this works 100% properly |
Author
|
Alright, I will look into that and thank you so much for telling me that, I'll also address the WinAPI crash that occurs in my code :D |
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.
Description
adds runtime language and locale support for the Win64 build and re-enables the language selection UI this introduces a windows runtime implementation for XGetLanguage/XGetLocale, enables language switching through game settings, and allows overriding the locale via launch arguments
Changes
Previous Behavior
on Win64 builds, XGetLanguage() and XGetLocale() were stubbed and always returned fixed values
The language selector UI was disabled in most cases.
changing language at runtime was not supported
the string table loader relied only on the platform language and had no way to override or validate locales
there was no mechanism to detect the system locale on Windows or pass language preferences via command line
Root Cause
the Windows 64-bit platform layer used placeholder implementations for language and locale functions
New Behavior
win64 now supports dynamic language and locale handling
the language selector is enabled on Win64 and Xbox One builds
changing language or locale through settings immediately updates the runtime platform language
detect current system language via winapi
Fix Implementation
implemented a Win64 runtime language system:
added Win64LanguageRuntime.h
replaced stubbed XGetLanguage() and XGetLocale() implementations with runtime-controlled values
added helpers such as Win64SetLanguageLocale, Win64ForceEnglishLanguage, and locale override utilities
enabled runtime language switching:
updated SetMinecraftLanguage and SetMinecraftLocale to update the runtime language/locale on Win64
re-enabled the language selection UI:
enabled _ENABLE_LANGUAGE_SELECT for _WINDOWS64
removed logic that hid the language selector while the game was running
extended string table localization:
added support for forced locale overrides and additional fallback locales
added validation for localization assets when using the tryAllLanguages mode
added fallback handling that forces English if localization assets are missing
added Win64 launch options:
-language / -lang
-languages / -addlanguages
-tryalllanguages
detects the system locale using GetUserDefaultLocaleName
updated locale resolution logic to respect:
user settings
command-line overrides
system language detection
localization fallbacks
AI Use Disclosure
only authored the PR and summarized changes for me.
Related Issues