Page 17 of 17

Re: fr_stringtable

Posted: Tue Apr 21, 2015 5:50 pm
by Dilvish
Ouaz wrote:[key][space][space][#][space][translated] : that's right? (two spaces needed before #)
That is my suggestion, yes. As far as the parser is concerned, the spaces are optional. But that spacing is standard for python comments, and python is the language Cj uses for these scripts, plus the whole reason it is standard for that language is because it is considered to improve readability, so that why I suggested it.

Re: fr_stringtable

Posted: Mon May 04, 2015 8:37 pm
by Cjkjvfnby
Any ideas how to programatically detect end of file header? Current implementation finds first not commented line. It is line 13: https://github.com/freeorion/freeorion/ ... fr.txt#L13. On updating file I copy header as is and got duplicated #APPNAME.

Re: fr_stringtable

Posted: Mon May 04, 2015 9:52 pm
by Dilvish
Cjkjvfnby wrote:...On updating file I copy header as is...
Could you explain this part more?

Re: fr_stringtable

Posted: Tue May 05, 2015 5:47 am
by Cjkjvfnby
Dilvish wrote:
Cjkjvfnby wrote:...On updating file I copy header as is...
Could you explain this part more?
Then I parse fr.txt, I find header to copy it as is to new file. After that I iterate other en.txt and put keys of en.txt to new file (commented of with fr.txt values). As result I got new file with translation and commented out untranslated strings.

Here is new file:

Code: Select all

Français

#This is the French String Table file for FreeOrion.
#Traduction par alchemy, shivu, zareif, nilstilar et Ouaz. Traduction et amélioration en cours (04/2015). Version FR complète prévue pour release 0.4.5.

#################
#    Common     #
#################

#APPNAME
#FreeOrion

#APPNAME
#FreeOrion
This is header after my script works. For en.txt it is ends after 'common' section.

Re: fr_stringtable

Posted: Tue May 05, 2015 6:09 am
by Dilvish
Ok, I think I understand your intent now, and the basics of what you did. If you want to post (or link to) your script I'll see if any ideas come to mind.

Re: fr_stringtable

Posted: Tue May 05, 2015 2:11 pm
by Cjkjvfnby
Dilvish wrote:Ok, I think I understand your intent now, and the basics of what you did. If you want to post (or link to) your script I'll see if any ideas come to mind.
Here end of parsing header:
https://github.com/Cjkjvfnby/freeorion/ ... se.py#L113

Re: fr_stringtable

Posted: Tue May 05, 2015 3:11 pm
by Dilvish
So, it looks to me like the beginning of make_copy() considers

Code: Select all

#APPNAME
#FreeOrion
to be part of the FR header and automatically includes it at the start of the result, without paying any more attention to its contents (this is the primary source of the problem). Then in parse(other_path) these lines just get skipped over (like all other commented-out-untranslated-keys). So later your code believes that the result does not have a APPNAME as a key yet, and so it adds the

Code: Select all

#KEY
#VALUE
construction for it, causing it to be doubled up. I think that before you do all the processing on other and other_path, you need to determine the keys of EN, and then when you are checking for the other header you need to look for that

Code: Select all

#KEY
#VALUE
construction and not include *any* such constructions in the header if they correspond to an actual key in EN. Or, at the very least, not include them in the header if they match the starting keys in EN (you could still wind up with them duplicated then, but it wouldn't be so glaring)

Re: fr_stringtable

Posted: Fri May 15, 2015 5:25 pm
by Dilvish
so, did this work out for you?

Re: fr_stringtable

Posted: Sat May 16, 2015 9:27 pm
by Cjkjvfnby
Dilvish wrote:so, did this work out for you?
Work fine.

Other trouble: my script remove all comments form fr.txt

This lines will be removed:
https://github.com/freeorion/freeorion/ ... .txt#L3642
https://github.com/freeorion/freeorion/ ... .txt#L8863

PS. Is it issue that value have space after closing triple quote? https://github.com/freeorion/freeorion/ ... t-11227613

Re: fr_stringtable

Posted: Sat May 16, 2015 11:43 pm
by Dilvish
Cjkjvfnby wrote:PS. Is it issue that value have space after closing triple quote?
The parser does not mind if there is whitespace after the closing triple quotes and before the newline.

Re: fr_stringtable

Posted: Tue Jun 02, 2015 6:20 pm
by Ouaz
Hi, it seems there is a problem with the translation of the Peace Proposals.

Although I translated them, the english strings from en.txt are displayed instead of the FR strings:
peace_proposal.PNG
peace_proposal.PNG (8.13 KiB) Viewed 1125 times
peace_translation.PNG
peace_translation.PNG (12.88 KiB) Viewed 1125 times
Last version of FO (June, 1st - 87b435c)

It's the first time I test the Peace Proposal translation in-game, so I don't know if it worked in the previous build.

EDIT: I think it didn't as the first message (difficulty setting) is not translated too (but this is not a big deal)
first_AI_message.PNG
first_AI_message.PNG (12.2 KiB) Viewed 1125 times

Re: fr_stringtable

Posted: Sat Jun 06, 2015 7:34 pm
by Dilvish
Ouaz wrote:Hi, it seems there is a problem with the translation of the Peace Proposals. Although I translated them, the english strings from en.txt are displayed instead of the FR strings:
Right, I hadn't actually tested the AI translations before, sorry. I'm glad that you did now. This resulted from the fact that until now the AI hasn't been reading in the config.xml optionsDB file; any options it needed were simply passed at the command line, and so it wasn't knowing it should use an alternate stringtable. Although I could have just added this to the command line as well, I decided it was time to start having it read the file, and the translations then work fine. It's committed now, so you'll see it in the next weekly build.
I think it didn't as the first message (difficulty setting) is not translated too (but this is not a big deal)
Right, it's intended that the bulk of this message remain in Latin. A small portion regarding aggression level could be translated, but that's mostly for debugging type purposes and I've left it as-is.