Translating the v0.12 branch

After 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 nodesktop; 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!

5 responses to “Translating the v0.12 branch”

  1. Marcel says:

    Hi,
    good idea setting everything up for translation early! I actually started right away on a German translation :-) However, I’m having problems testing – my translation seem not to be used, even though the LANGUAGE variable is set. It works when I start a script directly, though…

    Two general suggestions regarding the translation setup:
    * Maybe think of trying to get rid of layout tags in the strings (although that might be difficult in glade stuff, I guess)
    * Please don’t mark the stock icon names as translatable (gtk-ok, gtk-cancel, gtk-…) – a simple search&replace should fix that

    Anyway, keep up the great work – I’m really enjoying the extension already.

  2. Adam Plumb says:

    hi Marcel, those are good suggestions and I will look into the LANGUAGE issue.

    Thanks

  3. Adam Plumb says:

    hi Marcel, we will be releasing a beta RSN (real soon now) that should have the translation issues fixed. Or if you want to test now, you can check out from trunk.

  4. Marcel says:

    Hi Adam,
    I checked out trunk and it now uses my translation without any problems :-) I’ll upload a first version of this translation soon (or should I say: RSN ;-) )

  5. Vadim P. says:

    Would love to have the launchpad translations up and running (mostly because for any given project, 10-50% is translatable just by re-using strings. It’s simply great)