Problem in translation modules

Started by tiagocorreia, Mon 17/07/2006 09:33:50

Previous topic - Next topic

tiagocorreia

Hi,

I've some modules (Description, for example) that have some text of the game_start function, that initializes some strings.

I've created a translation file for my game, and then build a compiled version of it, and when I use it, the texts that were in module don't appear translated in the game.

Any ideias, and can I solve this problem?

Rui 'Trovatore' Pires

Well, a dirty workaround, until someone gets around to looking into this (it sure seems like something worth looking into) would be to do it manually, maybe in your own module - using the GetTranslation (or something) function, you see what translation is being used and you display a different message (read: same message in according language) accordingly.

Well, it's an idea. But someone will come along soon with better ones, I'm sure, so stay tuned.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

strazer

IIRC, module strings not being translated is by design.

It would be easier to suggest a proper workaround if you provided a bit more details.
Are you talking about SSH's Description module or your own module? What are these strings for?
Maybe the module could be improved to allow these strings to (optionally) be set from the main global script?

Gilbert

This made me think, maybe it's the module writters' responsibilities to ensure that their modules do not contain strings which would get displayed (except for warning/error messages maybe, but it would still be nice if these message could get translated) directly in game, OR the modules come with default messages which can all be customized via in-game scripts, like for (crappy random simple) example, if we have made a quit interface module, which displays a message on it, there's a default line like "Do you want to quit?", but provides a function to customize it, like for example, put the following line in the global script:
QuitMod.SetQuitMessage("Wanna Quit?");
then the line "Wanna Quit?" should also appear in translations.

On the other hand, I'm not sure, but still it may be difficult to avoid displaying messages in modules (like those warning/error messages mentioned above say for example), so maybe it's a good idea to provide translation files support for modules also, which are compiled independently from the main games so could be included with module packages for users.

GarageGothic

This is bad news. I intended to put all my dialogs in a separate module to make the global script less cluttered. I guess I'll either move it back to the global script or give up on translating the game. :(

tiagocorreia

Well, I also have a a module, called Game Functions, where I've lots of classes and functions. I guess I've to move them all the global script.

I'm using SSH Description Module, with some changes. He text descriptions can be changed, so I guess I've to do it in the global game_start function, that should solve the problem.

Now I've question, if the strings from modules can't be translated, why do they show up in the translation files? Maybe this should be fixed.

Thanks for all the help. I think the information provided should be enough to solve the problem.

tiagocorreia

#6
I've what it seems to be a problem, but might also be like this by desing.

I understand that the strings in modules, don't get translated, which is fine I think, but then, they should not appear in the translation file

So, I've tried to initialize the values of the module Description, on game start, like this
Code: ags

  Description.LookS="Olhar para";


But it didn't work, only work when I did this
Code: ags

  Description.LookS=GetTranslation("Olhar para");


The same thing happens with PlayVideo fucntion. So I guess in some situations the strings don't get translated, in toehr cases they get translated. Can this me docuemnted in the help file? It would help a lot.

Only the dialogs and objects names get translated?
The Say strings are also translated.

Pumaman

Translations are only used by certain commands, such as Display, Say, etc.

Commands like PlayVideo and File.Open don't translate the filenames (for obvious reasons).

Which particular command are you using to display the description text?

SSH

It will either be setting a GUI label or creating a text overlay with the string, neither of which, I guess, are affected. Some manual code could be inserted, though, to check for translations and change the strings.
12

GarageGothic

You could just put something like this into your code:

Code: ags
mylabel.Text = GetTranslation(originalstring);


As the String is returned untranslated if there is no translation, you don't even need to check for that first.

SMF spam blocked by CleanTalk