MegaGlest Forum

MegaGlest => Bug reports => Closed bug reports => Topic started by: eliyahu52 on 20 November 2013, 21:51:36

Title: [invalid] v3.9.0 fails to start with translation option set to an invalid value
Post by: eliyahu52 on 20 November 2013, 21:51:36
Hi!

I installed the new version (3.9), and when I try to start a game I get this error:

Code: [Select]
#2 An error occurred and MegaGlest will close.
Error msg = [Error converting string to bool, expected 0 or 1, found: [שלילי]
Stack Trace:
./megaglest:Shared::Platform::megaglest_runtime_error::megaglest_runtime_error(std::string const&, bool)address [0xbc64be] line: 299
./megaglest:Shared::Util::strToBool(std::string const&)address [0xbaab5e] line: 38
./megaglest:Glest::Game::Lang::loadGameStrings(std::string, bool, bool)address [0x6ead8c] line: 105
./megaglest:Glest::Game::glestMain(int, char**)address [0x79c08e] line: 4749
./megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x7a22f1] line: 5660
./megaglest:Glest::Game::glestMainWrapper(int, char**)address [0x7a24d8] line: 5732
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main()address [0x7ffc22571ea5] line: 0
./megaglest() [0x5ee9b9]address [0x5ee9b9]
]

Please report this bug to  http://bugs.megaglest.org

Run ubuntu 13.04 64 bit.

Does anyone knows the problem?

Kaplan
Title: Re: Can't start the game, after installing the 3.9 version Ubutntu 13.04 64 bit
Post by: softcoder on 20 November 2013, 22:41:37
Look in hebrew.lng for:

FONT_RIGHTTOLEFT_MIXED_SUPPORT=

This line should NOT contain and hebrew. I am assuming you have a hewbrew.lng file you edited yourself?
Title: Re: Can't start the game, after installing the 3.9 version Ubutntu 13.04 64 bit
Post by: eliyahu52 on 21 November 2013, 00:17:05
I don't have this line in hebrew.lng file, and I didn't edit hebrew.lng file (I used "advance translation" option to test the translation).

But now I notes that I translated today the string "false = [שלילי]" in Transifex and downloaded the latest translation, and I see this word "שלילי" in the secund line of the error message, maybe it's connected, but I don't see the string in hebrew.lng file either.
Title: Re: Can't start the game, after installing the 3.9 version Ubutntu 13.04 64 bit
Post by: tomreyn on 21 November 2013, 00:43:28
The root of the problem you are facing here (like several other translators did before) is that there are both translations and options / settings in the main translation file / resource, and that it is difficult for translators to understand which is which.

In this very case what happened is that you edited the value for the option/setting FONT_RIGHTTOLEFT_MIXED_SUPPORT in the Hebrew main language file on Transifex (https://www.transifex.com/projects/p/megaglest/viewstrings/#he/main-language-file/19030685?key=FONT_RIGHTTOLEFT_MIXED_SUPPORT) today, setting it to a translation of the English word "false" since you assumed this is a string which is to be translated - it is not as a rule of thumb any translation key in all upper case characters is actually a setting/option and it's English value is not meant to be translated to the target language. Instead, it is used to define how the (other) translations of this language are to be handled and interpreted  by MegaGlest. For example, there is one such all upper case key which, if set to the (English) string "true" in the target language, will make the game engine interpret this as a language which is spelled / read from right to left.

Now after you edited the Hebrew FONT_RIGHTTOLEFT_MIXED_SUPPORT (https://www.transifex.com/projects/p/megaglest/viewstrings/#he/main-language-file/19030685?key=FONT_RIGHTTOLEFT_MIXED_SUPPORT) value on Transifex and set it to a value MegaGlest cannot handle, you used the advanced translation option of MegaGlest to import these latest changes from Transifex. When you do this, the original translations MegaGlest has installed on your computer are not overwritten but stay in place, however, the downloaded translations are placed in $UserData_Root (http://wiki.megaglest.org/INI)/data/lang/ and, if any are found there by the game, take precedence over those initially installed. However, since MegaGlest is unable to handle the (Hebrew) value you put there, it crashes at this point. On your Linux system, with MegaGlest installed using the official v3.9.0 installer, $UserData_Root (http://wiki.megaglest.org/INI) resolves to ~/.megaglest/ (i.e. a hidden directory .megaglest located inside your home directory).

So you will wonder how to recover now and be able to start MegaGlest again. There are two ways to do so:
1. Manually delete $UserData_Root (http://wiki.megaglest.org/INI)/data/lang/hebrew.lng
2. Start a terminal window / command prompt in the directory MegaGlest is installed in (i.e. where the executable / binary files are located) and run MegaGlest in English from there by passing the --use-language=en command line option

Since it is my understanding that this behaviour is as designed, I'm tagging this bug report [invalid] and editing its title to be more comprehensive to others.
Title: Re: [invalid] v3.9.0 fails to start with translation option set to an invalid value
Post by: eliyahu52 on 21 November 2013, 21:37:42
I've changed the file you said, and it's worked! Thank you!

But the real question is why this string appear in Transifex to translate? Now that I untranslated it, the hebrew translation stands on 99%.

I don't know how, but you must mark this string us not need to translate otherwise someone else will translate it, and will damage the game for all hebrew users.
Title: Re: [invalid] v3.9.0 fails to start with translation option set to an invalid value
Post by: softcoder on 21 November 2013, 21:49:47
I just removed it from the english file so it will no show up anymore for other languages once transifex gets the update.
Title: Re: [invalid] v3.9.0 fails to start with translation option set to an invalid value
Post by: GunChleoc on 22 November 2013, 10:29:17
Won't translators still need to set this to "true" or "false", depending on if their language is RTL or LTR?
Title: Re: [invalid] v3.9.0 fails to start with translation option set to an invalid value
Post by: softcoder on 22 November 2013, 16:50:33
At this point no. There are a number of properties that only need to be set in special cases (like this one). I am not totally sure that some of the properties added are needed anymore and i need to do some testing to weed out older properties that are no longer required.