diff options
-rw-r--r-- | release/scripts/modules/bl_i18n_utils/bl_extract_messages.py | 7 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py index 21c0a943984..bda2a15f44a 100644 --- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py +++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py @@ -503,6 +503,7 @@ def dump_py_messages_from_files(msgs, reports, files, settings): ), "msgid": ((("msgctxt",), _ctxt_to_ctxt), ), + "message": (), } context_kw_set = {} @@ -538,6 +539,12 @@ def dump_py_messages_from_files(msgs, reports, files, settings): for msgid, msgctxts in context_kw_set.items(): if arg_kw in msgctxts: func_translate_args[func_id][msgid][1][arg_kw] = arg_pos + # The report() func of operators. + for func_id, func in bpy.types.Operator.bl_rna.functions.items(): + # check it has one or more arguments as defined in translate_kw + for arg_pos, (arg_kw, arg) in enumerate(func.parameters.items()): + if ((arg_kw in translate_kw) and (not arg.is_output) and (arg.type == 'STRING')): + func_translate_args.setdefault(func_id, {})[arg_kw] = (arg_pos, {}) # We manually add funcs from bpy.app.translations for func_id, func_ids in pgettext_variants: func_translate_args[func_id] = pgettext_variants_args diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index b2f094e7ccc..a7085e51bd3 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -29,6 +29,8 @@ from bpy.props import (StringProperty, from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear +from bpy.app.translations import pgettext_tip as tip_ + class MESH_OT_delete_edgeloop(Operator): """Delete an edge loop by merging the faces on each side """ \ @@ -1838,7 +1840,7 @@ class WM_OT_addon_install(Operator): bpy.utils.refresh_script_paths() # print message - msg = "Modules Installed from %r into %r (%s)" % (pyfile, path_addons, ", ".join(sorted(addons_new))) + msg = tip_("Modules Installed from %r into %r (%s)") % (pyfile, path_addons, ", ".join(sorted(addons_new))) print(msg) self.report({'INFO'}, msg) |