[openstack-dev] [All] [I18N] compiling translation message catalogs

Akihiro Motoki amotoki at gmail.com
Wed Oct 8 17:06:01 UTC 2014


Thanks James and Dirk,

First of all, sorry for moving this forward so late in the cycle.
I will remove mo files in Juno when importing the latest translations tomorrow.

On Wed, Oct 8, 2014 at 9:51 PM, James Page <james.page at ubuntu.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On 07/10/14 18:00, Julie Pichon wrote:
>> I'm adding a couple of people on cc: with an interest in Ubuntu and
>> SUSE packaging: the Horizon team would love to have your opinion on
>> this (it came up during our weekly meeting).
>>
>> The current consensus is leaning toward removing the mo files for
>> Juno RC2 (in a couple of days) rather than wait until Kilo, as this
>> has been a pain point for (some/all?) distros for a while.
>
> I'm in agreement that option a) is the best way to go; on the
> assumption that compiling the message catalogs won't bring in
> requirements for new dependencies, we can deal with that for rc2 in
> Ubuntu for Juno.

I believe it does not bring any new dependency requirements.

There are several ways to compile message catalogs:
the way Tom suggested below in the launchpad bug [1] is the simplest.
we need to add python-django to Build-Depends in Ubuntu debian/control.

  cd horizon && django-admin compilemessages && cd ..
  cd openstack_dashboard && django-admin compilemessages && cd ..
  # remove unnecessary .po files
  find . -name "django*.po" -exec rm -f '{}' \;

Horizon run_tests.sh script also provides more convenient way to
compile message catalogs.
It prepares virtualenv named ".venv" and compiles message catalogs
using the virtualenv.
The virtualenv is automatically created inside the script, so we don't
need to care Build-Depends,
but run_tests.sh script prompts before creating the virtualenv.... :-(

  ./run_tests.sh --compilemessages

[1] https://bugs.launchpad.net/ubuntu/+source/openstack-dashboard/+bug/1377923

Thanks,
Akihiro

>
>>
>> Thank you,
>>
>> Julie
>>
>> On 01/10/14 17:04, Akihiro Motoki wrote:
>>> Hi,
>>>
>>> To display localized strings, we need to compile translated
>>> message catalogs (PO files) into compiled one (MO files). I would
>>> like to discuss and get a consensus who and when generate
>>> compiled message catalogs. Inputs from packagers are really
>>> appreciated.
>>>
>>> [The current status] * Horizon contains compile message catalogs
>>> in the git repo. (It is just a history and there seems no strong
>>> reason to have compiled one in the repo. There is a bug report on
>>> it.) * Other all projects do not contain compiled message
>>> catalogs and have only PO files.
>>>
>>> [Possible choices] I think there are several options. (there may
>>> be other options) (a) OpenStack does not distribute compiled
>>> message catalogs, and only provides a command (setup.py
>>> integration) to compile message catalogs. Deployers or
>>> distributors need to compile message catalogs. (b) Similar to
>>> (a), but compile message catalogs as a part of "pip install". (c)
>>> OpenStack distributes compiled message catalogs as a part of the
>>> release. (c1) the git repo maintains compiled message catalogs.
>>> (c2) only tarball contains compiled message catalogs
>>>
>>> Note that the current Horizon is (c1) and others are (a).
>>>
>>> [Pros/Cons] (a) It is a simplest way as OpenStack upstream.
>>> Packagers need to compile message catalogs and customize there
>>> scripts. Deployers who install openstack from the source need to
>>> compile them too. (b) It might be a simple approach from users
>>> perspective. However to compile message catalogs during
>>> installation, we need to install required modules (like babel or
>>> django) before running installation (or require them as the
>>> first citizen in setup.py "require"). I don't think it is much
>>> simpler compared to option (a). (c1) Compiled message catalogs
>>> are a kind of binary files and they can be generated from PO
>>> files. There is no need to manage two same data. (c2) OpenStack
>>> is downloaded in several ways (release tarballs is not the only
>>> option), so I don't see much merits that the only tarball
>>> contains compiled message catalogs. A merit is that compiled
>>> message catalogs are available and there is no additional step
>>> users need to do.
>>>
>>> My preference is (a), but would like to know broader opinions
>>> especially from packagers.
>>>
>>> Thanks, Akihiro
>>>
>>> _______________________________________________ OpenStack-dev
>>> mailing list OpenStack-dev at lists.openstack.org
>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>>
>>
>>>
> - --
> James Page
> Ubuntu and Debian Developer
> james.page at ubuntu.com
> jamespage at debian.org
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
>
> iQIcBAEBCAAGBQJUNTNeAAoJEL/srsug59jD2aoQAKAwvKgL0WLn8ZDqX5KGfX2R
> OrTaNcozlNk2OXHgt2nDxOce6yQTbhh4yMJHsymOvgKj4+yOz5L78k9wkRgDmvqX
> b6oiUIGjnQTiVQylT9FRuXicb/I5aoHOr2ki7LCHZ0QuABFCSC7noE/e4KnX2a0g
> baaEC57UZa3aKepQ0PVQP50F5zGF5ux5jlP3oXtKtNjUL9l5bnTmwVgF8ymOYCZd
> Q2fNU3CGUGG9LWwH6WmNJSKEkqGEP8+W7QEcXxT3/JhnVtYIJY/LehfLI8mUGu6o
> geFfZqTYM5qOUrdCjFLJE8ayTE0jtM4VIUAX6xxkZNM4sdXdbH15N5UPqUFBRGsj
> h/P/L/79qSMCt21eQBeaSDEKUvO6egG31tVpk7xTr6PIwRH8t5R+vXjPGjGqc78m
> wdEhO8tMhEangeIbM5fKVKpQ9oqmp7SiI0sFzBS7eKRlB0VMbKCPegaBq8WJDbJq
> /URCXYhgtFKTVCDpR5TUUkmhbHkc9NNcXQudJRnTscjy2VNmWI/QuSg7nHnP218H
> cASWq1kUHvE7grncvaXyr3jPrKnSP2yVSqLsAOBYP5trb3ci9Sdyw+ajsPeLO8cB
> bxEFPETfq5Oz/GEN6ojLr45gbqDuM5MY7pivD/y/4br/cmYtd8R8s/pD0kxn5o6Z
> Www0BJtH1h1b2ChPlo+O
> =CLi/
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



-- 
Akihiro Motoki <amotoki at gmail.com>



More information about the OpenStack-dev mailing list