Translating to your own language is pretty easy and intuitive for python coders. But here's a little guide for those not familiar with the programming language.
Add a new language
- Make sure you have the latest version of PyCaptain, by Downloading from SVN
- You must first choose the short name for the language. For this tutorial we'll use fr for French.
- Copy the file __template.py, and name it fr.py.
- Open the new file in a text editor and fill the variables as follows:
- In class Fr( Language ):, put instead of Fr the short name capitalized.
- In name = "fr", put instead of fr the short name lowered.
- In title = u"Français", put instead of Français the full language name.
- In author = u"Author", put instead of Author your own name. If modifying someone else's file, you can write multiple names.
- Modify the lines following, self.texts = {, where on the left is the english (and original) version and on the right your translation.
- Keep an eye on the terminal while executing the game, it will notify you if any string isn't translated. You can add it to the list in the same way: "English string": u"Your language equivalent",
- Once you've done all or most of the translation (it's normal if you didn't catch every single string in the first version). Send a copy to translation@… or upload it on the forum at http://forum.xymus.net/.
Notes
The difference between "" strings and u"" string is the encoding. u"" strings, actually unicode strings, are for languages with non-english characters such as é, ß, etc. It will be needed by most of the translation.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/logo.png)