ScenEdit_MsgBox(...) returns values in non-English languages?

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
musurca
Posts: 168
Joined: Wed Jul 15, 2020 10:06 pm
Contact:

ScenEdit_MsgBox(...) returns values in non-English languages?

Post by musurca »

Does anyone know the return value of ScenEdit_MsgBox(...) in non-English languages?

For example: in English, ScenEdit_MsgBox(msg, 4) will return either 'Yes,' 'No,' or 'Cancel.' ScenEdit_MsgBox(msg, 2) will return 'Abort,' 'Retry,' and 'Ignore.'

Are those values localized, or are they always the same strings?

Thanks!
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: ScenEdit_MsgBox(...) returns values in non-English languages?

Post by KnightHawk75 »

idk for sure, but I don't think they are localized (by the game anyway).
musurca
Posts: 168
Joined: Wed Jul 15, 2020 10:06 pm
Contact:

RE: ScenEdit_MsgBox(...) returns values in non-English languages?

Post by musurca »

Thanks, that would be very convenient if true! But the actual UI buttons are localized, right? They will, for example, appear to say “Oui” and “Non” in French for the user instead of “Yes” and “No”?

(And as an aside, is there an easier way to test this than mucking about with one’s Windows locale?)
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: ScenEdit_MsgBox(...) returns values in non-English languages?

Post by KnightHawk75 »

Yeah the button labels themselves will typically be localized (or if .net language packs for the language in use are installed they will be). As for the response though per the code you should always get the result of enum.tostring() being called on a system.windows.forms.DialogResult enum value. The idk for sure part comes into play because I don't know if a .net language pack is installed for the local language if it also includes translations for dialogresult enum names (the packs are more aimed at error messages and standard\default dialog text), if not installed I'm pretty sure you'll get the default English in the response code, but if one is installed and it is part of what's translated then you could in theory get a translated version. I'm not in a position atm where I can easily test that for you. It could be my internet-search-fu is lacking, but trying to find detailed information on just what is translated in the packs and what isn't didn't turn up an definitive answer.


I don't know an easier way to test what's specifically at play here. Perhaps a one of the devs or users here who have non-english windows systems could shed light on what the results are when they run print(ScenEdit_MsgBox('Hello World.',3)) in the lua console and indicate along with the result if they have a .net language pack installed for their non-English windows language.

Post Reply

Return to “Lua Legion”