Retire gettext.install which installs _() as builtin namespace

Bug #1520094 reported by Akihiro Motoki
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Akihiro Motoki

Bug Description

As oslo.i18n document [1] suggests, we need to replace _() in the python builtin namespaces with _ defined in _i18n.py in each module. Sharing _() in the builtin namespaces prevents us from looking up per-module translation catalogs because it forces all subprojects to use "neutron" domain.

It is required to support per-project message catalog.

Required actions:

- Introduce _i18.py with a project specific domain as suggested by oslo.i18n.
- Change all related project consumes _() from their own _i18n.py
- Remove gettext.install from neutron/__init__.py.

I will move forward this bug, but anyone can help me.
There are many projects under neutron stadium.

[1] http://docs.openstack.org/developer/oslo.i18n/usage.html

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

It seems better to start this work after bug 1519493 is completed.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/250287

Changed in neutron:
importance: Undecided → Medium
status: New → Confirmed
tags: added: oslo
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
assignee: Akihiro Motoki (amotoki) → Ihar Hrachyshka (ihar-hrachyshka)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in neutron:
assignee: Ihar Hrachyshka (ihar-hrachyshka) → Akihiro Motoki (amotoki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in neutron:
assignee: Akihiro Motoki (amotoki) → Ihar Hrachyshka (ihar-hrachyshka)
Changed in neutron:
assignee: Ihar Hrachyshka (ihar-hrachyshka) → Akihiro Motoki (amotoki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Akihiro Motoki (<email address hidden>) on branch: master
Review: https://review.openstack.org/250991
Reason: This change was merged into the depending patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

Reviewed: https://review.openstack.org/250287
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=bd36baf3ecfa10c7b8e1e012980feacc605d57e4
Submitter: Jenkins
Branch: master

commit bd36baf3ecfa10c7b8e1e012980feacc605d57e4
Author: Akihiro Motoki <email address hidden>
Date: Thu Nov 26 19:32:32 2015 +0900

    I18n related guideline for subprojects

    Related-Bug: #1519493
    Related-Bug: #1520094
    Change-Id: I183c1f2226ee7aef96b958d888ca3b7a3f9e9a2e

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

Reviewed: https://review.openstack.org/250990
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=2d8632e412c6187187d44ee169048bf9d4c8c106
Submitter: Jenkins
Branch: master

commit 2d8632e412c6187187d44ee169048bf9d4c8c106
Author: Akihiro Motoki <email address hidden>
Date: Fri Nov 27 03:48:03 2015 +0900

    Use _ from neutron._i18n

    Partial-Bug: #1520094
    Change-Id: I874a4aa1d71d1f7034a1ff0b7450b419ef5c6864

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/250946
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=51d4d858ac4a0a2a8832fab9107fbb5e1d8d7771
Submitter: Jenkins
Branch: master

commit 51d4d858ac4a0a2a8832fab9107fbb5e1d8d7771
Author: Ihar Hrachyshka <email address hidden>
Date: Fri Nov 27 21:30:35 2015 +0100

    Deprecate _ builtin translation function

    This function is discouraged for usage as per oslo.i18n guidelines [1],
    so we should deprecate and remove it.

    [1] http://docs.openstack.org/developer/oslo.i18n/usage.html

    Change-Id: I848ee1dbd16a23c4db42df4690bf139bd769f3e8
    Partial-Bug: #1520094

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

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

Changed in neutron:
assignee: Akihiro Motoki (amotoki) → SHI Peiqi (uestc-shi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by SHIPeiqi (<email address hidden>) on branch: master
Review: https://review.openstack.org/314930

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in neutron:
assignee: SHI Peiqi (uestc-shi) → Akihiro Motoki (amotoki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by SHIPeiqi (<email address hidden>) on branch: master
Review: https://review.openstack.org/320765

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

Reviewed: https://review.openstack.org/320772
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=19c5ec76464568252f8ca0eae28849b2797111c3
Submitter: Jenkins
Branch: master

commit 19c5ec76464568252f8ca0eae28849b2797111c3
Author: Akihiro Motoki <email address hidden>
Date: Wed May 25 13:12:12 2016 +0900

    Drop neutron/i18n.py in favor of neutron/_i18n.py

    The hacking rule already ensures everyone uses neutron._i18n.
    Now we can drop neutron.i18n.

    Closes-Bug: #1520094
    Change-Id: I1a415c23fd1db103742e8f3a92a3dd26c7252233

Changed in neutron:
status: In Progress → Fix Released
tags: added: neutron-proactive-backport-potential
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron 9.0.0.0b2

This issue was fixed in the openstack/neutron 9.0.0.0b2 development milestone.

tags: removed: neutron-proactive-backport-potential
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.