From 7ec15a3a984c813770035f6e13821edaaf9a6849 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Wed, 24 Sep 2025 22:28:08 +0200 Subject: [PATCH] I18n: Use rpt_ instead of tip_ to translate reports This was the case in: - FBX add-on - Cycles OSL --- intern/cycles/blender/addon/osl.py | 6 +++--- scripts/addons_core/io_scene_fbx/import_fbx.py | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/intern/cycles/blender/addon/osl.py b/intern/cycles/blender/addon/osl.py index 7df703b78e6..df206eeaace 100644 --- a/intern/cycles/blender/addon/osl.py +++ b/intern/cycles/blender/addon/osl.py @@ -7,7 +7,7 @@ from __future__ import annotations import bpy import _cycles -from bpy.app.translations import pgettext_tip as tip_ +from bpy.app.translations import pgettext_rpt as rpt_ def osl_compile(input_path, report): @@ -307,7 +307,7 @@ def update_script_node(node, report): sockets.remove(sockets[identifier]) else: ok = False - report({'ERROR'}, tip_("OSL query failed to open %s") % oso_path) + report({'ERROR'}, rpt_("OSL query failed to open %s") % oso_path) else: report({'ERROR'}, "OSL script compilation failed, see console for errors") @@ -359,7 +359,7 @@ def update_custom_camera_shader(cam, report): del custom_props[prop] else: ok = False - report({'ERROR'}, tip_("OSL query failed to open %s") % oso_path) + report({'ERROR'}, rpt_("OSL query failed to open %s") % oso_path) else: report({'ERROR'}, "Custom Camera shader compilation failed, see console for errors") diff --git a/scripts/addons_core/io_scene_fbx/import_fbx.py b/scripts/addons_core/io_scene_fbx/import_fbx.py index b48a2456e75..3efe707d86c 100644 --- a/scripts/addons_core/io_scene_fbx/import_fbx.py +++ b/scripts/addons_core/io_scene_fbx/import_fbx.py @@ -15,7 +15,7 @@ if "bpy" in locals(): importlib.reload(fbx_utils) import bpy -from bpy.app.translations import pgettext_tip as tip_ +from bpy.app.translations import pgettext_rpt as rpt_ from mathutils import Matrix, Euler, Vector, Quaternion from bpy_extras import anim_utils @@ -3090,7 +3090,7 @@ def load(operator, context, filepath="", is_ascii = False if is_ascii: - operator.report({'ERROR'}, tip_("ASCII FBX files are not supported %r") % filepath) + operator.report({'ERROR'}, rpt_("ASCII FBX files are not supported %r") % filepath) return {'CANCELLED'} del is_ascii # End ascii detection. @@ -3101,11 +3101,11 @@ def load(operator, context, filepath="", import traceback traceback.print_exc() - operator.report({'ERROR'}, tip_("Couldn't open file %r (%s)") % (filepath, e)) + operator.report({'ERROR'}, rpt_("Couldn't open file %r (%s)") % (filepath, e)) return {'CANCELLED'} if version < 7100: - operator.report({'ERROR'}, tip_("Version %r unsupported, must be %r or later") % (version, 7100)) + operator.report({'ERROR'}, rpt_("Version %r unsupported, must be %r or later") % (version, 7100)) return {'CANCELLED'} print("FBX version: %r" % version) @@ -3140,7 +3140,7 @@ def load(operator, context, filepath="", fbx_settings = elem_find_first(elem_root, b'GlobalSettings') fbx_settings_props = elem_find_first(fbx_settings, b'Properties70') if fbx_settings is None or fbx_settings_props is None: - operator.report({'ERROR'}, tip_("No 'GlobalSettings' found in file %r") % filepath) + operator.report({'ERROR'}, rpt_("No 'GlobalSettings' found in file %r") % filepath) return {'CANCELLED'} # FBX default base unit seems to be the centimeter, while raw Blender Unit is equivalent to the meter... @@ -3207,10 +3207,10 @@ def load(operator, context, filepath="", fbx_connections = elem_find_first(elem_root, b'Connections') if fbx_nodes is None: - operator.report({'ERROR'}, tip_("No 'Objects' found in file %r") % filepath) + operator.report({'ERROR'}, rpt_("No 'Objects' found in file %r") % filepath) return {'CANCELLED'} if fbx_connections is None: - operator.report({'ERROR'}, tip_("No 'Connections' found in file %r") % filepath) + operator.report({'ERROR'}, rpt_("No 'Connections' found in file %r") % filepath) return {'CANCELLED'} # ----