How to set game language with Unrealscript?

I’m adding localization to my project. I see where the language is set in the config files:


[Engine.Engine]
Language=INT

However I don’t see it anywhere in Unrealscript. So not sure how to set it through Unrealscript. Anyone have any ideas?

Cheers

I’ll start with this topic sometime soon so I’d like some info as well
the documentation says to “just change the Language in the engine ini”… as if we’d need to tell the end user to do it themselves :1
maybe there’s a way to change the engine class variable somehow

Strange, the config variable for that setting doesn’t seem to exist at all. (displayall engine language = none)
If some native code is reading the setting from the .ini, then the only option is to use a DLL to read the .ini file and edit that line.

I was also surprised to see the documentation state to “just change the Language in the engine ini”. Thanks fine for devs, but certainly not something you’d want to advise players of your game to do.

I see many UDK games on steam have a language select in the game preferences in steam. Maybe there is a launch param we can add to set language…?

Can you see if you can access these functions in Object?

GetLanguage()
SetLanguage(string LangExt, optional bool bReloadObjects = true)

IIRC there should be a command line argument for language but I couldnt find in the docs. maybe I’m just confused with the one in UE4 :confused:

It seems there isn’t much we can do within Unrealscript to handle this. I wonder if I should learn how to use dllbinds so that I can update the config file that way. Even then, i’m not too sure how easy that would be. If you have any ideas, please let me know. What a pain to achieve something so universally inherent in most released games.

GetLanguage is there but SetLanguage isn’t. I tried putting it in code just in case but the compiler fails at it :frowning:

It’s clearly a problem that has been solved many times. Would be great if someone who has tackled this previously would offer some advice.

I’ve found several old threads asking this very question and none of them has an answer
I think I’ll do away without the built-in localization. it seems everything I need is doable if I just ignore the system and make something custom

I believe launching the game with LANGUAGE=XYZ in the command line overrides the language

Nice find @Chosker. I’ll give that a try in a bit. Now if there was a way to force a game restart (with passing params) via unrealscript, the problem would be solved.

Hmmmmm, adding a launch param to the game shortcut didn’t seem to work:

UDK-2014-08\Binaries\Win32\UDK.exe ?language=DET

try UDK.exe -language=DET instead
again though, not guaranteed to work

anyway as I said, I’m making it all custom-made and I won’t be using the included localization functonality.
the downside is I have to make my way around getting the right language for each word/phrase manually, aka. my own localization functions
the upside is I’ll be able to change it from within the menu without needing to restart the game, or any command line stuff.
I’ve found a way to hijack SoundCue subtitles which will be super useful to parse and localize them before printing them out :slight_smile: