Make i18n log translation functions as no-op

The i18n team has decided not to translate the logs because it seems
like it not very useful; operators prefer to have them in English so
that they can search for those strings on the internet.

Removing usage requires a lot of effort to review, so take no-op on that
for now and just make sure we do not add more of them.[1]

[1] http://eavesdrop.openstack.org/meetings/glance/2017/glance.2017-06-08-14.00.log.html#l-79

Change-Id: I2a7e56c3418f8cdb0394b961e1e07346a691de98
Closes-Bug: #1674546
This commit is contained in:
Ngo Quoc Cuong
2017-06-21 16:14:15 +07:00
parent 0325eaf2ac
commit 80187855ca
2 changed files with 17 additions and 21 deletions
-12
View File
@@ -41,18 +41,6 @@ asse_equal_end_with_none_re = re.compile(
asse_equal_start_with_none_re = re.compile(
r"(.)*assertEqual\(None, (\w|\.|\'|\"|\[|\])+\)")
unicode_func_re = re.compile(r"(\s|\W|^)unicode\(")
log_translation = re.compile(
r"(.)*LOG\.(audit)\(\s*('|\")")
log_translation_info = re.compile(
r"(.)*LOG\.(info)\(\s*(_\(|'|\")")
log_translation_exception = re.compile(
r"(.)*LOG\.(exception)\(\s*(_\(|'|\")")
log_translation_error = re.compile(
r"(.)*LOG\.(error)\(\s*(_\(|'|\")")
log_translation_critical = re.compile(
r"(.)*LOG\.(critical)\(\s*(_\(|'|\")")
log_translation_warning = re.compile(
r"(.)*LOG\.(warning)\(\s*(_\(|'|\")")
dict_constructor_with_list_copy_re = re.compile(r".*\bdict\((\[)?(\(|\[)")
+17 -9
View File
@@ -20,12 +20,20 @@ _translators = TranslatorFactory(domain='glance')
# The primary translation function using the well-known name "_"
_ = _translators.primary
# Translators for log levels.
#
# The abbreviated names are meant to reflect the usual use of a short
# name like '_'. The "L" is for "log" and the other letter comes from
# the level.
_LI = _translators.log_info
_LW = _translators.log_warning
_LE = _translators.log_error
_LC = _translators.log_critical
# i18n log translation functions are deprecated. While removing the invocations
# requires a lot of reviewing effort, we decide to make it as no-op functions.
def _LI(msg):
return msg
def _LW(msg):
return msg
def _LE(msg):
return msg
def _LC(msg):
return msg