Unwanted translation in scripts

Report bugs, bug fixes and workarounds here.
Avatar
Topic author
jogad
Posts: 458
Joined: 17.09.2008
With us: 16 years 2 months
Location: Paris France

Unwanted translation in scripts

Post #1by jogad » 08.01.2011, 14:23

Hello,

This is my script:

Code: Select all

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

and I get this:
terre.png

Overzealous? :lol:

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Unwanted translation in scripts

Post #2by Vincent » 09.01.2011, 10:32

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)
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Unwanted translation in scripts

Post #3by Vincent » 19.01.2011, 08:12

This is fixed now both in the 1.6.1 branch and in the trunk.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3


Return to “Bugs”