Page 3 of 3

Re: [0.11.22] Right-To-Left languages are presented Left-To-Right

Posted: Sat Jul 25, 2015 6:14 pm
by jockeril
cube wrote:I added a functionality very simillar to Dev-iL's script to 0.12.1. It's definitely not perfect, and there will be issues with line wrapping strings, but it's better than nothing.
Update for [0.12.1] - Problem not resolved yet - all the non-hebrew text, including the [FONT] section in the "core.cfg" file is inverted as well. The code needs to differentiate hebrew letters from latin, symbols and all other characters in the locale files...

I have manually inverted the [font] section items just to be able to start factorio in hebrew

Re: [0.12.1] Right-To-Left languages are presented Left-To-Right

Posted: Wed Jul 29, 2015 7:40 am
by MF-
I guess that would be the result of "if (hebrew) then just_print_everything_RLT" ?
Still good progress I'd say.

Now you have to invert the LTR/English text in the hebrew files,
which is much less tedious. :)

Re: [0.12.1] Right-To-Left languages are presented Left-To-Right

Posted: Wed Jul 29, 2015 10:45 am
by jockeril
MF- wrote:I guess that would be the result of "if (hebrew) then just_print_everything_RLT" ?
Still good progress I'd say.

Now you have to invert the LTR/English text in the hebrew files,
which is much less tedious. :)
Basicly, you'r right... I just hed bring it up becuase if anyone else get this error, this post should be the first place he looks.

After checking with the current Hebrew translator -@Dev-il, As I understand it, a fix for this problem was implemented about half an hour after the 0.12.1 version was released. It took me another day to get to d/l'ing the new version and checking it.

Next version should have a fix for Hebrew & English

Re: [0.12.2] Right-To-Left languages are presented Left-To-Right

Posted: Sat Aug 01, 2015 11:03 am
by Dev-iL
cube wrote:I added a functionality very simillar to Dev-iL's script to 0.12.1. It's definitely not perfect, and there will be issues with line wrapping strings, but it's better than nothing.
Inverted English and parentheses still appears in 0.12.2:
Image

I guess I'll just update my mod with the latest strings....

Re: [0.12.1] Right-To-Left languages are presented Left-To-Right

Posted: Sat Aug 01, 2015 1:55 pm
by jockeril
didn't think about latest strings, just used your mod from the previous version...

לא חשבתי על זה שיש עדכונים לטקסטים, ישר עדכנתי לתוסף שלך מהגירסא הקודמת

Re: [0.12.1] Right-To-Left languages are presented Left-To-Right

Posted: Wed Aug 12, 2015 2:15 pm
by cube
So I spent the better part of today thinking about how to fix this problem properly, and then I gave up. The BiDi algorithm is so complicated that I can't hope to implement it myself in a reasonable time (and without too many errors), and all libraries I found are either just an example, or have slightly incompatible license.

So I went back to Dev-iL's idea with external script to reverse the characters and used python-bidi in our deploy scripts.

I manually checked the content of the mod against output of python-bidi and the only difference I noticed was with percentages in technology names. In the mod i see "%80 something hebrew", in my script output it's "80% something hebrew". The problem is that I don't know if my editor supports RTL or no, so I don't know which way it should go :-) @Dev-iL: Did you check that percentages are correct in your script output?

I'm attaching core.cfg and base.cfg from the new method for criticism. Please replace the files in game and have a look. Thanks.

Re: [0.12.1] Right-To-Left languages are presented Left-To-Right

Posted: Wed Aug 12, 2015 2:29 pm
by cube
I almost forgot -- you will need to delete the "rtl" = true flag in core/locale/he/info.json. Easiest way to do this is to test my two files on a directory that already has Dev-iL's changes applied.

Re: [0.12.1] Right-To-Left languages are presented Left-To-Right

Posted: Thu Aug 13, 2015 3:17 pm
by Dev-iL
cube wrote:@Dev-iL: Did you check that percentages are correct in your script output?

I'm attaching core.cfg and base.cfg from the new method for criticism. Please replace the files in game and have a look. Thanks.
As I said in IRC: with my method this is not displayed correctly, with yours it is:
Image

Re: [0.12.1] Right-To-Left languages are presented Left-To-Right

Posted: Sun Mar 27, 2016 3:06 pm
by jockeril
Where are we about this ? Is there any chance that that python-bidi makes it into the game code instead of in your deploy scripts ?

I'm tired of inverting every translation I add to mods... :(

Re: [0.12.1] Right-To-Left languages are presented Left-To-Right

Posted: Tue Mar 29, 2016 10:03 am
by cube
jockeril wrote:Where are we about this ? Is there any chance that that python-bidi makes it into the game code instead of in your deploy scripts ?

I'm tired of inverting every translation I add to mods... :(
Not a very large chance, sorry. We can't use python-bidi because that would require python instalation. The C++ libraries I've seen were either huge or not working properly or with an incompatible license or some combination of these.

I can probably dig out the inverting script from our deploy script and publish it on github or something, if that will help you.

Re: [0.12.x] Right-To-Left languages are presented Left-To-Right

Posted: Wed Apr 06, 2016 4:50 pm
by jockeril
cube, I found some interesting answers here (How can I recognize RTL strings in C++) - those guys are talking about a C++ unit called ICU (answer 2) AND there is also a short code example (answer 3) - will you please reconsider ?