FreeOrion

Forums for the FreeOrion project
It is currently Sun Dec 17, 2017 5:46 pm

All times are UTC




Post new topic Reply to topic  [ 252 posts ]  Go to page Previous  1 ... 13, 14, 15, 16, 17
Author Message
 Post subject: Re: fr_stringtable
PostPosted: Tue Apr 21, 2015 5:50 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
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.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: fr_stringtable
PostPosted: Mon May 04, 2015 8:37 pm 
Offline
AI Contributor
User avatar

Joined: Tue Jun 24, 2014 9:55 pm
Posts: 444
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.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: fr_stringtable
PostPosted: Mon May 04, 2015 9:52 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
Cjkjvfnby wrote:
...On updating file I copy header as is...
Could you explain this part more?

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: fr_stringtable
PostPosted: Tue May 05, 2015 5:47 am 
Offline
AI Contributor
User avatar

Joined: Tue Jun 24, 2014 9:55 pm
Posts: 444
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:
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.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: fr_stringtable
PostPosted: Tue May 05, 2015 6:09 am 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
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.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: fr_stringtable
PostPosted: Tue May 05, 2015 2:11 pm 
Offline
AI Contributor
User avatar

Joined: Tue Jun 24, 2014 9:55 pm
Posts: 444
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

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: fr_stringtable
PostPosted: Tue May 05, 2015 3:11 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
So, it looks to me like the beginning of make_copy() considers
Code:
#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:
#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:
#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)

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: fr_stringtable
PostPosted: Fri May 15, 2015 5:25 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
so, did this work out for you?

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: fr_stringtable
PostPosted: Sat May 16, 2015 9:27 pm 
Offline
AI Contributor
User avatar

Joined: Tue Jun 24, 2014 9:55 pm
Posts: 444
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

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: fr_stringtable
PostPosted: Sat May 16, 2015 11:43 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
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.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
 Post subject: Re: fr_stringtable
PostPosted: Tue Jun 02, 2015 6:20 pm 
Offline
Dyson Forest
User avatar

Joined: Wed Aug 13, 2014 7:21 pm
Posts: 214
Location: France
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:

Attachment:
peace_proposal.PNG
peace_proposal.PNG [ 8.13 KiB | Viewed 921 times ]


Attachment:
peace_translation.PNG
peace_translation.PNG [ 12.88 KiB | Viewed 921 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)

Attachment:
first_AI_message.PNG
first_AI_message.PNG [ 12.2 KiB | Viewed 921 times ]

_________________
I release every updated file under the CC-BY-SA 3.0 license.


Top
 Profile  
 
 Post subject: Re: fr_stringtable
PostPosted: Sat Jun 06, 2015 7:34 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
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.

Quote:
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.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 252 posts ]  Go to page Previous  1 ... 13, 14, 15, 16, 17

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group