[OpenStack-Infra] Translation setup challenges

Doug Hellmann doug at doughellmann.com
Tue Dec 29 13:32:52 UTC 2015


Excerpts from Andreas Jaeger's message of 2015-12-28 22:28:46 +0100:
> Reading some IRC backlog and an incoming review with a new suggestion on 
> how to do translations in the project, I decided to write some problems 
> our current scripts have, together with questions and proposals. With 
> the growing big tent and the automatic way to setup translations, we get 
> more repos requesting translations - and more support requests.
> 
> Please read the description below and tell me what's wrong,what's 
> missing, where you disagree - and how to move forward.
> 
> thanks,
> Andreas
> 
> Setting up translations for new projects currently has the following
> challenges:
> 
> a) For "python" repositories, we expect that the locale file is
>     located at $repo/locale/$repo.pot - without any change possible.
>     This leads to python-novaclient/locale/python-novaclient.pot and
>     oslo.log/locale/oslo.log.i18n - in both cases the python module has
>     a different name, novaclient and oslo_log.
> 
>     Currently everybody makes it wrong and we have to help them using
>     the proper file names.
> 
>     Proposal:
>     * Simplify location to use $modulename/locale/$modulename
>       Can we determine modulename easily from the name in setup.cfg like
>       in jenkins/scripts/pypi-extract-name.py?
> 
> b) For dashboard repos, there's no common entry point yet and some are
>     even setup like "python" repositories (designate-dashboard).
> 
>     There's also no naming pattern on how to name files and everybody
>     does it differently.
> 
>     Currently the django component is called djangjo.pot, the
>     javascript one djangojs.pot.
> 
>     Question: Do we really need to do it this way or can we change it?
> 
>     We should have a single entrypoint for projects and a standard way
>     to call them.
> 
>     Proposal: Define standard tox environement "extractmessages", it
>     places translation files in (if django/djangojs are really the best
>     names, I prefer to change them):
>     * $modulename/locale/django.pot
>     * $modulename/locale/djangojs.pot
> 
>     Can we determine modulename easily from the name in setup.cfg like
>     in jenkins/scripts/pypi-extract-name.py? At least
>     django_openstack_auth is setup differently..
> 
> c) Projects currently need to add the pot file initially, our scripts
>     fail if the directory does not exist.
> 
>     Proposal: Make scripts robust so that they work even without
>     initial pot file.

Having the scripts create the file with the right name seems like it
would solve (a) as well.

For (b), we've had some good luck with getting release-related
things right by setting up dependent changes to make it easier for
us to review the content going into the project repository before
a change goes into the control repo. For example, release requests
must have a related change to the global requirements list that
depends on the release request.  This lets us ensure that the
requirements update is/will be correct before creating the release.
We used a similar process to remove the version settings from
setup.cfg in projects for the first milestone tags.

You could require that patches to add translation jobs have a comment
linking to a change within the target project that adds the required
settings to tox.ini and whatever other config files can't be
auto-generated. If the patch to add those files depends on the
project-config patch, you can ensure that the files are present
with the correct names before enabling the job.

Doug



More information about the OpenStack-Infra mailing list