From f87d4e4e406604904f90a6a6a4f85f35ee34d4ff Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Thu, 13 Jun 2024 12:15:55 +0200 Subject: [PATCH] I18n: Extract and disambiguate a few messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extract - Cycles denoiser enum. - Extensions user preferences UI. - Node operator poll message from new node function. Improve - Split "(Enabled|Disabled) on startup, overriding the preference." into two messages. Disambiguate - "Add" when describing the action of adding something should use the Operator context. - "Dimensions", in noise textures. - "Transform" as a noun, the matrix transform type of Geometry Nodes, as opposed to the verb to move things in space. - "Parent" as a noun or verb (the parent of an object, to parent an object to another). Some issues reported by Satoshi Yamasaki, deathblood, and Gabriel Gazzán. Pull Request: https://projects.blender.org/blender/blender/pulls/122969 --- intern/cycles/blender/addon/properties.py | 14 ++++--- .../addons_core/bl_pkg/bl_extension_notify.py | 4 +- scripts/addons_core/bl_pkg/bl_extension_ui.py | 38 ++++++++++++++----- .../node_editor/node_functions.py | 6 ++- scripts/startup/bl_operators/wm.py | 4 +- scripts/startup/bl_ui/node_add_menu_shader.py | 2 + .../startup/bl_ui/node_add_menu_texture.py | 4 ++ scripts/startup/bl_ui/space_userpref.py | 10 ++--- scripts/startup/bl_ui/space_view3d.py | 11 ++++-- .../blender/editors/animation/keyframing.cc | 2 +- .../editors/geometry/geometry_attributes.cc | 10 +++-- .../editors/gpencil_legacy/gpencil_utils.cc | 6 ++- .../intern/grease_pencil_layers.cc | 7 +++- source/blender/editors/object/object_add.cc | 11 +++--- .../editors/sculpt_paint/paint_image_proj.cc | 3 +- .../blender/editors/space_image/image_ops.cc | 6 ++- .../editors/space_node/node_templates.cc | 2 +- source/blender/makesrna/intern/rna_brush.cc | 1 + .../blender/makesrna/intern/rna_nodetree.cc | 5 +++ source/blender/modifiers/intern/MOD_nodes.cc | 2 +- .../geometry/nodes/node_geo_get_named_grid.cc | 5 ++- 21 files changed, 106 insertions(+), 47 deletions(-) diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 0326117a32d..20ea5b179c3 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -16,7 +16,8 @@ from bpy.props import ( ) from bpy.app.translations import ( contexts as i18n_contexts, - pgettext_rpt as rpt_ + pgettext_tip as n_, + pgettext_rpt as rpt_, ) from math import pi @@ -263,13 +264,14 @@ def enum_openimagedenoise_denoiser(self, context): import _cycles if _cycles.with_openimagedenoise: return [('OPENIMAGEDENOISE', "OpenImageDenoise", - "Use Intel OpenImageDenoise AI denoiser", 4)] + n_("Use Intel OpenImageDenoise AI denoiser"), 4)] return [] def enum_optix_denoiser(self, context): if not context or bool(context.preferences.addons[__package__].preferences.get_devices_for_type('OPTIX')): - return [('OPTIX', "OptiX", "Use the OptiX AI denoiser with GPU acceleration, only available on NVIDIA GPUs when configured in the system tab in the user preferences", 2)] + return [('OPTIX', "OptiX", n_( + "Use the OptiX AI denoiser with GPU acceleration, only available on NVIDIA GPUs when configured in the system tab in the user preferences"), 2)] return [] @@ -281,11 +283,11 @@ def enum_preview_denoiser(self, context): items = [ ('AUTO', "Automatic", - ("Use GPU accelerated denoising if supported, for the best performance. " - "Prefer OpenImageDenoise over OptiX"), + n_("Use GPU accelerated denoising if supported, for the best performance. " + "Prefer OpenImageDenoise over OptiX"), 0)] else: - items = [('AUTO', "None", "Blender was compiled without a viewport denoiser", 0)] + items = [('AUTO', "None", n_("Blender was compiled without a viewport denoiser"), 0)] items += optix_items items += oidn_items diff --git a/scripts/addons_core/bl_pkg/bl_extension_notify.py b/scripts/addons_core/bl_pkg/bl_extension_notify.py index 1bb817ff277..8c72e2ee539 100644 --- a/scripts/addons_core/bl_pkg/bl_extension_notify.py +++ b/scripts/addons_core/bl_pkg/bl_extension_notify.py @@ -16,6 +16,8 @@ import os import bpy import sys +from bpy.app.translations import pgettext_rpt as rpt_ + from . import bl_extension_ops from . import bl_extension_utils @@ -349,7 +351,7 @@ class NotifyHandle: def ui_text(self): if self.sync_info is None: - return "Checking for Extension Updates", 'SORTTIME', WM_EXTENSIONS_UPDATE_CHECKING + return rpt_("Checking for Extension Updates"), 'SORTTIME', WM_EXTENSIONS_UPDATE_CHECKING status_data, update_count, extra_warnings = self.sync_info text, icon = bl_extension_utils.CommandBatch.calc_status_text_icon_from_data( status_data, update_count, diff --git a/scripts/addons_core/bl_pkg/bl_extension_ui.py b/scripts/addons_core/bl_pkg/bl_extension_ui.py index 22af3d97727..ef530c603fd 100644 --- a/scripts/addons_core/bl_pkg/bl_extension_ui.py +++ b/scripts/addons_core/bl_pkg/bl_extension_ui.py @@ -107,6 +107,7 @@ def extensions_panel_draw_legacy_addons( import addon_utils from bpy.app.translations import ( pgettext_iface as iface_, + pgettext_tip as tip_, ) from .bl_extension_ops import ( pkg_info_check_exclude_filter_ex, @@ -165,9 +166,9 @@ def extensions_panel_draw_legacy_addons( sub.active = is_enabled if module_parent_dirname(mod.__file__) == "addons_core": - sub.label(text="Core: " + bl_info["name"], translate=False) + sub.label(text=iface_("Core:") + " " + iface_(bl_info["name"]), translate=False) else: - sub.label(text="Legacy: " + bl_info["name"], translate=False) + sub.label(text=iface_("Legacy:") + " " + iface_(bl_info["name"]), translate=False) if bl_info["warning"]: sub.label(icon='ERROR') @@ -186,7 +187,10 @@ def extensions_panel_draw_legacy_addons( col_b = split.column() if bl_info["description"]: - col_a.label(text="{:s}.".format(bl_info["description"])) + col_a.label( + text="{:s}.".format(tip_(bl_info["description"])), + translate=False, + ) if bl_info["doc_url"] or bl_info.get("tracker_url"): sub = box.row() @@ -226,7 +230,7 @@ def extensions_panel_draw_legacy_addons( col_b.label(text=".".join(str(x) for x in value), translate=False) if value := bl_info["warning"]: col_a.label(text="Warning") - col_b.label(text=" " + iface_(value), icon='ERROR') + col_b.label(text=" " + iface_(value), icon='ERROR', translate=False) del value col_a.label(text="File") @@ -509,6 +513,7 @@ def extensions_panel_draw_impl( import os from bpy.app.translations import ( pgettext_iface as iface_, + pgettext_tip as tip_, ) from .bl_extension_ops import ( blender_extension_mark, @@ -777,7 +782,7 @@ def extensions_panel_draw_impl( col_b = split.column() # The full tagline may be multiple lines (not yet supported by Blender's UI). - col_a.label(text="{:s}.".format(item_remote.tagline), translate=False) + col_a.label(text="{:s}.".format(tip_(item_remote.tagline)), translate=False) if value := item_remote.website: # Use half size button, for legacy add-ons there are two, here there is one @@ -992,6 +997,7 @@ def extensions_panel_draw(panel, context): prefs = context.preferences + from bpy.app.translations import pgettext_iface as iface_ from .bl_extension_ops import ( blender_filter_by_type_map, ) @@ -1035,7 +1041,7 @@ def extensions_panel_draw(panel, context): # Don't clip longer names. row = box.split(factor=0.9, align=True) if repo_status_text.running: - row.label(text=repo_status_text.title + "...", icon='INFO') + row.label(text=iface_(repo_status_text.title) + "...", icon='INFO', translate=False) else: row.label(text=repo_status_text.title, icon='INFO') if show_development_reports: @@ -1053,16 +1059,28 @@ def extensions_panel_draw(panel, context): factor=progress / progress_range, text="{:s}, {:s}".format( sizes_as_percentage_string(progress, progress_range), - msg_str, + iface_(msg_str), ), + translate=False, ) elif progress_unit == 'BYTE': - boxsub.progress(factor=0.0, text="{:s}, {:s}".format(msg_str, size_as_fmt_string(progress))) + boxsub.progress( + factor=0.0, + text="{:s}, {:s}".format(iface_(msg_str), size_as_fmt_string(progress)), + translate=False, + ) else: # We might want to support other types. - boxsub.progress(factor=0.0, text="{:s}, {:d}".format(msg_str, progress)) + boxsub.progress( + factor=0.0, + text="{:s}, {:d}".format(iface_(msg_str), progress), + translate=False, + ) else: - boxsub.label(text="{:s}: {:s}".format(ty, msg)) + boxsub.label( + text="{:s}: {:s}".format(iface_(ty), iface_(msg)), + translate=False, + ) # Hide when running. if repo_status_text.running: diff --git a/scripts/startup/bl_operators/node_editor/node_functions.py b/scripts/startup/bl_operators/node_editor/node_functions.py index 841ddb52ec8..3a3c752ee16 100644 --- a/scripts/startup/bl_operators/node_editor/node_functions.py +++ b/scripts/startup/bl_operators/node_editor/node_functions.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later import bpy +from bpy.app.translations import pgettext_tip as tip_ def node_editor_poll(cls, context): @@ -25,8 +26,9 @@ def node_editor_poll(cls, context): def node_space_type_poll(cls, context, types): if context.space_data.tree_type not in types: tree_types_str = ", ".join(t.split('NodeTree')[0].lower() for t in sorted(types)) - cls.poll_message_set("Current node tree type not supported.\n" - "Should be one of " + tree_types_str + ".") + poll_message = tip_("Current node tree type not supported.\n" + "Should be one of {:s}.").format(tree_types_str) + cls.poll_message_set(poll_message) return False return True diff --git a/scripts/startup/bl_operators/wm.py b/scripts/startup/bl_operators/wm.py index d76f3fc68c1..e7420cc5d39 100644 --- a/scripts/startup/bl_operators/wm.py +++ b/scripts/startup/bl_operators/wm.py @@ -2650,8 +2650,8 @@ class BatchRenameAction(bpy.types.PropertyGroup): ) # Weak, add/remove as properties. - op_add: BoolProperty(name="Add") - op_remove: BoolProperty(name="Remove") + op_add: BoolProperty(name="Add", translation_context=i18n_contexts.operator_default) + op_remove: BoolProperty(name="Remove", translation_context=i18n_contexts.operator_default) class WM_OT_batch_rename(Operator): diff --git a/scripts/startup/bl_ui/node_add_menu_shader.py b/scripts/startup/bl_ui/node_add_menu_shader.py index 8e738e7ca80..a5104ecedfc 100644 --- a/scripts/startup/bl_ui/node_add_menu_shader.py +++ b/scripts/startup/bl_ui/node_add_menu_shader.py @@ -7,6 +7,7 @@ from bpy.types import Menu from bl_ui import node_add_menu from bpy.app.translations import ( pgettext_iface as iface_, + contexts as i18n_contexts, ) @@ -352,6 +353,7 @@ class NODE_MT_category_shader_group(Menu): class NODE_MT_shader_node_add_all(Menu): bl_idname = "NODE_MT_shader_node_add_all" bl_label = "Add" + bl_translation_context = i18n_contexts.operator_default def draw(self, _context): layout = self.layout diff --git a/scripts/startup/bl_ui/node_add_menu_texture.py b/scripts/startup/bl_ui/node_add_menu_texture.py index 567b8be5a0c..32c2bc265c8 100644 --- a/scripts/startup/bl_ui/node_add_menu_texture.py +++ b/scripts/startup/bl_ui/node_add_menu_texture.py @@ -4,6 +4,9 @@ import bpy from bpy.types import Menu +from bpy.app.translations import ( + contexts as i18n_contexts, +) from bl_ui import node_add_menu @@ -109,6 +112,7 @@ class NODE_MT_category_texture_group(Menu): class NODE_MT_texture_node_add_all(Menu): bl_idname = "NODE_MT_texture_node_add_all" bl_label = "Add" + bl_translation_context = i18n_contexts.operator_default def draw(self, _context): layout = self.layout diff --git a/scripts/startup/bl_ui/space_userpref.py b/scripts/startup/bl_ui/space_userpref.py index 2e9236dcb0d..18e4746ac12 100644 --- a/scripts/startup/bl_ui/space_userpref.py +++ b/scripts/startup/bl_ui/space_userpref.py @@ -735,11 +735,11 @@ class USERPREF_PT_system_network(SystemPanel, CenterAlignMixIn, Panel): if system.use_online_access != runtime_online_access: row = layout.split(factor=0.4) row.label(text="") - row.label( - text="{:s} on startup, overriding the preference.".format( - "Enabled" if runtime_online_access else "Disabled" - ), - ) + if runtime_online_access: + text = iface_("Enabled on startup, overriding the preference.") + else: + text = iface_("Disabled on startup, overriding the preference.") + row.label(text=text, translate=False) class USERPREF_PT_system_memory(SystemPanel, CenterAlignMixIn, Panel): diff --git a/scripts/startup/bl_ui/space_view3d.py b/scripts/startup/bl_ui/space_view3d.py index d3b797e8392..11352069bf2 100644 --- a/scripts/startup/bl_ui/space_view3d.py +++ b/scripts/startup/bl_ui/space_view3d.py @@ -1279,7 +1279,7 @@ class VIEW3D_MT_editor_menus(Menu): if gp_edit: pass elif mode_string == 'OBJECT': - layout.menu("VIEW3D_MT_add", text="Add", text_ctxt=i18n_contexts.operator_default) + layout.menu("VIEW3D_MT_add") elif mode_string == 'EDIT_MESH': layout.menu("VIEW3D_MT_mesh_add", text="Add", text_ctxt=i18n_contexts.operator_default) elif mode_string == 'EDIT_CURVE': @@ -1790,7 +1790,7 @@ class VIEW3D_MT_select_object_more_less(Menu): layout.separator() - props = layout.operator("object.select_hierarchy", text="Parent") + props = layout.operator("object.select_hierarchy", text="Parent", text_ctxt=i18n_contexts.default) props.extend = False props.direction = 'PARENT' @@ -1849,7 +1849,7 @@ class VIEW3D_MT_select_pose_more_less(Menu): def draw(self, _context): layout = self.layout - props = layout.operator("pose.select_hierarchy", text="Parent") + props = layout.operator("pose.select_hierarchy", text="Parent", text_ctxt=i18n_contexts.default) props.extend = False props.direction = 'PARENT' @@ -2269,7 +2269,7 @@ class VIEW3D_MT_select_edit_armature(Menu): layout.separator() - props = layout.operator("armature.select_hierarchy", text="Parent") + props = layout.operator("armature.select_hierarchy", text="Parent", text_ctxt=i18n_contexts.default) props.extend = False props.direction = 'PARENT' @@ -3318,6 +3318,7 @@ class VIEW3D_MT_object_apply(Menu): class VIEW3D_MT_object_parent(Menu): bl_label = "Parent" + bl_translation_context = i18n_contexts.operator_default def draw(self, _context): from bl_ui_utils.layout import operator_context @@ -5774,6 +5775,7 @@ class VIEW3D_MT_edit_armature_names(Menu): class VIEW3D_MT_edit_armature_parent(Menu): bl_label = "Parent" + bl_translation_context = i18n_contexts.operator_default def draw(self, _context): layout = self.layout @@ -6183,6 +6185,7 @@ class VIEW3D_MT_edit_greasepencil_point(Menu): class VIEW3D_MT_edit_curves_add(Menu): bl_label = "Add" + bl_translation_context = i18n_contexts.operator_default def draw(self, _context): layout = self.layout diff --git a/source/blender/editors/animation/keyframing.cc b/source/blender/editors/animation/keyframing.cc index c0126d5dc65..87eb4434aae 100644 --- a/source/blender/editors/animation/keyframing.cc +++ b/source/blender/editors/animation/keyframing.cc @@ -767,7 +767,7 @@ static int clear_anim_v3d_invoke(bContext *C, wmOperator *op, const wmEvent * /* op, IFACE_("Remove animation from selected objects?"), nullptr, - IFACE_("Remove"), + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Remove"), ALERT_ICON_NONE, false); } diff --git a/source/blender/editors/geometry/geometry_attributes.cc b/source/blender/editors/geometry/geometry_attributes.cc index 07dcf15b4dd..5e33d2efdc0 100644 --- a/source/blender/editors/geometry/geometry_attributes.cc +++ b/source/blender/editors/geometry/geometry_attributes.cc @@ -279,7 +279,8 @@ static int geometry_attribute_add_invoke(bContext *C, wmOperator *op, const wmEv if (!RNA_property_is_set(op->ptr, prop)) { RNA_property_string_set(op->ptr, prop, DATA_("Attribute")); } - return WM_operator_props_popup_confirm_ex(C, op, event, IFACE_("Add Attribute"), IFACE_("Add")); + return WM_operator_props_popup_confirm_ex( + C, op, event, IFACE_("Add Attribute"), CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add")); } void GEOMETRY_OT_attribute_add(wmOperatorType *ot) @@ -399,8 +400,11 @@ static int geometry_color_attribute_add_invoke(bContext *C, wmOperator *op, cons if (!RNA_property_is_set(op->ptr, prop)) { RNA_property_string_set(op->ptr, prop, DATA_("Color")); } - return WM_operator_props_popup_confirm_ex( - C, op, event, IFACE_("Add Color Attribute"), IFACE_("Add")); + return WM_operator_props_popup_confirm_ex(C, + op, + event, + IFACE_("Add Color Attribute"), + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add")); } enum class ConvertAttributeMode { diff --git a/source/blender/editors/gpencil_legacy/gpencil_utils.cc b/source/blender/editors/gpencil_legacy/gpencil_utils.cc index 1433414658d..72121b0ea42 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_utils.cc +++ b/source/blender/editors/gpencil_legacy/gpencil_utils.cc @@ -3430,7 +3430,11 @@ int ED_gpencil_new_layer_dialog(bContext *C, wmOperator *op) bGPdata *gpd = static_cast(ob->data); gpencil_layer_new_name_get(gpd, name, sizeof(name)); RNA_property_string_set(op->ptr, prop, name); - return WM_operator_props_dialog_popup(C, op, 200, IFACE_("Add New Layer"), IFACE_("Add")); + return WM_operator_props_dialog_popup(C, + op, + 200, + IFACE_("Add New Layer"), + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add")); } } return 0; diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc index b2f3053d054..cd1985fc1ae 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc @@ -71,8 +71,11 @@ static int grease_pencil_layer_add_exec(bContext *C, wmOperator *op) static int grease_pencil_layer_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - return WM_operator_props_popup_confirm_ex( - C, op, event, IFACE_("Add New Grease Pencil Layer"), IFACE_("Add")); + return WM_operator_props_popup_confirm_ex(C, + op, + event, + IFACE_("Add New Grease Pencil Layer"), + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add")); } static void GREASE_PENCIL_OT_layer_add(wmOperatorType *ot) diff --git a/source/blender/editors/object/object_add.cc b/source/blender/editors/object/object_add.cc index 34cd5a3d7f6..e05e702af04 100644 --- a/source/blender/editors/object/object_add.cc +++ b/source/blender/editors/object/object_add.cc @@ -2964,11 +2964,12 @@ void OBJECT_OT_duplicates_make_real(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - RNA_def_boolean(ot->srna, - "use_base_parent", - false, - "Parent", - "Parent newly created objects to the original instancer"); + ot->prop = RNA_def_boolean(ot->srna, + "use_base_parent", + false, + "Parent", + "Parent newly created objects to the original instancer"); + RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_OPERATOR_DEFAULT); RNA_def_boolean( ot->srna, "use_hierarchy", false, "Keep Hierarchy", "Maintain parent child relationships"); } diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.cc b/source/blender/editors/sculpt_paint/paint_image_proj.cc index b77cfe59bb6..97637285af7 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.cc +++ b/source/blender/editors/sculpt_paint/paint_image_proj.cc @@ -6835,7 +6835,8 @@ static int texture_paint_add_texture_paint_slot_invoke(bContext *C, default_paint_slot_color_get(type, ma, color); RNA_float_set_array(op->ptr, "color", color); - return WM_operator_props_dialog_popup(C, op, 300, IFACE_("Add Paint Slot"), IFACE_("Add")); + return WM_operator_props_dialog_popup( + C, op, 300, IFACE_("Add Paint Slot"), CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add")); } static void texture_paint_add_texture_paint_slot_ui(bContext *C, wmOperator *op) diff --git a/source/blender/editors/space_image/image_ops.cc b/source/blender/editors/space_image/image_ops.cc index d5468466b77..5fd9f9fdfc3 100644 --- a/source/blender/editors/space_image/image_ops.cc +++ b/source/blender/editors/space_image/image_ops.cc @@ -4257,7 +4257,11 @@ static int tile_add_invoke(bContext *C, wmOperator *op, const wmEvent * /*event* RNA_int_set(op->ptr, "count", 1); RNA_string_set(op->ptr, "label", ""); - return WM_operator_props_dialog_popup(C, op, 300, IFACE_("Add Tile to Image"), IFACE_("Add")); + return WM_operator_props_dialog_popup(C, + op, + 300, + IFACE_("Add Tile to Image"), + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add")); } static void tile_add_draw(bContext * /*C*/, wmOperator *op) diff --git a/source/blender/editors/space_node/node_templates.cc b/source/blender/editors/space_node/node_templates.cc index 5bdca8915d5..1b9fccf965f 100644 --- a/source/blender/editors/space_node/node_templates.cc +++ b/source/blender/editors/space_node/node_templates.cc @@ -635,7 +635,7 @@ static void ui_template_node_link_menu(bContext *C, uiLayout *layout, void *but_ but = uiDefBut(block, UI_BTYPE_BUT, 0, - IFACE_("Remove"), + CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Remove"), 0, 0, UI_UNIT_X * 4, diff --git a/source/blender/makesrna/intern/rna_brush.cc b/source/blender/makesrna/intern/rna_brush.cc index 9ee827f9bf7..78383bf6614 100644 --- a/source/blender/makesrna/intern/rna_brush.cc +++ b/source/blender/makesrna/intern/rna_brush.cc @@ -2248,6 +2248,7 @@ static void rna_def_curves_sculpt_options(BlenderRNA *brna) RNA_def_property_enum_items(prop, density_mode_items); RNA_def_property_ui_text( prop, "Density Mode", "Determines whether the brush adds or removes curves"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_OPERATOR_DEFAULT); prop = RNA_def_property(srna, "curve_parameter_falloff", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "CurveMapping"); diff --git a/source/blender/makesrna/intern/rna_nodetree.cc b/source/blender/makesrna/intern/rna_nodetree.cc index 73d884bc7f2..2f59e75d0c4 100644 --- a/source/blender/makesrna/intern/rna_nodetree.cc +++ b/source/blender/makesrna/intern/rna_nodetree.cc @@ -5039,6 +5039,7 @@ static void def_sh_tex_noise(StructRNA *srna) RNA_def_property_enum_sdna(prop, nullptr, "dimensions"); RNA_def_property_enum_items(prop, rna_enum_node_tex_dimensions_items); RNA_def_property_ui_text(prop, "Dimensions", "Number of dimensions to output noise for"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_TEXTURE); RNA_def_property_update(prop, 0, "rna_ShaderNode_socket_update"); prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); @@ -5155,6 +5156,7 @@ static void def_sh_tex_voronoi(StructRNA *srna) RNA_def_property_enum_sdna(prop, nullptr, "dimensions"); RNA_def_property_enum_items(prop, rna_enum_node_tex_dimensions_items); RNA_def_property_ui_text(prop, "Dimensions", "Number of dimensions to output noise for"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_TEXTURE); RNA_def_property_update(prop, 0, "rna_ShaderNode_socket_update"); prop = RNA_def_property(srna, "distance", PROP_ENUM, PROP_NONE); @@ -5250,6 +5252,7 @@ static void def_sh_tex_white_noise(StructRNA *srna) RNA_def_property_enum_sdna(prop, nullptr, "custom1"); RNA_def_property_enum_items(prop, rna_enum_node_tex_dimensions_items); RNA_def_property_ui_text(prop, "Dimensions", "Number of dimensions to output noise for"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_TEXTURE); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNode_socket_update"); } @@ -8564,6 +8567,7 @@ static void def_cmp_cryptomatte_common(StructRNA *srna) RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_text( prop, "Add", "Add object or material to matte, by picking a color from the Pick output"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_OPERATOR_DEFAULT); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeCryptomatte_update_add"); prop = RNA_def_property(srna, "remove", PROP_FLOAT, PROP_COLOR); @@ -8574,6 +8578,7 @@ static void def_cmp_cryptomatte_common(StructRNA *srna) prop, "Remove", "Remove object or material from matte, by picking a color from the Pick output"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_OPERATOR_DEFAULT); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeCryptomatte_update_remove"); } diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 6c9da42a334..c0842acfb5d 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -2242,7 +2242,7 @@ static void draw_named_attributes_panel(uiLayout *layout, NodesModifierData &nmd usages.append(IFACE_("Write")); } if ((usage & geo_log::NamedAttributeUsage::Remove) != geo_log::NamedAttributeUsage::None) { - usages.append(IFACE_("Remove")); + usages.append(CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Remove")); } for (const int i : usages.index_range()) { ss << usages[i]; diff --git a/source/blender/nodes/geometry/nodes/node_geo_get_named_grid.cc b/source/blender/nodes/geometry/nodes/node_geo_get_named_grid.cc index 28e7ad65868..3ddfe11ea0c 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_get_named_grid.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_get_named_grid.cc @@ -7,6 +7,8 @@ #include "BKE_volume.hh" #include "BKE_volume_grid.hh" +#include "BLT_translation.hh" + #include "RNA_enum_types.hh" #include "NOD_rna_define.hh" @@ -20,7 +22,8 @@ static void node_declare(NodeDeclarationBuilder &b) { b.add_input("Volume"); b.add_input("Name"); - b.add_input("Remove").default_value(true); + b.add_input("Remove").default_value(true).translation_context( + BLT_I18NCONTEXT_OPERATOR_DEFAULT); b.add_output("Volume");