Translating the v0.12 branch
Posted in Miscellaneous on February 25th, 2009 by Adam Plumb – 5 CommentsAfter initially writing off localization capabilities for v0.12, preferring to wait until v0.13 for that, I later changed my mind and spent some time figuring out how to do it, implementing it, and writing up the documentation for others.
Translating NautilusSvn is a fairly simple process. We provide a template file that has the English text from our program and a space for the translated text that you will write. The template file is located at branches/v0.12/nautilussvn/po/NautilusSvn.pot in our svn repository. In order to start your own translation, you will first need to install the gettext and intltool utilities, which you can generally get from your linux distribution. You may also want to install poedit, which is a popular and very useful GUI translation tool.
Once you’ve got your environment set up correctly, you can generate the actual translation file you’ll be using. First, figure out which language and locale you’ll be translating NautilusSvn to. For example, en_US is English/United States (the default), and en_CA is English/Canada. For a list of locale codes, go here. And for a list of country codes, go here.
Once you’ve figured out your language and locale, you can begin. For the purposes of this tutorial, I will set up a translation for en_CA (Canadian English).
$ cd /path/to/nautilussvn
$ msginit –input=po/NautilusSvn.pot –locale=en_CA
$ mv en_CA.po po/en_CA.po
The translation file you want to modifiy is now in the po folder, and you can begin your translation! You may use poedit or another GUI tool or edit the text file by hand. Once you’ve finished, type:
$ mkdir -p locale/en_CA/LC_MESSAGES
$ msgfmt –output-file=locale/en_CA/LC_MESSAGES/NautilusSvn.mo po/en_CA.po
And you’re done! If you want NautilusSvn to use your changes, you’ll want to export your language (en_CA) to the LANGUAGE environment variable and restart nautilus and NautilusSvn:
$ export LANGUAGE=en_CA
$ nautilus –q; pgrep –f service.py | xargs kill; nautilus —no–desktop; pgrep –f service.py | xargs kill
When your translation is all finished, open a new issue in our Issue Tracker and attach the NautilusSvn.mo and .po files that you created. We will immediately update our development trunk, and it will be included in the next official release.
Launchpad Translations
We’re currently trying to get our project set up on Launchpad in order to coordinate translations from there, but it isn’t quite set up yet. We will make an announcement on this development blog and also our mailing list when it is completely set up.
String Freeze
NautilusSvn is currently in the “ALPHA” stage of release and we have not yet reached “string freeze” (the point at which we will not change the English strings in the program). Strings won’t be frozen until we reach the “BETA” release, which is scheduled to happen next week (but it may not if there is a delay). You can start translating now if you’d like, but please be aware of any changes that happen to the NautilusSvn.pot template file until the beta.
Happy Translating!