PO makemessage ignore pattern does not work with Django 1.6

Bug #1295920 reported by Akihiro Motoki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Akihiro Motoki
openstack i18n
Fix Released
Undecided
Unassigned

Bug Description

In run_tests.sh --makemessages, files under openstack/common are excluded because they are not actually used in OpenStack dashboard and there is no need to translate at the moment. "--ignore=openstack/common" option to manage.py makemessages is used to exclude these files.

However, after the default version of Django is switched to 1.6, "--ignore" option works does not work as previously it does and strings from openstack/common are included in translation strings.

The reason of this is that ignore pattern is checked against basename of each file/directory in Django 1.6.
We need to specify basename in ignore patterns: i.e. --ignore=openstack.
At now we don't have directories named as "openstack" other than openstack_dashboard/openstack/common, so it works.

I am not sure it is a bug or spec change in Django 1.6, but translation deadline for Icehosue is approaching and we need work around ASAP.

Tags: i18n
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/82270

Changed in horizon:
status: New → In Progress
Revision history for this message
Ana Krivokapić (akrivoka) wrote :

This seems to be a bug in Django, the original ignore pattern should work fine.

I opened an upstream Django ticket here: https://code.djangoproject.com/ticket/22336.

For the time being, we'll have to work around it.

Revision history for this message
Akihiro Motoki (amotoki) wrote :

Ana, really thanks.

In Horizon meeting today (yesterday?), we agreed that openstack/common should not be ignored in general.
Once Juno cycle starts, we will remove --ignore option after removing unused openstack/common modules.
We still need to keep ignore option for Icehouse translations (to avoid several number of new strings).

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/82270
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=a5a0544ee24e634e53560ea65abc108be003406c
Submitter: Jenkins
Branch: master

commit a5a0544ee24e634e53560ea65abc108be003406c
Author: Akihiro Motoki <email address hidden>
Date: Sat Mar 22 10:55:14 2014 +0900

    Make makemessage ignore option work with Django 1.6

    In run_tests.sh --makemessages, files under openstack/common are excluded
    and "--ignore=openstack/common" option to manage.py makemessages is used
    to exclude these files. However, after the default version of Django is
    switched to 1.6, "--ignore" option works does not work as previously it
    does and strings from openstack/common are included in translation strings.

    The reason of this is that ignore pattern is checked against basename of
    each file/directory in Django 1.6. We need to specify basename in ignore
    patterns: i.e. --ignore=openstack. At now we don't have directories named
    as "openstack" other than openstack_dashboard/openstack/common, so it works.

    This works both with Django 1.6 and 1.5.

    Change-Id: I547be679c2f4ce49bd439b8f629e8720eebdb896
    Closes-Bug: #1295920

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-rc1 → 2014.1
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Horizon fix was released more than a year ago.
there is nothing to do in openstack-i18n side.

Changed in openstack-i18n:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.