Game Translation+Loading correct GUI

Started by Gabarts, Thu 11/12/2014 19:44:32

Previous topic - Next topic

Gabarts

I've made the Translation file with all the ingame text and dialogs for translators. I've imported a custom italian GUI and set my default language to italian (the game you know is "Indiana Jones and the gold of gengis khan").

I'll make an english custom GUI too, how can I tell the program to load the correct GUI ( I assume all the text, dialogs auto load switching from winsetup.exe).

Gabarts

#1
Maybe in 1 room (Room_Load) this?

Code: ags
if(IsTranslationAvailable()) {


But then how to set eLangEN?

I tried this
Code: ags
lang = eLangEN();
but give me undefined token

Scavenger

Code: AGS

if (Game.TranslationFilename == "English") //or whatever you call your .tra file.
{
    //Do all the switching stuff here.
}


I think you'd be able to have a single GUI and change the images on it rather than switching to an entirely different GUI, so just in game_start () you need to swap the images the buttons on the GUI use depending on the translation the game is using.

abstauber

I suppose you are using the bundled 9Verb template?

Quote from: 9verb.pdf
To switch the language in a .trs translation file, tell your translators to look out for the line.

GUI_LANGUAGE
Now simply translate that line with DE, EN, ES, FR or PT to set the GUI to the corresponding language.


You can see how it's done in the globalscript's game_start function.

Gabarts

Quote from: abstauber on Fri 12/12/2014 07:20:03
I suppose you are using the bundled 9Verb template?

Quote from: 9verb.pdf
To switch the language in a .trs translation file, tell your translators to look out for the line.

GUI_LANGUAGE
Now simply translate that line with DE, EN, ES, FR or PT to set the GUI to the corresponding language.


You can see how it's done in the globalscript's game_start function.


Thanks both for answering. Ah, yes, so basically it is done automatically with the translation file, it auto-assign the correct GUI? Yes, I'm using the 9-Verb. Don't know if I've messed up something with some lines in the GUIscript, but I have the stored sprites for GUI in all languages since the start, so I think should work without problems.

abstauber

Yep. In Winsetup you chose the language and GUI changes the icons according to what you setup in the translation file.

For example your english translation file needs to contain these lines.

GUI_LANGUAGE
EN

Mandle

Quote from: Gabarts on Thu 11/12/2014 19:44:32
(the game you know is "Indiana Jones and the gold of gengis khan")

Oh my God...does this mean the game is coming out soon???

I so love the look of your game!

Gabarts

#7
Yeah Mandle, is already out in italian, but i'm having some trouble now with the english version... :( I explain:

- I've made english GUI
- I've made the trs file and compiled with some lines translated to test it...
- Put GUI_LANGUAGE as you said
      en

Now, when I first edited my game I put default language to ita in the guiscript file. For some reason I get this:

if I leave a space under GUI_LANGUAGE and then put en the game loads the correct translated text and dialogs and hotsposts but the GUI is the default one, so in italian.

if no space under GUI_LANGUAGE with en, it loads the correct english GUI but text and dialogs remains the default one, so in italian! ???

I've messed up something?    EDIT [Don't know if is correct but I think to have solved for the moment, I've simply put this and it works for both GUI and text]

Code: ags
GUI_LANGUAGE
en
en

SMF spam blocked by CleanTalk