From c34ba268560bd530e9458298a07f21487278a483 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 21 Dec 2020 11:35:02 +0100 Subject: Fix part of T84004: Some 2.92 alpha UI strings can't be translated. Not sure why, but py files from `bl_operators` were never considered for i18n string extraction... They do define some UI strings though. --- release/scripts/modules/bl_i18n_utils/settings.py | 1 + release/scripts/startup/bl_operators/mesh.py | 23 ++++++++++------------- release/scripts/startup/bl_operators/object.py | 2 +- release/scripts/startup/bl_operators/presets.py | 2 +- release/scripts/startup/bl_operators/sequencer.py | 2 +- release/scripts/startup/bl_operators/wm.py | 4 ++-- 6 files changed, 16 insertions(+), 18 deletions(-) (limited to 'release') diff --git a/release/scripts/modules/bl_i18n_utils/settings.py b/release/scripts/modules/bl_i18n_utils/settings.py index cfa4fcac17f..86070262e56 100644 --- a/release/scripts/modules/bl_i18n_utils/settings.py +++ b/release/scripts/modules/bl_i18n_utils/settings.py @@ -504,6 +504,7 @@ MO_FILE_NAME = DOMAIN + ".mo" # Where to search for py files that may contain ui strings (relative to one of the 'resource_path' of Blender). CUSTOM_PY_UI_FILES = [ os.path.join("scripts", "startup", "bl_ui"), + os.path.join("scripts", "startup", "bl_operators"), os.path.join("scripts", "modules", "rna_prop_ui.py"), ] diff --git a/release/scripts/startup/bl_operators/mesh.py b/release/scripts/startup/bl_operators/mesh.py index 72686bb8dfe..5fca3e194d7 100644 --- a/release/scripts/startup/bl_operators/mesh.py +++ b/release/scripts/startup/bl_operators/mesh.py @@ -181,23 +181,20 @@ class MeshMirrorUV(Operator): bpy.ops.object.mode_set(mode='EDIT', toggle=False) if total_duplicates and total_no_active_UV: - self.report({'WARNING'}, "%d %s with no active UV layer. " - "%d duplicates found in %d %s, mirror may be incomplete." + self.report({'WARNING'}, + "%d mesh(es) with no active UV layer, " + "%d duplicates found in %d mesh(es), mirror may be incomplete" % (total_no_active_UV, - "mesh" if total_no_active_UV == 1 else "meshes", total_duplicates, - meshes_with_duplicates, - "mesh" if meshes_with_duplicates == 1 else "meshes")) + meshes_with_duplicates)) elif total_no_active_UV: - self.report({'WARNING'}, "%d %s with no active UV layer." - % (total_no_active_UV, - "mesh" if total_no_active_UV == 1 else "meshes")) + self.report({'WARNING'}, + "%d mesh(es) with no active UV layer" + % (total_no_active_UV,)) elif total_duplicates: - self.report({'WARNING'}, "%d duplicates found in %d %s," - " mirror may be incomplete." - % (total_duplicates, - meshes_with_duplicates, - "mesh" if meshes_with_duplicates == 1 else "meshes")) + self.report({'WARNING'}, + "%d duplicates found in %d mesh(es), mirror may be incomplete" + % (total_duplicates, meshes_with_duplicates)) return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index 92eb47cea0f..5a388047ddd 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -566,7 +566,7 @@ class JoinUVs(Operator): uv_other = mesh_other.uv_layers.active if not uv_other: self.report({'ERROR'}, "Could not add " - "a new UV map tp object " + "a new UV map to object " "'%s' (Mesh '%s')\n" % (obj_other.name, mesh_other.name, diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index 5da7a3270d9..793a8648ee4 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -254,7 +254,7 @@ class ExecutePreset(Operator): ext = splitext(filepath)[1].lower() if ext not in {".py", ".xml"}: - self.report({'ERROR'}, "unknown filetype: %r" % ext) + self.report({'ERROR'}, "Unknown file type: %r" % ext) return {'CANCELLED'} if hasattr(preset_class, "reset_cb"): diff --git a/release/scripts/startup/bl_operators/sequencer.py b/release/scripts/startup/bl_operators/sequencer.py index df1098bdd3f..e97ce25e758 100644 --- a/release/scripts/startup/bl_operators/sequencer.py +++ b/release/scripts/startup/bl_operators/sequencer.py @@ -242,7 +242,7 @@ class SequencerFadesAdd(Operator): sequence.invalidate_cache('COMPOSITE') sequence_string = "sequence" if len(faded_sequences) == 1 else "sequences" - self.report({'INFO'}, "Added fade animation to %d %s." % (len(faded_sequences), sequence_string)) + self.report({'INFO'}, "Added fade animation to %d %s" % (len(faded_sequences), sequence_string)) return {'FINISHED'} def calculate_fade_duration(self, context, sequence): diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index bd1c99fdeb3..6915d31f379 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1625,7 +1625,7 @@ class WM_OT_operator_cheat_sheet(Operator): textblock = bpy.data.texts.new("OperatorList.txt") textblock.write('# %d Operators\n\n' % tot) textblock.write('\n'.join(op_strings)) - self.report({'INFO'}, "See OperatorList.txt textblock") + self.report({'INFO'}, "See OperatorList.txt text block") return {'FINISHED'} @@ -1717,7 +1717,7 @@ class WM_OT_tool_set_by_id(Operator): tool_settings.workspace_tool_type = 'FALLBACK' return {'FINISHED'} else: - self.report({'WARNING'}, "Tool %r not found for space %r." % (self.name, space_type)) + self.report({'WARNING'}, "Tool %r not found for space %r" % (self.name, space_type)) return {'CANCELLED'} -- cgit v1.2.3