Skip to content

Language Switching during Runtime and with start args#817

Open
ApfelTeeSaft wants to merge 1 commit intosmartcmd:mainfrom
ApfelTeeSaft:feat/runtime-lang-switcher
Open

Language Switching during Runtime and with start args#817
ApfelTeeSaft wants to merge 1 commit intosmartcmd:mainfrom
ApfelTeeSaft:feat/runtime-lang-switcher

Conversation

@ApfelTeeSaft
Copy link

@ApfelTeeSaft ApfelTeeSaft commented Mar 7, 2026

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

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?
@ApfelTeeSaft
Copy link
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

@codeHusky
Copy link
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

@ApfelTeeSaft
Copy link
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

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.

[Suggestion] Language Settings

2 participants