Saturday, October 30, 2010

A nicer way to manage translations - infrae.i18nextract

I've been introduced to infrae.i18nextract by thomas_w (that's his IRC nick).

If you're familiar with buildout it's as simple as adding the following to you buildout.
The example below is specific to how I added the i18nextract to manage translation strings on plone.app.themeeditor.

[buildout]
...
parts =
....
translation

...
[translation]
recipe = infrae.i18nextract
packages =
plone.app.themeeditor
output =
${buildout:directory}/src/plone.app.themeeditor/plone/app/themeeditor/locales/
output-package = plone.app.themeeditor
domain = plone.app.themeeditor
extra-paths = ${buildout:directory}../Python-2.6/lib/python2.6

After running bin/buildout the result was two new scripts, the output looks similar to this:


To do the translation extraction run the following:
bin/translation-extract
bin/translation-manage

Doing the translation
To do the translation run bin/translation-extract
The translations will be sent to the defined output directory in this case the locales directory
of the themeeditor add-on, see the output below:

No comments:

Sign up for my upcoming Plone 5 Book & Video tutorials

plone 5 for newbies book and videos