diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-10-19 18:28:32 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-10-19 18:28:32 +0400 |
commit | 4edffbf54fad68f8be051c76343573deb20fce5c (patch) | |
tree | 7b0e2ecac52c58cf0143174d4122313b47e116cf /release/scripts/modules/bl_i18n_utils/utils.py | |
parent | e783611098550856bd1883e44690552fe1f1326e (diff) |
More complete handling of printf formatting in msgid/msgstr checks.
(That commit, r60813, should never have been done to 2.69 branch, will revert it there, sorry :/ ).
Diffstat (limited to 'release/scripts/modules/bl_i18n_utils/utils.py')
-rw-r--r-- | release/scripts/modules/bl_i18n_utils/utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py index bef7de00126..feefd14fd28 100644 --- a/release/scripts/modules/bl_i18n_utils/utils.py +++ b/release/scripts/modules/bl_i18n_utils/utils.py @@ -446,10 +446,10 @@ class I18nMessages: """ ret = [] default_context = self.settings.DEFAULT_CONTEXT - _format = re.compile("%[.0-9]*[tslfd]").findall + _format = re.compile(self.settings.CHECK_PRINTF_FORMAT).findall done_keys = set() - tmp = {} rem = set() + tmp = {} for key, msg in self.msgs.items(): msgctxt, msgid, msgstr = msg.msgctxt, msg.msgid, msg.msgstr real_key = (msgctxt or default_context, msgid) @@ -464,7 +464,7 @@ class I18nMessages: done_keys.add(key) if '%' in msgid and msgstr and _format(msgid) != _format(msgstr): if not msg.is_fuzzy: - ret.append("Error! msg's format entities are not matched in msgid and msgstr ({} / {})" + ret.append("Error! msg's format entities are not matched in msgid and msgstr ({} / \"{}\")" "".format(real_key, msgstr)) if fix: msg.msgstr = "" |