How to translate SoL into another language
Version 1.0 comes with English and Italian messages and manuals. Adding other languages is quite easy: all the documentation, as well as all the localizable messages, are contained in simple text files.
Manual
The manuals sources are distribuited in the directory docs/, that contains several files with a .rst extension, that stands for reStructuredText, a simple text only format that may be easily converted into either HTML or PDF.
How to contribute another language manual
Currently, the easiest way is by asking me a copy of the manuals: I will send you a ZIP file containing all the sources that you can use as a start. Then, using whatever editor you prefer, write your translation and send it to me.
Messages
All the messages used by SoL are collected into a single file, called the catalog. Its format is very simple: with the exception of the text at the beginning of the file that contains some meta information about the content, there are two lines of text for each translatable message, one for the original English version (called msgid) followed by another (called msgstr) containing its nationalized translation.
For example, in the italian catalog you can see:
#: sol/controllers/data.py:357 msgid "Number of seasons organized by the club." msgstr "Numero di stagioni organizzate da questo club."
where the line beginning with a "#" is a comment that you can ignore, the msgid line is the original english message, and msgstr is the italian translation of that string.
The original message may contains variables introduced by a percent sign ("%"), a kind of parameters that should be kept as is, like:
#: sol/lib/printouts.py:343 #, python-format msgid "Ranking by nationality after turn %d" msgstr "Classifica per nazionalità al %d° turno"
where the "%d" will be replaced by the turn number at runtime. When there are more than one variables they are usually referred by name, like:
#: sol/model/player.py:77 #, python-format msgid "%(lastname)s %(firstname)s" msgstr "%(firstname)s %(lastname)s"
where you can see the two variables are swapped, following the common italian rule to put the first name first.
Yet another form is used to handle the singular/plural case, like:
#: sol/controllers/data.py:270 #, python-format msgid "Successfully loaded %(num)d tourney from %(fname)s" msgid_plural "Successfully loaded %(num)d tourneys from %(fname)s" msgstr[0] "Caricato con successo %(num)d torneo da %(fname)s" msgstr[1] "Caricati con successo %(num)d tornei da %(fname)s"
where msgstr[0] contains the singular form and msgstr[1] the plural form.
How to contribute another language messages
Start by copying the original english catalog onto your computer.
Then using either your preferred text editor or a specialized one such as poedit translate all msgid messages into their msgstr counterparts.
When you are done, send the result to me. That's it, really!