Facepunch / garrysmod-issues

Garry's Mod issue tracker
145 stars 56 forks source link

cl_language cannot be changed #4110

Closed Python1320 closed 4 years ago

Python1320 commented 4 years ago

Not sure if just x86-64, but cl_language cannot be changed. Main menu settings dialog won't translate with -language finnish or autoexec.cfg or anything I can think of. Nothing ingame either. The translation files are still there in resource folder in sourceengine.

Are you using https://partner.steamgames.com/doc/api/ISteamApps#GetCurrentGameLanguage because in steam you don't have language tab so that call probably returns english regardless of the setting.

I am testing with Finnish. My gmod language is set to finnish. Steam is set to finnish. Regedit shows finnish. autoexec.cfg has "cl_language finnish". lang_reload does not do anything.

In addition with fs_warning_level 3:

] cl_language;english;language_reload
"cl_language" = "finnish" ( def. "english" ) user                                - Language (from HKCU\Software\Valve\Steam\Language)
"english" = "0" ( def. "1" ) client user                                         - If set to 1, running the english language set of assets.
---FS:  ...garrysmod\resource\language\hl1_english.txt (821.804)
---FS:  ...garrysmod\resource\language\hl2_english.txt (821.812)
---FS:  ...garrysmod\resource\language\npc-ents_english.txt (821.821)
---FS:  ...garrysmod\resource\language\pickups_english.txt (821.831)
---FS:  ...garrysmod\resource\language\sandbox-cleanup_english.txt (821.839)
---FS:  ...garrysmod\resource\language\sandbox-settings_english.txt (821.848)
---FS:  ...garrysmod\resource\language\sandbox-undo_english.txt (821.859)
Python1320 commented 4 years ago

Potential regression testing required: https://github.com/Facepunch/garrysmod-issues/issues/3949

robotboy655 commented 4 years ago

Unfortunately this isn't something that can be changed without uprooting a chunk of the Source's localization system to allow for live language changes, gmod_language is set way too late and cl_language wants to be set very early.

The fact that there's 2 convars for this AND a registry key doesn't help either.

Best I can do for now is to tie cl_language to Steam's language and add -language launch parameter as an override.

language_reload is for the resource/language folder. Also I don't see how #3949 is related to any this. cl_language was always forced to English.

neico commented 4 years ago

I hope by Steam's language you mean ISteamApps::GetCurrentGameLanguage and not ISteamUtils::GetSteamUILanguage, there is a per-game language setting on steam after all.

robotboy655 commented 4 years ago

It's not GetCurrentGameLanguage , and as stated above you can override it.

Python1320 commented 4 years ago

Tested and works. cl_language could before be forced to something else with great effort, but not in x64.