FreeOrion

Forums for the FreeOrion project
It is currently Tue Dec 12, 2017 9:51 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Mon Feb 02, 2015 10:33 pm 
Offline
AI Contributor
User avatar

Joined: Tue Jun 24, 2014 9:55 pm
Posts: 444
I suggest to use next workflow to translation:

  • Download and install python 2.7 if you don't have one.
  • Download script https://raw.githubusercontent.com/Cjkjv ... s/parse.py
  • Google how to run python script with arguments on you system (usually you need open console and paste text from script example)
  • Create full string file with all tokens present in en.txt (I use ru.txt as example you need to choose your language)
    Code:
    python parse.py full ru.txt full_ru.txt
  • Do all translation staff with full_ru.txt
  • Convert it back to small file
    Code:
    python  parse.py small full_ru.txt ru.txt
  • Post new file or diff for you file and trunk to forum.

Terms:
  • key: ingame key for object. It is written in capital letters separated with underscore. (ENVIRONMENTAL_PREFERENCES). Values can have references to other value by its key. Keys should never be translated.
  • value: text that will be shown in GUI instead of key. (Environmental Preferences:). Value can be single line or multi line. Multi line values should be wrapped to triple single quotes: ('''hello it is wrapped value'''). There is not exact rule about spaces at the end of value, this should be done according to current content.
  • reference: will be replaced by text stored by key. Link to missed key it prohibited
    Code:
    [[AVERAGE_INDUSTRY]]
  • links: will be replaces by clickable link to pedia. It is consist of pedia section and title in section see examples:
    Code:
    [[encyclopedia ORGANIC_SPECIES_TITLE]]
    [[tech LRN_XENOARCH]]
    [[buildingtype BLD_CONC_CAMP]]
    [[special ANCIENT_RUINS_SPECIAL]]
    [[shippart GT_TROOP_POD]]
    [[shiphull SH_NANOROBOTIC]]
    [[predefinedshipdesign SM_KRILL_1]]

Best practices:
  • In text file you should have only translated items. Leaving English text in translation is bad. en.txt is changing constantly and values will be desynced. Files already have some desynced values, feel free to remove them.
  • If value ends with space wrap it to triple quotes. This will allow to notice it.
  • Use reference and links there it is possible. This will reduce amount of text to translate.
  • Make translation look uniform in game.

Text tags:
Here is description of possible tags: https://github.com/freeorion/freeorion/ ... ont.h#L108
I check them in message window and in pedia. I don't know does it works in other places.

upd: Here you can find full files https://github.com/Cjkjvfnby/freeorion/ ... ringtables I will update it time to time or by request.

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


Last edited by Cjkjvfnby on Sun Apr 05, 2015 8:50 am, edited 4 times in total.

Top
 Profile  
 
PostPosted: Mon Feb 02, 2015 10:45 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
Thanks for the writeup Cjkjvfnby. To make it still a little easier on folks could you add an extra detail in the download script step, letting people know to use the 'Raw' button on the righthand side of the page you linked to, in order to get the plain python file. Perhaps also note that the install python 2.7 step is only if they don't already have it. If they are playing FO they probably DO have it, but may not be aware of that.

_________________
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  
 
PostPosted: Mon Feb 02, 2015 11:06 pm 
Offline
AI Contributor
User avatar

Joined: Tue Jun 24, 2014 9:55 pm
Posts: 444
Dilvish wrote:
Thanks for the writeup Cjkjvfnby. To make it still a little easier on folks could you add an extra detail in the download script step, letting people know to use the 'Raw' button on the righthand side of the page you linked to, in order to get the plain python file. Perhaps also note that the install python 2.7 step is only if they don't already have it. If they are playing FO they probably DO have it, but may not be aware of that.


Done.

_________________
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  
 
PostPosted: Wed Feb 11, 2015 11:16 pm 
Offline
AI Contributor
User avatar

Joined: Tue Jun 24, 2014 9:55 pm
Posts: 444
I updated full text files in my repo. https://github.com/Cjkjvfnby/freeorion/ ... ringtables

As side effect of this you can check what was changed since last update.

To get list of commits you need click on file and press history. https://github.com/freeorion/freeorion/ ... les/de.txt

_________________
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  
 
PostPosted: Thu Apr 09, 2015 2:54 am 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
CJ, in one of your recent Pull Requests, you reference this thread and do some stringtable cleanup, including removing any double blank lines. There are a number of places where the extra whitespace seems to me to improve organization (plus, I don't see that rule above), and so I'd like to discuss it a bit more and see other people's opinions.

_________________
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  
 
PostPosted: Thu Apr 09, 2015 8:08 am 
Offline
AI Contributor
User avatar

Joined: Tue Jun 24, 2014 9:55 pm
Posts: 444
Dilvish wrote:
CJ, in one of your recent Pull Requests, you reference this thread and do some stringtable cleanup, including removing any double blank lines.
No any only between seqtions. I will check late if it is not true.

Quote:
There are a number of places where the extra whitespace seems to me to improve organization (plus, I don't see that rule above), and so I'd like to discuss it a bit more and see other people's opinions.


It is in best practice section:
Quote:
If value ends with space wrap it to triple quotes. This will allow to notice 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  
 
PostPosted: Thu Apr 09, 2015 8:31 am 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
Cjkjvfnby wrote:
It is in best practice section:
Quote:
If value ends with space wrap it to triple quotes. This will allow to notice it.
This doesn't really seem applicable-- if a value did have any blank lines within it (whether single or double), I believe it would already have to be enclosed in triple quotes. But that's not really what I was referring to anyway. I hadn't noticed any values where I wanted to preserve double blank lines within them; I was responding to your description in the PR which sounded like it meant removing all double blank lines. If you are going to leave in ones that separate sections, then it all sounds fine to me.

_________________
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  [ 7 posts ] 

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