From d1fdc7a0ce93a86e0200ab4f1051c3472a27eaa6 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Wed, 20 Dec 2023 18:16:12 +0100 Subject: [PATCH 1/9] I18n: Do not translate Python template menu entries --- scripts/modules/_bpy_types.py | 4 ++-- scripts/startup/bl_ui/space_text.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/modules/_bpy_types.py b/scripts/modules/_bpy_types.py index b983a4231d8..890ef05f383 100644 --- a/scripts/modules/_bpy_types.py +++ b/scripts/modules/_bpy_types.py @@ -1200,7 +1200,7 @@ class Menu(_StructRNA, _GenericUI, metaclass=_RNAMeta): def path_menu(self, searchpaths, operator, *, props_default=None, prop_filepath="filepath", filter_ext=None, filter_path=None, display_name=None, - add_operator=None, add_operator_props=None): + add_operator=None, add_operator_props=None, translate=True): """ Populate a menu from a list of paths. @@ -1261,7 +1261,7 @@ class Menu(_StructRNA, _GenericUI, metaclass=_RNAMeta): name = display_name(filepath) if display_name else bpy.path.display_name(f) props = row.operator( operator, - text=iface_(name), + text=(iface_(name) if translate else name), translate=False, ) diff --git a/scripts/startup/bl_ui/space_text.py b/scripts/startup/bl_ui/space_text.py index 0078b8f7103..7604e1a94d7 100644 --- a/scripts/startup/bl_ui/space_text.py +++ b/scripts/startup/bl_ui/space_text.py @@ -289,6 +289,7 @@ class TEXT_MT_templates_py(Menu): "text.open", props_default={"internal": True}, filter_ext=lambda ext: (ext.lower() == ".py"), + translate=False, ) From 9ff1b4f1eca02daa950ac53c17da3a5845e0bee9 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Mon, 13 Oct 2025 15:56:41 +0200 Subject: [PATCH 2/9] I18n: Translate error messages in VR add-on --- scripts/addons_core/viewport_vr_preview/gui.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/addons_core/viewport_vr_preview/gui.py b/scripts/addons_core/viewport_vr_preview/gui.py index ab90677c95e..51f38d67d63 100644 --- a/scripts/addons_core/viewport_vr_preview/gui.py +++ b/scripts/addons_core/viewport_vr_preview/gui.py @@ -10,6 +10,7 @@ else: import bpy from bpy.app.translations import ( + pgettext_n as n_, pgettext_iface as iface_, contexts as i18n_contexts, ) @@ -249,9 +250,9 @@ class VIEW3D_PT_vr_info(bpy.types.Panel): def draw(self, context): import platform layout = self.layout - missing_support_string = "Built without VR/OpenXR features" + missing_support_string = n_("Built without VR/OpenXR features") if platform.system() == "Darwin": - missing_support_string = "VR is not supported on macOS at the moment" + missing_support_string = n_("VR is not supported on macOS at the moment") layout.label(icon='ERROR', text=missing_support_string) From 197d69627d1b1fa71eb66630c5b6b8696a303fdd Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Mon, 13 Oct 2025 19:08:41 +0200 Subject: [PATCH 3/9] I18n: Fix translation of formatted string in report --- scripts/addons_core/rigify/operators/action_layers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/addons_core/rigify/operators/action_layers.py b/scripts/addons_core/rigify/operators/action_layers.py index 1df2a76ca89..d17d5710a70 100644 --- a/scripts/addons_core/rigify/operators/action_layers.py +++ b/scripts/addons_core/rigify/operators/action_layers.py @@ -347,7 +347,7 @@ class RIGIFY_OT_jump_to_action_slot(Operator): self.report({'ERROR'}, "Failed to find Action Slot.") return {'CANCELLED'} - self.report({'INFO'}, f'Set active action set-up index to {i}.') + self.report({'INFO'}, rpt_("Set active action set-up index to {}.").format(i)) return {'FINISHED'} From 51a0d1bf1c4c8968f41620924b33f63dcbb555d4 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Tue, 14 Oct 2025 13:02:09 +0200 Subject: [PATCH 4/9] I18n: Translate curve falloffs using existing context In particular, "Inverse Square" is only extracted in the Curve translation context. Reported by Ye Gui in #43295. --- source/blender/nodes/composite/nodes/node_composite_dilate.cc | 3 ++- source/blender/nodes/composite/nodes/node_composite_keying.cc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/blender/nodes/composite/nodes/node_composite_dilate.cc b/source/blender/nodes/composite/nodes/node_composite_dilate.cc index abcdd0fec27..abdea7ec2c6 100644 --- a/source/blender/nodes/composite/nodes/node_composite_dilate.cc +++ b/source/blender/nodes/composite/nodes/node_composite_dilate.cc @@ -59,7 +59,8 @@ static void cmp_node_dilate_declare(NodeDeclarationBuilder &b) .default_value(PROP_SMOOTH) .static_items(rna_enum_proportional_falloff_curve_only_items) .optional_label() - .usage_by_menu("Type", CMP_NODE_DILATE_ERODE_DISTANCE_FEATHER); + .usage_by_menu("Type", CMP_NODE_DILATE_ERODE_DISTANCE_FEATHER) + .translation_context(BLT_I18NCONTEXT_ID_CURVE_LEGACY); b.add_output("Mask").structure_type(StructureType::Dynamic); } diff --git a/source/blender/nodes/composite/nodes/node_composite_keying.cc b/source/blender/nodes/composite/nodes/node_composite_keying.cc index 97b1133bdd9..775838ee36e 100644 --- a/source/blender/nodes/composite/nodes/node_composite_keying.cc +++ b/source/blender/nodes/composite/nodes/node_composite_keying.cc @@ -137,7 +137,8 @@ static void cmp_node_keying_declare(NodeDeclarationBuilder &b) postprocess_panel.add_input("Feather Falloff") .default_value(PROP_SMOOTH) .static_items(rna_enum_proportional_falloff_curve_only_items) - .optional_label(); + .optional_label() + .translation_context(BLT_I18NCONTEXT_ID_CURVE_LEGACY); PanelDeclarationBuilder &despill_panel = b.add_panel("Despill").default_closed(true); despill_panel.add_input("Strength", "Despill Strength") From 5e6ea2fa78dd1f012ae00d46a43aa055b763dcda Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Tue, 14 Oct 2025 13:30:21 +0200 Subject: [PATCH 5/9] I18n: Disambiguate "Value" in the context of colors --- source/blender/makesrna/intern/rna_sequencer.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/makesrna/intern/rna_sequencer.cc b/source/blender/makesrna/intern/rna_sequencer.cc index 58018d6fd4c..1c62112584b 100644 --- a/source/blender/makesrna/intern/rna_sequencer.cc +++ b/source/blender/makesrna/intern/rna_sequencer.cc @@ -2442,6 +2442,7 @@ static void rna_def_strip(BlenderRNA *brna) RNA_def_property_enum_default(prop, STRIP_TYPE_ALPHAOVER); RNA_def_property_ui_text( prop, "Blending Mode", "Method for controlling how the strip combines with other strips"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_COLOR); RNA_def_property_update( prop, NC_SCENE | ND_SEQUENCER, "rna_Strip_invalidate_preprocessed_update"); From c36c103389c3d1fb0d8a90ed95453810797387d9 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Tue, 14 Oct 2025 14:45:33 +0200 Subject: [PATCH 6/9] I18n: Translate "Unassigned Node Tools" tool node menu The "Unassigned Node Tools" menu type is declared manually in a function, and its label is not automatically translated. This commit extracts it using `N_()`. Note that its description was already extracted the same way. Reported by Ye Gui in #43295. --- source/blender/editors/geometry/node_group_operator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/geometry/node_group_operator.cc b/source/blender/editors/geometry/node_group_operator.cc index 0b3fe1983c1..79aba63660c 100644 --- a/source/blender/editors/geometry/node_group_operator.cc +++ b/source/blender/editors/geometry/node_group_operator.cc @@ -1486,7 +1486,7 @@ static void catalog_assets_draw_unassigned(const bContext *C, Menu *menu) MenuType node_group_operator_assets_menu_unassigned() { MenuType type{}; - STRNCPY_UTF8(type.label, "Unassigned Node Tools"); + STRNCPY_UTF8(type.label, N_("Unassigned Node Tools")); STRNCPY_UTF8(type.idname, "GEO_MT_node_operator_unassigned"); type.poll = asset_menu_poll; type.draw = catalog_assets_draw_unassigned; From 90e2dfd2e326a51260dbf9e1d6a0cf918028d8c3 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Tue, 14 Oct 2025 17:12:42 +0200 Subject: [PATCH 7/9] I18n: Translate dynamic operator descriptions The descriptions for `POSELIB_OT_asset_modify` and `GEOMETRY_OT_execute_node_group` are dynamic. They were already extracted, but the translation did not happen in the description function. This commit adds the appropriate `TIP_` translation macro. Reported by Ye Gui in #43295. --- source/blender/editors/animation/anim_asset_ops.cc | 2 +- source/blender/editors/space_node/node_sync_sockets.cc | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/animation/anim_asset_ops.cc b/source/blender/editors/animation/anim_asset_ops.cc index aa7c4aa3d46..9f8b93b39a1 100644 --- a/source/blender/editors/animation/anim_asset_ops.cc +++ b/source/blender/editors/animation/anim_asset_ops.cc @@ -708,7 +708,7 @@ static std::string pose_asset_modify_description(bContext * /* C */, PointerRNA *ptr) { const int mode = RNA_enum_get(ptr, "mode"); - return std::string(prop_asset_overwrite_modes[mode].description); + return TIP_(std::string(prop_asset_overwrite_modes[mode].description)); } /* Calling it overwrite instead of save because we aren't actually saving an opened asset. */ diff --git a/source/blender/editors/space_node/node_sync_sockets.cc b/source/blender/editors/space_node/node_sync_sockets.cc index 6d08070c1bd..f84991b07f7 100644 --- a/source/blender/editors/space_node/node_sync_sockets.cc +++ b/source/blender/editors/space_node/node_sync_sockets.cc @@ -18,6 +18,8 @@ #include "BKE_node_runtime.hh" #include "BKE_node_tree_update.hh" +#include "BLT_translation.hh" + #include "ED_node.hh" #include "ED_screen.hh" @@ -80,12 +82,12 @@ static std::string sockets_sync_get_description(bContext *C, wmOperatorType *ot, { Vector nodes_to_sync = get_nodes_to_sync(*C, ptr); if (nodes_to_sync.size() != 1) { - return ot->description; + return TIP_(ot->description); } const bNode &node = *nodes_to_sync.first(); std::string description = nodes::sync_node_description_get(*C, node); if (description.empty()) { - return ot->description; + return TIP_(ot->description); } return description; } From cf7713aac6708d07d5b9465ec7f2e2f407bdb5d2 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Wed, 15 Oct 2025 12:58:26 +0200 Subject: [PATCH 8/9] I18n: Disambiguate "Second", the unit, not the ordinal Reported by Alexandr Fatih in #43295. Pull Request: https://projects.blender.org/blender/blender/pulls/148085 --- source/blender/makesrna/intern/rna_scene.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/makesrna/intern/rna_scene.cc b/source/blender/makesrna/intern/rna_scene.cc index 85ddc7f4f93..ea986f64c7d 100644 --- a/source/blender/makesrna/intern/rna_scene.cc +++ b/source/blender/makesrna/intern/rna_scene.cc @@ -8767,6 +8767,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_enum_items(prop, time_jump_unit_items); RNA_def_property_ui_text( prop, "Time Jump Unit", "Which unit to use for time jumps in the timeline"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_UNIT); RNA_def_property_update(prop, NC_SCENE | ND_FRAME_RANGE, nullptr); prop = RNA_def_property(srna, "time_jump_delta", PROP_FLOAT, PROP_TIME); From a3681c98ef078ab7c33a08009997c31ca497df75 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 15 Oct 2025 16:29:48 +0200 Subject: [PATCH 9/9] Build: Linux libraries for OSL Ref #147620 Ref #147727 Pull Request: https://projects.blender.org/blender/blender/pulls/147812 --- lib/linux_x64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linux_x64 b/lib/linux_x64 index 9897062edb2..3abcca1aa43 160000 --- a/lib/linux_x64 +++ b/lib/linux_x64 @@ -1 +1 @@ -Subproject commit 9897062edb26dc1889eacb09d9022a76e7906afb +Subproject commit 3abcca1aa43fe29f21cdf442d0cf412357cf4d25