Code review comment for lp:~songofacandy/bzr/i18n

Revision history for this message
David Planella (dpm) wrote :

Hi Inada,

First of all, thanks for the excellent work in making bzr speak everyone's language :)

I've been asked to provide some feedback and answer any questions, so I'll focus on those rather than reviewing the actual code.

Here are a couple of things that caught my eye:

Standard i18n Tools Integration
-------------------------------

It strikes me that you seem to rewrite much of the functionality provided by gettext and other tools already. Is there a reason why you are not using something like intltool and python-distutils-extra (e.g. using the build_i18n command from p-d-e instead of writing extras/build_mo.py), which are used by most OSS Python projects implementing i18n support? Is it because of platform compatibility issues?

Why do you use the gettext() call directly instead of the more usual _()?

Why is extras/bzrgettext needed? The file is very well documented, but I'm not sure I can follow why standard gettext cannot be used. May I ask you to ellaborate on this?

The same with bzrlib/utextwrap.py, what's its purpose?

Note that I'm not arguing that you are doing anything wrong, I'm just wondering if we could make use of more standard practices in the internationalization world.

Integration with Launchpad
--------------------------

It just makes sense to have bzr use all the Launchpad integration features regarding translations. For this, at the code level the only thing that is needed is to:

* Have a tool in the build system that can extract translatable strings from the code and merge them into a bzr.pot template file
* Have the right source tree layout:

po/bzr.pot
po/jp.po
po/de.po
po/pt_BR.po
...

Where translations are in the same directory as the .pot file and are named with iso 639 2-letter or 3-letter codes, with an optional country code name.

The rest can be done at the Launchpad project level and it's up to the bzr project admins:

* Set up the translation focus and permissions: my recommendation would be Restricted or Structured, assigned to the Launchpad Translators group
* Set up automatic translation imports, so that on every commit of the bzr.pot file translations are exposed in Launchpad
* Set up automatic exports, so that translations can be exported to a branch of your choice automatically (currently daily). My recommendation would be to use the same branch for imports and exports, so that the manual intervention in managing translations is reduced to 0 in this aspect.

« Back to merge proposal