Smart way to dynamically translate a scen?

Post new mods and scenarios here.

Moderator: MOD_Command

Post Reply
User avatar
ClaudeJ
Posts: 776
Joined: Wed Mar 08, 2006 5:38 pm
Location: Bastogne

Smart way to dynamically translate a scen?

Post by ClaudeJ »

Hello community,

I thought about translating some scenarios to provide some confort to English impaired players that may lay around. However, I would like to figure out a(n easy) way to have maintain such scenarios while they are updated for whatever reason, ie. by avoiding to create a standalone scenario.

So, would anybody have a bright idea on how to achieve that? Eg. code a Special Action that would display the translated text instead of the original English one.

Thanks for your inputs.
AMD Ryzen 3 1200 @ 3.1, NVIDIA GeForce GTX 1650 4 Go, Windows 10 64bits, 16 GB RAM, Regional settings = French, Belgium
(Previously known as JanMasters0n)
Dan109
Posts: 175
Joined: Thu Apr 27, 2017 1:04 pm

RE: Smart way to dynamically translate a scen?

Post by Dan109 »

Good topic,

I would have an event launch as soon as the scenario starts which determines the desired language assistance. I'd use either use SpecialMessage and then InputBox SE functions to display options and ask for the language, or perhaps even SE_MsgBox and ask if Spanish (in Spanish) is preferred, button options are yes/no/cancel. Yes ends the dialogue choosing Spanish, cancel will default it to English, no will call another SE_MsgBox with the next language, etc. None of this is perfectly elegant, as we don't have a function which can display text AND ask for an answer to the question in that text. Store the language assistance selected in a KeyValue, so it's perm and will be saved.

Existing events will need to then be modified. If they are visible events, the name of the event is usually important to understand and has meaning, so a LUA script inserted to print the translated name of the event to the log, which should also appear on the bottom left message log. It would be a series of nested if/then/else statements based on the value of the KeyValue representing the language selected. As many events do not have LUA code in their action, I would put the LUA code for this in the event conditional, i.e. "If not English then...". I actually have never used a LUA script in an event cause conditional, we obviously want the event to proceed for ALL languages - maybe LUA event conditionals need to be a function, returning true or false. If so, the function can always return true, but while in the function, print additional info based on the language assistance KeyValue. An example would be you might want language assistance during a score event, or whatever.

Further, all LUA event actions would need to be inspected to see if they use Special Message or MsgBox, and have language specific versions be used, rather than the ones printed in default English.

Hope that helps, its not terribly easy, but nor is it difficult to do. This is the most complete method of language assistance I can dream up with available tools.

Dan
Dan109
Posts: 175
Joined: Thu Apr 27, 2017 1:04 pm

RE: Smart way to dynamically translate a scen?

Post by Dan109 »

Oh, btw, I forgot to address your q about special actions. Yes, to give "on demand" ability to display translated scenario description and side briefing, use special action for each and use the language assist KeyVar to call SE_SpecialMessage with the appropriate language.
User avatar
Gunner98
Posts: 6001
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

RE: Smart way to dynamically translate a scen?

Post by Gunner98 »

This is an interesting conundrum.

I take your points in the other thread for a start - use simpler English - not my strong suit for certain.

A most of us will have to rely on Google Translate for this process, a work around for players is to have that open, and cut and paste the messages into it.

A good practice for players, of whatever language ability, is to cut and paste the messages into some form of text document anyway - keeps a record handy.

I've used tis to read AARs in French, Spanish and Greek - Google doesn't do Greek well I can tell you, but it's passable for French & Spanish, probably German. Not sure at all about Asian languages though.

B
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
User avatar
ClaudeJ
Posts: 776
Joined: Wed Mar 08, 2006 5:38 pm
Location: Bastogne

RE: Smart way to dynamically translate a scen?

Post by ClaudeJ »

Thank you both for your advice, I'll try to cast some Lua magic and I'll think about an attached/linked localization.
AMD Ryzen 3 1200 @ 3.1, NVIDIA GeForce GTX 1650 4 Go, Windows 10 64bits, 16 GB RAM, Regional settings = French, Belgium
(Previously known as JanMasters0n)
Post Reply

Return to “Mods and Scenarios”