Page 1 of 1

Unwanted translation in scripts

Posted: 08.01.2011, 14:23
by jogad
Hello,

This is my script:

Code: Select all

celestia:print("Earth ",5,0,0,5,0)

and I get this:
terre.png

Overzealous? :lol:

Re: Unwanted translation in scripts

Posted: 09.01.2011, 10:32
by Vincent
Hi Jo?l,

Strings get indeed translated in scripting messages.
I had to remove the extra blank space after "Earth" to reproduce this, though.
That means that all strings like "Earth" or "Real time" which belong to the translation list
will get translated if they're passed to the print command with no other extra word or character.

This can be fixed by removing the gettext macro _() in celestiacore.cpp, line 3898 :

Code: Select all

        *overlay << _(messageText.c_str());

Code: Select all

        *overlay << messageText.c_str();

The gettext macro is redundant here at least for two reasons:
- Text messages that are displayed when pressing a key are already marked
for translation upstream in the code. So they would still get translated after making
the above change.
- I added an object:localname() method to celx scripting a while ago that returns the localized
name of an object. So object names could still be translated using, e.g.:

Code: Select all

earth = celestia:find("Sol/Earth")
celestia:print(earth:localname() ,5,0,0,5,0)

Re: Unwanted translation in scripts

Posted: 19.01.2011, 08:12
by Vincent
This is fixed now both in the 1.6.1 branch and in the trunk.