one game playable in multiple translations?
george
22 Oct 2013, 06:07Talking with Luc in a different thread made me wonder what people usually do if they want to translate a Quest game and/or produce one game playable in multiple translations.
If I code a game with English.aslx, and I also want that game playable with Deutsch.aslx
* do I have to produce two separate game files?
* Or is it possible to include them both and switch them depending on player choice?
* If the latter, what's the best way to include the game text when for each text there will be two versions, English and Deutsch?
Thanks for any pointers.
If I code a game with English.aslx, and I also want that game playable with Deutsch.aslx
* do I have to produce two separate game files?
* Or is it possible to include them both and switch them depending on player choice?
* If the latter, what's the best way to include the game text when for each text there will be two versions, English and Deutsch?
Thanks for any pointers.

jaynabonne
22 Oct 2013, 08:31I have not translated a game myself, but from what I know of the language variants in Quest, you'd have to have two separate games if you want to use the language scheme in Quest. For example, at the top of a game file is typically an include for "English.aslx", which could be changed to Deutsch.aslx. But it's a compile time thing.
I threw in the qualifier "if you want to use the language scheme in Quest" because you could always roll your own language switching scheme. I'm not sure what that would entail, but it would probably require touching all the places that use a template and making it select based on language (somehow). Not a piece of cake, but not impossible if you were so motivated.
I threw in the qualifier "if you want to use the language scheme in Quest" because you could always roll your own language switching scheme. I'm not sure what that would entail, but it would probably require touching all the places that use a template and making it select based on language (somehow). Not a piece of cake, but not impossible if you were so motivated.

george
22 Oct 2013, 15:27Thanks jaynabonne. Rolling my own language switcher doesn't seem out of the question, I wonder what would be more convenient. I wonder if it might be just as easy and less error prone to set it up in the game-producing toolchain?
I'm imagining a scheme where I'd represent all the game text with tokens, like $hallway_desc, and use those as keys to point to the English/Deutsch translations in other files. Then I'd guess I'd have to preprocess the game file to replace tokens with game text. Does that sound reasonable?
I'm imagining a scheme where I'd represent all the game text with tokens, like $hallway_desc, and use those as keys to point to the English/Deutsch translations in other files. Then I'd guess I'd have to preprocess the game file to replace tokens with game text. Does that sound reasonable?

jaynabonne
22 Oct 2013, 17:29Just so I'm clear, when you say, "I'd have to preprocess the game file to replace tokens with game text", do you mean at run time? Or do you mean before you publish the game? (The latter would end up being separate files, but you would not be able to address the game "file" as such at runtime - just objects and their attributes. If I'm getting lost in semantics, I apologize.)
george
23 Oct 2013, 03:00Right, I meant at compile time, or technically before Quest compile time happens.
I've been kicking around the idea of doing it at runtime. It seems like it would be convenient to load the language file as an external resource -- that way you wouldn't increase loading times...would it be possible to load a dictionary from Javascript into Quest?
I've been kicking around the idea of doing it at runtime. It seems like it would be convenient to load the language file as an external resource -- that way you wouldn't increase loading times...would it be possible to load a dictionary from Javascript into Quest?

jaynabonne
23 Oct 2013, 08:42So if you're going to do it at compile time, then you're going to end up with multiple game files, one per language (you can only compile one at a time). If so, then you'd just include the appropriate core language file at the top, and you could use the built-in template mechanism to vary the text for your different language variants.
So your total change per language could be a core language file include (e.g. English.aslx) and then your own language file include at the top of your game file.
So your total change per language could be a core language file include (e.g. English.aslx) and then your own language file include at the top of your game file.