diff --git a/scripts/addons_core/bl_pkg/bl_extension_ops.py b/scripts/addons_core/bl_pkg/bl_extension_ops.py index 3427e2bb7fb..0935dcf95a5 100644 --- a/scripts/addons_core/bl_pkg/bl_extension_ops.py +++ b/scripts/addons_core/bl_pkg/bl_extension_ops.py @@ -36,7 +36,6 @@ from bpy.app.translations import ( pgettext_iface as iface_, pgettext_tip as tip_, pgettext_rpt as rpt_, - ) from . import ( @@ -1916,10 +1915,10 @@ class EXTENSIONS_OT_repo_unlock(Operator): repo_name, repo_directory, _lock_age, _lock_error = self._repo_vars if (error := bl_extension_utils.repo_lock_directory_force_unlock(repo_directory)): - self.report({'ERROR'}, "Force unlock failed: {:s}".format(error)) + self.report({'ERROR'}, rpt_("Force unlock failed: {:s}").format(error)) return {'CANCELLED'} - self.report({'INFO'}, "Unlocked: {:s}".format(repo_name)) + self.report({'INFO'}, rpt_("Unlocked: {:s}").format(repo_name)) return {'FINISHED'} def draw(self, _context): @@ -2815,7 +2814,7 @@ class EXTENSIONS_OT_package_install_files(Operator, _ExtCmdMixIn): return {'CANCELLED'} if isinstance(result := pkg_manifest_dict_from_archive_or_error(filepath), str): - self.report({'ERROR'}, "Error in manifest {:s}".format(result)) + self.report({'ERROR'}, rpt_("Error in manifest {:s}").format(result)) return {'CANCELLED'} pkg_id = result["id"] @@ -3157,7 +3156,7 @@ class EXTENSIONS_OT_package_install(Operator, _ExtCmdMixIn): if python_version ], ), str): - self.report({'ERROR'}, iface_("The extension is incompatible with this system:\n{:s}").format(error)) + self.report({'ERROR'}, rpt_("The extension is incompatible with this system:\n{:s}").format(error)) return {'CANCELLED'} del error @@ -3852,7 +3851,7 @@ class EXTENSIONS_OT_repo_lock_all(Operator): lock_handle.release() return {'CANCELLED'} - self.report({'INFO'}, "Locked {:d} repos(s)".format(len(lock_result))) + self.report({'INFO'}, rpt_("Locked {:d} repos(s)").format(len(lock_result))) EXTENSIONS_OT_repo_lock_all.lock = lock_handle return {'FINISHED'} @@ -3876,7 +3875,7 @@ class EXTENSIONS_OT_repo_unlock_all(Operator): # This isn't canceled, but there were issues unlocking. return {'FINISHED'} - self.report({'INFO'}, "Unlocked {:d} repos(s)".format(len(lock_result))) + self.report({'INFO'}, rpt_("Unlocked {:d} repos(s)").format(len(lock_result))) return {'FINISHED'} diff --git a/scripts/startup/bl_operators/anim.py b/scripts/startup/bl_operators/anim.py index 9f3e108eb5f..60b4c642eef 100644 --- a/scripts/startup/bl_operators/anim.py +++ b/scripts/startup/bl_operators/anim.py @@ -500,7 +500,7 @@ class ARMATURE_OT_copy_bone_color_to_selected(Operator): # Anything else: case _: - self.report({'ERROR'}, "Cannot do anything in mode {!r}".format(context.mode)) + self.report({'ERROR'}, rpt_("Cannot do anything in mode {!r}").format(context.mode)) return {'CANCELLED'} if not bone_source: diff --git a/scripts/startup/bl_operators/image_as_planes.py b/scripts/startup/bl_operators/image_as_planes.py index 7df92c5861f..ce7f293cf51 100644 --- a/scripts/startup/bl_operators/image_as_planes.py +++ b/scripts/startup/bl_operators/image_as_planes.py @@ -22,6 +22,7 @@ from bpy.props import ( from bpy.app.translations import ( pgettext_tip as tip_, + pgettext_rpt as rpt_, contexts as i18n_contexts, ) from mathutils import Vector @@ -852,13 +853,13 @@ class IMAGE_OT_import_as_mesh_planes( def invoke(self, context, _event): engine = context.scene.render.engine if engine not in COMPATIBLE_ENGINES: - self.report({'ERROR'}, tip_("Cannot generate materials for unknown {:s} render engine").format(engine)) + self.report({'ERROR'}, rpt_("Cannot generate materials for unknown {:s} render engine").format(engine)) return {'CANCELLED'} if engine == 'BLENDER_WORKBENCH': self.report( {'WARNING'}, - tip_("Generating Cycles/EEVEE compatible material, but won't be visible with {:s} engine").format( + rpt_("Generating Cycles/EEVEE compatible material, but won't be visible with {:s} engine").format( engine, )) @@ -917,7 +918,7 @@ class IMAGE_OT_import_as_mesh_planes( plane.select_set(True) # All done! - self.report({'INFO'}, tip_("Added {:d} Image Plane(s)").format(len(planes))) + self.report({'INFO'}, rpt_("Added {:d} Image Plane(s)").format(len(planes))) return {'FINISHED'} # Operate on a single image. @@ -1130,13 +1131,13 @@ class IMAGE_OT_convert_to_mesh_plane(MaterialProperties_MixIn, TextureProperties engine = scene.render.engine if engine not in COMPATIBLE_ENGINES: - self.report({'ERROR'}, tip_("Cannot generate materials for unknown {:s} render engine").format(engine)) + self.report({'ERROR'}, rpt_("Cannot generate materials for unknown {:s} render engine").format(engine)) return {'CANCELLED'} if engine == 'BLENDER_WORKBENCH': self.report( {'WARNING'}, - tip_("Generating Cycles/EEVEE compatible material, but won't be visible with {:s} engine").format( + rpt_("Generating Cycles/EEVEE compatible material, but won't be visible with {:s} engine").format( engine, )) @@ -1206,7 +1207,7 @@ class IMAGE_OT_convert_to_mesh_plane(MaterialProperties_MixIn, TextureProperties self.report({'ERROR'}, "No images converted") return {'CANCELLED'} - self.report({'INFO'}, "{:d} image(s) converted to mesh plane(s)".format(converted)) + self.report({'INFO'}, rpt_("{:d} image(s) converted to mesh plane(s)").format(converted)) return {'FINISHED'} def draw(self, context): diff --git a/scripts/startup/bl_operators/node.py b/scripts/startup/bl_operators/node.py index 33db9a833a5..3714fb09fb3 100644 --- a/scripts/startup/bl_operators/node.py +++ b/scripts/startup/bl_operators/node.py @@ -660,7 +660,7 @@ class NODE_OT_viewer_shortcut_set(Operator): bpy.ops.node.activate_viewer() viewer_node.ui_shortcut = self.viewer_index - self.report({'INFO'}, "Assigned shortcut {:d} to {:s}".format(self.viewer_index, viewer_node.name)) + self.report({'INFO'}, rpt_("Assigned shortcut {:d} to {:s}").format(self.viewer_index, viewer_node.name)) return {'FINISHED'} @@ -696,7 +696,7 @@ class NODE_OT_viewer_shortcut_get(Operator): viewer_node = n if not viewer_node: - self.report({'INFO'}, "Shortcut {:d} is not assigned to a Viewer node yet".format(self.viewer_index)) + self.report({'INFO'}, rpt_("Shortcut {:d} is not assigned to a Viewer node yet").format(self.viewer_index)) return {'CANCELLED'} with bpy.context.temp_override(node=viewer_node):