Translation guide (Not finished.)

Discuss, plan, and make Translations for FreeOrion
Post Reply
Message
Author
User avatar
Cjkjvfnby
AI Contributor
Posts: 452
Joined: Tue Jun 24, 2014 9:55 pm

Translation guide (Not finished.)

#1 Post by Cjkjvfnby » Mon Feb 02, 2015 10:33 pm

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: Select all

    python parse.py full ru.txt full_ru.txt
  • Do all translation staff with full_ru.txt
  • Convert it back to small file

    Code: Select all

    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: Select all

    [[AVERAGE_INDUSTRY]]
  • links: will be replaces by clickable link to pedia. It is consist of pedia section and title in section see examples:

    Code: Select all

    [[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.
Last edited by Cjkjvfnby on Sun Apr 05, 2015 8:50 am, edited 4 times in total.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Dilvish
AI Lead, Programmer
Posts: 4713
Joined: Sat Sep 22, 2012 6:25 pm

Re: Translation guide (Not finished.)

#2 Post by Dilvish » Mon Feb 02, 2015 10:45 pm

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

User avatar
Cjkjvfnby
AI Contributor
Posts: 452
Joined: Tue Jun 24, 2014 9:55 pm

Re: Translation guide (Not finished.)

#3 Post by Cjkjvfnby » Mon Feb 02, 2015 11:06 pm

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

User avatar
Cjkjvfnby
AI Contributor
Posts: 452
Joined: Tue Jun 24, 2014 9:55 pm

Re: Translation guide (Not finished.)

#4 Post by Cjkjvfnby » Wed Feb 11, 2015 11:16 pm

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

User avatar
Dilvish
AI Lead, Programmer
Posts: 4713
Joined: Sat Sep 22, 2012 6:25 pm

Re: Translation guide (Not finished.)

#5 Post by Dilvish » Thu Apr 09, 2015 2:54 am

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

User avatar
Cjkjvfnby
AI Contributor
Posts: 452
Joined: Tue Jun 24, 2014 9:55 pm

Re: Translation guide (Not finished.)

#6 Post by Cjkjvfnby » Thu Apr 09, 2015 8:08 am

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

User avatar
Dilvish
AI Lead, Programmer
Posts: 4713
Joined: Sat Sep 22, 2012 6:25 pm

Re: Translation guide (Not finished.)

#7 Post by Dilvish » Thu Apr 09, 2015 8:31 am

Cjkjvfnby wrote:It is in best practice section:
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

Post Reply