Some modules use gettext directly instead of using oslo.i18n (or openstack.common.gettextutils)

Bug #1382476 reported by Akihiro Motoki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-neutronclient
Fix Released
Low
Hideki Saito

Bug Description

neutronclient/common/__init__.py has the following code and some modules use _ from this module.
The majority is to use oslo.i18n (or openstack.common.gettextutils).
Mixed usage of _ can be a problem on localization potentially.

import gettext

t = gettext.translation('neutronclient', fallback=True)
try:
    ugettext = t.ugettext # Python 2
except AttributeError:
    ugettext = t.gettext # Python 3

def _(msg):
    return ugettext(msg)

Tags: i18n
Hideki Saito (saitou)
Changed in python-neutronclient:
assignee: nobody → Hideki Saito (saitou)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-neutronclient (master)

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

Changed in python-neutronclient:
status: New → In Progress
Kyle Mestery (mestery)
Changed in python-neutronclient:
milestone: none → 2.3.9
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-neutronclient (master)

Reviewed: https://review.openstack.org/133342
Committed: https://git.openstack.org/cgit/openstack/python-neutronclient/commit/?id=02c108fd0010798927f144b1dfee9f4ec1947f41
Submitter: Jenkins
Branch: master

commit 02c108fd0010798927f144b1dfee9f4ec1947f41
Author: Hideki Saito <email address hidden>
Date: Sat Nov 8 21:13:45 2014 +0900

    Fix mixed usage of _

    * all modules are using function of _ from oslo.i18n
    * remove the definition of _ from openstack.common.__init__.py for safety

    Change-Id: Ice2f8be1190fd13e8991a8c7fa55ca636341e875
    Closes-Bug: #1382476

Changed in python-neutronclient:
status: In Progress → Fix Committed
Kyle Mestery (mestery)
Changed in python-neutronclient:
milestone: 2.3.9 → 2.3.10
Akihiro Motoki (amotoki)
Changed in python-neutronclient:
status: Fix Committed → 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.