Cleanup: resolve static analyzer warnings in bl_i18n_utils
authorCampbell Barton <ideasman42@gmail.com>
Thu, 30 Jan 2020 00:45:36 +0000 (11:45 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 30 Jan 2020 00:48:26 +0000 (11:48 +1100)
Reported in T73504

release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
release/scripts/modules/bl_i18n_utils/utils.py

index 4aaa30a0508fcf8bf43a4130058647dbf26581b1..2034b2ac55cefc96a5911b5f31fd430fadb99846 100644 (file)
@@ -599,8 +599,8 @@ def dump_py_messages_from_files(msgs, reports, files, settings):
     # We manually add funcs from bpy.app.translations
     for func_id, func_ids in pgettext_variants:
         func_translate_args[func_id] = pgettext_variants_args
-        for func_id in func_ids:
-            func_translate_args[func_id] = pgettext_variants_args
+        for sub_func_id in func_ids:
+            func_translate_args[sub_func_id] = pgettext_variants_args
     # print(func_translate_args)
 
     # Break recursive nodes look up on some kind of nodes.
index 2cca41711936c060ba19d69a90980d845b9a8c8c..7c22a86d6871efc90abc5835be8e3e2f5a861961 100644 (file)
@@ -1413,8 +1413,8 @@ class I18n:
                 "#       and edit the translations by hand.",
                 "#       Just carefully respect the format of the tuple!",
                 "",
-                "# Tuple of tuples "
-                "((msgctxt, msgid), (sources, gen_comments), (lang, translation, (is_fuzzy, comments)), ...)",
+                "# Tuple of tuples:",
+                "((msgctxt, msgid), (sources, gen_comments), (lang, translation, (is_fuzzy, comments)), ...)",
                 "translations_tuple = (",
             ]
             # First gather all keys (msgctxt, msgid) - theoretically, all translations should share the same, but...