Python 3: fix a call to ugettext()
In Python 3, ugettext() does not exist and gettext() should be used instead. Closes-Bug: 128485 Change-Id: Id9f51f0d630ef0c92fc315253c45d3abba356cd1
This commit is contained in:
parent
d5558265cc
commit
e193d829d1
@ -16,7 +16,11 @@
|
|||||||
import gettext
|
import gettext
|
||||||
|
|
||||||
t = gettext.translation('neutronclient', fallback=True)
|
t = gettext.translation('neutronclient', fallback=True)
|
||||||
|
try:
|
||||||
|
ugettext = t.ugettext # Python 2
|
||||||
|
except AttributeError:
|
||||||
|
ugettext = t.gettext # Python 3
|
||||||
|
|
||||||
|
|
||||||
def _(msg):
|
def _(msg):
|
||||||
return t.ugettext(msg)
|
return ugettext(msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user