From 51d4d858ac4a0a2a8832fab9107fbb5e1d8d7771 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Fri, 27 Nov 2015 21:30:35 +0100 Subject: [PATCH] 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 --- neutron/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/neutron/__init__.py b/neutron/__init__.py index fa7a241e5..a79649770 100644 --- a/neutron/__init__.py +++ b/neutron/__init__.py @@ -14,6 +14,8 @@ # under the License. import gettext + +from debtcollector import removals import six @@ -21,3 +23,8 @@ if six.PY2: gettext.install('neutron', unicode=1) else: gettext.install('neutron') + + +six.moves.builtins.__dict__['_'] = removals.remove( + message='Builtin _ translation function is deprecated in OpenStack; ' + 'use the function from _i18n module for your project.')(_) -- 2.45.2