diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 1c039f5f3e7..88e34a9b56f 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -2090,8 +2090,8 @@ class CYCLES_RENDER_PT_bake_influence(CyclesButtonsPanel, Panel): sub = col.column(align=True) sub.prop(cbk, "normal_r", text="Swizzle R") - sub.prop(cbk, "normal_g", text="G") - sub.prop(cbk, "normal_b", text="B") + sub.prop(cbk, "normal_g", text="G", text_ctxt=i18n_contexts.color) + sub.prop(cbk, "normal_b", text="B", text_ctxt=i18n_contexts.color) elif cscene.bake_type == 'COMBINED': diff --git a/scripts/modules/bl_text_utils/external_editor.py b/scripts/modules/bl_text_utils/external_editor.py index 7929cdd674a..4c0157a812e 100644 --- a/scripts/modules/bl_text_utils/external_editor.py +++ b/scripts/modules/bl_text_utils/external_editor.py @@ -14,6 +14,7 @@ def open_external_editor(filepath, line, column, /): import subprocess from string import Template from bpy import context + from bpy.app.translations import pgettext_rpt as rpt_ text_editor = context.preferences.filepaths.text_editor text_editor_args = context.preferences.filepaths.text_editor_args @@ -22,13 +23,13 @@ def open_external_editor(filepath, line, column, /): assert text_editor if not text_editor_args: - return ( + return rpt_( "Provide text editor argument format in File Paths/Applications Preferences, " "see input field tool-tip for more information", ) if "$filepath" not in text_editor_args: - return "Text Editor Args Format must contain $filepath" + return rpt_("Text Editor Args Format must contain $filepath") args = [text_editor] template_vars = { @@ -42,12 +43,12 @@ def open_external_editor(filepath, line, column, /): try: args.extend([Template(arg).substitute(**template_vars) for arg in shlex.split(text_editor_args)]) except BaseException as ex: - return "Exception parsing template: %r" % ex + return rpt_("Exception parsing template: %r") % ex try: # With `check=True` if `process.returncode != 0` an exception will be raised. subprocess.run(args, check=True) except BaseException as ex: - return "Exception running external editor: %r" % ex + return rpt_("Exception running external editor: %r") % ex return "" diff --git a/scripts/startup/bl_operators/node.py b/scripts/startup/bl_operators/node.py index 133ff608db7..cc6383c89ff 100644 --- a/scripts/startup/bl_operators/node.py +++ b/scripts/startup/bl_operators/node.py @@ -23,6 +23,7 @@ from mathutils import ( from bpy.app.translations import ( pgettext_tip as tip_, pgettext_rpt as rpt_, + pgettext_data as data_, ) @@ -394,7 +395,7 @@ class NODE_OT_enum_definition_item_add(Operator): def execute(self, context): node = context.active_node enum_def = node.enum_definition - item = enum_def.enum_items.new("Item") + item = enum_def.enum_items.new(data_("Item")) enum_def.active_index = enum_def.enum_items[:].index(item) return {'FINISHED'} diff --git a/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 03bea1e63ec..ede703fb5cd 100644 --- a/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -6,6 +6,7 @@ from bpy.types import ( Panel, UIList, ) +from bpy.app.translations import contexts as i18n_contexts from bl_ui.properties_physics_common import ( point_cache_ui, effector_weights_ui, @@ -307,6 +308,7 @@ class PHYSICS_PT_dp_surface_canvas_paint_dry(PhysicButtonsPanel, Panel): class PHYSICS_PT_dp_surface_canvas_paint_dissolve(PhysicButtonsPanel, Panel): bl_label = "Dissolve" + bl_translation_context = i18n_contexts.id_simulation bl_parent_id = "PHYSICS_PT_dp_surface_canvas" bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = { diff --git a/scripts/startup/bl_ui/properties_physics_fluid.py b/scripts/startup/bl_ui/properties_physics_fluid.py index a642c9d810e..579fd073b06 100644 --- a/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/scripts/startup/bl_ui/properties_physics_fluid.py @@ -4,6 +4,7 @@ import bpy from bpy.types import Panel +from bpy.app.translations import contexts as i18n_contexts from bl_ui.utils import PresetPanel from bl_ui.properties_physics_common import ( effector_weights_ui, @@ -369,6 +370,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): class PHYSICS_PT_smoke_dissolve(PhysicButtonsPanel, Panel): bl_label = "Dissolve" + bl_translation_context = i18n_contexts.id_volume bl_parent_id = "PHYSICS_PT_smoke" bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = { diff --git a/scripts/startup/bl_ui/properties_texture.py b/scripts/startup/bl_ui/properties_texture.py index 6eb595346f6..0c758b7ad50 100644 --- a/scripts/startup/bl_ui/properties_texture.py +++ b/scripts/startup/bl_ui/properties_texture.py @@ -904,8 +904,8 @@ class TEXTURE_PT_colors(TextureButtonsPanel, TextureColorsPoll, Panel): col = flow.column(align=True) col.prop(tex, "factor_red", text="Multiply R") - col.prop(tex, "factor_green", text="G") - col.prop(tex, "factor_blue", text="B") + col.prop(tex, "factor_green", text="G", text_ctxt=i18n_contexts.color) + col.prop(tex, "factor_blue", text="B", text_ctxt=i18n_contexts.color) col.separator() diff --git a/scripts/startup/bl_ui/space_clip.py b/scripts/startup/bl_ui/space_clip.py index 719161b9069..3e29c0aeb1c 100644 --- a/scripts/startup/bl_ui/space_clip.py +++ b/scripts/startup/bl_ui/space_clip.py @@ -88,9 +88,9 @@ class CLIP_PT_clip_display(Panel): col = layout.column(align=True) row = layout.row(align=True) - row.prop(sc, "show_red_channel", text="R", toggle=True) - row.prop(sc, "show_green_channel", text="G", toggle=True) - row.prop(sc, "show_blue_channel", text="B", toggle=True) + row.prop(sc, "show_red_channel", text="R", text_ctxt=i18n_contexts.color, toggle=True) + row.prop(sc, "show_green_channel", text="G", text_ctxt=i18n_contexts.color, toggle=True) + row.prop(sc, "show_blue_channel", text="B", text_ctxt=i18n_contexts.color, toggle=True) row.separator() row.prop(sc, "use_grayscale_preview", text="B/W", toggle=True) row.separator() @@ -429,9 +429,9 @@ class CLIP_PT_tracking_settings(CLIP_PT_tracking_panel, Panel): row = col.row(align=True) row.use_property_split = False - row.prop(settings, "use_default_red_channel", text="R", toggle=True) - row.prop(settings, "use_default_green_channel", text="G", toggle=True) - row.prop(settings, "use_default_blue_channel", text="B", toggle=True) + row.prop(settings, "use_default_red_channel", text="R", text_ctxt=i18n_contexts.color, toggle=True) + row.prop(settings, "use_default_green_channel", text="G", text_ctxt=i18n_contexts.color, toggle=True) + row.prop(settings, "use_default_blue_channel", text="B", text_ctxt=i18n_contexts.color, toggle=True) col.separator() col.operator("clip.track_settings_as_default", text="Copy from Active Track") @@ -744,9 +744,9 @@ class CLIP_PT_track(CLIP_PT_tracking_panel, Panel): row = layout.row(align=True) sub = row.row(align=True) - sub.prop(act_track, "use_red_channel", text="R", toggle=True) - sub.prop(act_track, "use_green_channel", text="G", toggle=True) - sub.prop(act_track, "use_blue_channel", text="B", toggle=True) + sub.prop(act_track, "use_red_channel", text="R", text_ctxt=i18n_contexts.color, toggle=True) + sub.prop(act_track, "use_green_channel", text="G", text_ctxt=i18n_contexts.color, toggle=True) + sub.prop(act_track, "use_blue_channel", text="B", text_ctxt=i18n_contexts.color, toggle=True) row.separator() diff --git a/scripts/startup/bl_ui/space_userpref.py b/scripts/startup/bl_ui/space_userpref.py index e3ffa71a23f..3480653f38b 100644 --- a/scripts/startup/bl_ui/space_userpref.py +++ b/scripts/startup/bl_ui/space_userpref.py @@ -260,7 +260,7 @@ class USERPREF_PT_interface_translation(InterfacePanel, CenterAlignMixIn, Panel) layout.prop(view, "language") - col = layout.column(heading="Translate") + col = layout.column(heading="Translate", heading_ctxt=i18n_contexts.editor_preferences) col.active = (bpy.app.translations.locale != "en_US") col.prop(view, "use_translate_tooltips", text="Tooltips") col.prop(view, "use_translate_interface", text="Interface") diff --git a/source/blender/blenkernel/intern/tracking.cc b/source/blender/blenkernel/intern/tracking.cc index 08fd10de602..2df2809f333 100644 --- a/source/blender/blenkernel/intern/tracking.cc +++ b/source/blender/blenkernel/intern/tracking.cc @@ -1574,7 +1574,7 @@ MovieTrackingPlaneTrack *BKE_tracking_plane_track_add(MovieTracking *tracking, plane_track = MEM_cnew("new plane track"); /* Use some default name. */ - STRNCPY(plane_track->name, "Plane Track"); + STRNCPY(plane_track->name, DATA_("Plane Track")); plane_track->image_opacity = 1.0f; diff --git a/source/blender/blentranslation/BLT_translation.hh b/source/blender/blentranslation/BLT_translation.hh index 00378ab489d..c95186b38ee 100644 --- a/source/blender/blentranslation/BLT_translation.hh +++ b/source/blender/blentranslation/BLT_translation.hh @@ -130,8 +130,9 @@ const char *BLT_translate_do_new_dataname(const char *msgctxt, const char *msgid #define BLT_I18NCONTEXT_ID_WORLD "World" /* Editors-types contexts. */ -#define BLT_I18NCONTEXT_EDITOR_PYTHON_CONSOLE "Python console" #define BLT_I18NCONTEXT_EDITOR_FILEBROWSER "File browser" +#define BLT_I18NCONTEXT_EDITOR_PREFERENCES "Preferences" +#define BLT_I18NCONTEXT_EDITOR_PYTHON_CONSOLE "Python console" #define BLT_I18NCONTEXT_EDITOR_VIEW3D "View3D" /* Generic contexts. */ @@ -203,8 +204,9 @@ struct BLT_i18n_contexts_descriptor { BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_WINDOWMANAGER, "id_windowmanager"), \ BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_WORKSPACE, "id_workspace"), \ BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_WORLD, "id_world"), \ - BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_EDITOR_PYTHON_CONSOLE, "editor_python_console"), \ BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_EDITOR_FILEBROWSER, "editor_filebrowser"), \ + BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_EDITOR_PYTHON_CONSOLE, "editor_python_console"), \ + BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_EDITOR_PREFERENCES, "editor_preferences"), \ BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_EDITOR_VIEW3D, "editor_view3d"), \ BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_AMOUNT, "amount"), \ BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_COLOR, "color"), \ diff --git a/source/blender/editors/gpencil_legacy/gpencil_edit.cc b/source/blender/editors/gpencil_legacy/gpencil_edit.cc index 4b36accfa1f..e4d2b37b529 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_edit.cc +++ b/source/blender/editors/gpencil_legacy/gpencil_edit.cc @@ -2856,6 +2856,7 @@ void GPENCIL_OT_dissolve(wmOperatorType *ot) 0, "Type", "Method used for dissolving stroke points"); + RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_GPENCIL); } /** \} */ diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc index 35388061340..f38dde87290 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc @@ -644,6 +644,7 @@ static void GREASE_PENCIL_OT_dissolve(wmOperatorType *ot) "Type", "Method used for dissolving stroke points"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_GPENCIL); } /** \} */ diff --git a/source/blender/editors/interface/templates/interface_templates.cc b/source/blender/editors/interface/templates/interface_templates.cc index c0adf21945d..1c0f36c9333 100644 --- a/source/blender/editors/interface/templates/interface_templates.cc +++ b/source/blender/editors/interface/templates/interface_templates.cc @@ -4538,15 +4538,48 @@ static void curvemap_buttons_layout(uiLayout *layout, UI_but_func_set(bt, curvemap_buttons_redraw); } if (cumap->cm[0].curve) { - bt = uiDefButI(block, UI_BTYPE_ROW, 0, IFACE_("R"), 0, 0, dx, dx, &cumap->cur, 0.0, 0.0, ""); + bt = uiDefButI(block, + UI_BTYPE_ROW, + 0, + CTX_IFACE_(BLT_I18NCONTEXT_COLOR, "R"), + 0, + 0, + dx, + dx, + &cumap->cur, + 0.0, + 0.0, + ""); UI_but_func_set(bt, curvemap_buttons_redraw); } if (cumap->cm[1].curve) { - bt = uiDefButI(block, UI_BTYPE_ROW, 0, IFACE_("G"), 0, 0, dx, dx, &cumap->cur, 0.0, 1.0, ""); + bt = uiDefButI(block, + UI_BTYPE_ROW, + 0, + CTX_IFACE_(BLT_I18NCONTEXT_COLOR, "G"), + 0, + 0, + dx, + dx, + &cumap->cur, + 0.0, + 1.0, + ""); UI_but_func_set(bt, curvemap_buttons_redraw); } if (cumap->cm[2].curve) { - bt = uiDefButI(block, UI_BTYPE_ROW, 0, IFACE_("B"), 0, 0, dx, dx, &cumap->cur, 0.0, 2.0, ""); + bt = uiDefButI(block, + UI_BTYPE_ROW, + 0, + CTX_IFACE_(BLT_I18NCONTEXT_COLOR, "B"), + 0, + 0, + dx, + dx, + &cumap->cur, + 0.0, + 2.0, + ""); UI_but_func_set(bt, curvemap_buttons_redraw); } } diff --git a/source/blender/editors/io/io_drop_import_file.cc b/source/blender/editors/io/io_drop_import_file.cc index 923d6fe654b..04ec760f812 100644 --- a/source/blender/editors/io/io_drop_import_file.cc +++ b/source/blender/editors/io/io_drop_import_file.cc @@ -143,7 +143,7 @@ static int wm_drop_import_file_invoke(bContext *C, wmOperator *op, const wmEvent wmOperatorType *ot = WM_operatortype_find(file_handler->import_operator, false); uiItemFullO_ptr(layout, ot, - TIP_(ot->name), + CTX_TIP_(ot->translation_context, ot->name), ICON_NONE, static_cast(file_props.data), WM_OP_INVOKE_DEFAULT, diff --git a/source/blender/editors/object/object_bake_api.cc b/source/blender/editors/object/object_bake_api.cc index 3499dfe5438..27edf33d120 100644 --- a/source/blender/editors/object/object_bake_api.cc +++ b/source/blender/editors/object/object_bake_api.cc @@ -23,6 +23,8 @@ #include "BLI_path_util.h" #include "BLI_string.h" +#include "BLT_translation.hh" + #include "BKE_attribute.hh" #include "BKE_callbacks.hh" #include "BKE_context.hh" @@ -2255,24 +2257,27 @@ void OBJECT_OT_bake(wmOperatorType *ot) R_BAKE_SPACE_TANGENT, "Normal Space", "Choose normal space for baking"); - RNA_def_enum(ot->srna, - "normal_r", - rna_enum_normal_swizzle_items, - R_BAKE_POSX, - "R", - "Axis to bake in red channel"); - RNA_def_enum(ot->srna, - "normal_g", - rna_enum_normal_swizzle_items, - R_BAKE_POSY, - "G", - "Axis to bake in green channel"); - RNA_def_enum(ot->srna, - "normal_b", - rna_enum_normal_swizzle_items, - R_BAKE_POSZ, - "B", - "Axis to bake in blue channel"); + prop = RNA_def_enum(ot->srna, + "normal_r", + rna_enum_normal_swizzle_items, + R_BAKE_POSX, + "R", + "Axis to bake in red channel"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_COLOR); + prop = RNA_def_enum(ot->srna, + "normal_g", + rna_enum_normal_swizzle_items, + R_BAKE_POSY, + "G", + "Axis to bake in green channel"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_COLOR); + prop = RNA_def_enum(ot->srna, + "normal_b", + rna_enum_normal_swizzle_items, + R_BAKE_POSZ, + "B", + "Axis to bake in blue channel"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_COLOR); RNA_def_enum(ot->srna, "target", rna_enum_bake_target_items, diff --git a/source/blender/editors/transform/transform_orientations.cc b/source/blender/editors/transform/transform_orientations.cc index 18348c92d77..af609e33ed8 100644 --- a/source/blender/editors/transform/transform_orientations.cc +++ b/source/blender/editors/transform/transform_orientations.cc @@ -112,7 +112,7 @@ static TransformOrientation *createViewSpace(bContext *C, name = v3d->camera->id.name + 2; } else { - name = "Custom View"; + name = DATA_("Custom View"); } } @@ -161,7 +161,7 @@ static TransformOrientation *createBoneSpace(bContext *C, } if (name[0] == 0) { - name = "Bone"; + name = DATA_("Bone"); } return addMatrixSpace(C, mat, name, overwrite); @@ -183,7 +183,7 @@ static TransformOrientation *createCurveSpace(bContext *C, } if (name[0] == 0) { - name = "Curve"; + name = DATA_("Curve"); } return addMatrixSpace(C, mat, name, overwrite); @@ -208,7 +208,7 @@ static TransformOrientation *createMeshSpace(bContext *C, } if (name[0] == 0) { - name = "Vertex"; + name = DATA_("Vertex"); } break; case ORIENTATION_EDGE: @@ -218,7 +218,7 @@ static TransformOrientation *createMeshSpace(bContext *C, } if (name[0] == 0) { - name = "Edge"; + name = DATA_("Edge"); } break; case ORIENTATION_FACE: @@ -228,7 +228,7 @@ static TransformOrientation *createMeshSpace(bContext *C, } if (name[0] == 0) { - name = "Face"; + name = DATA_("Face"); } break; default: diff --git a/source/blender/makesrna/intern/rna_brush.cc b/source/blender/makesrna/intern/rna_brush.cc index 9b52290d733..aa7d57bea8c 100644 --- a/source/blender/makesrna/intern/rna_brush.cc +++ b/source/blender/makesrna/intern/rna_brush.cc @@ -1950,6 +1950,7 @@ static void rna_def_gpencil_options(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, nullptr, "eraser_mode"); RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_eraser_modes_items); RNA_def_property_ui_text(prop, "Mode", "Eraser Mode"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_GPENCIL); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update( prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_eraser_mode_update"); diff --git a/source/blender/makesrna/intern/rna_color.cc b/source/blender/makesrna/intern/rna_color.cc index bf027e3ffa1..9466258c7c0 100644 --- a/source/blender/makesrna/intern/rna_color.cc +++ b/source/blender/makesrna/intern/rna_color.cc @@ -14,6 +14,8 @@ #include "BLI_utildefines.h" +#include "BLT_translation.hh" + #include "BKE_node_tree_update.hh" #include "RNA_define.hh" @@ -1121,6 +1123,7 @@ static void rna_def_histogram(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, nullptr, "mode"); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Mode", "Channels to display in the histogram"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_COLOR); prop = RNA_def_property(srna, "show_line", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, nullptr, "flag", HISTO_FLAG_LINE); diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.cc b/source/blender/makesrna/intern/rna_dynamicpaint.cc index 693bea6ad44..c486920a7d9 100644 --- a/source/blender/makesrna/intern/rna_dynamicpaint.cc +++ b/source/blender/makesrna/intern/rna_dynamicpaint.cc @@ -409,6 +409,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) prop = RNA_def_property(srna, "use_dissolve", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, nullptr, "flags", MOD_DPAINT_DISSOLVE); RNA_def_property_ui_text(prop, "Dissolve", "Enable to make surface changes disappear over time"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SIMULATION); prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, nullptr, "diss_speed"); diff --git a/source/blender/makesrna/intern/rna_modifier.cc b/source/blender/makesrna/intern/rna_modifier.cc index 63263b41067..30a9aabf341 100644 --- a/source/blender/makesrna/intern/rna_modifier.cc +++ b/source/blender/makesrna/intern/rna_modifier.cc @@ -2894,6 +2894,7 @@ static void rna_def_modifier_decimate(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, nullptr, "mode"); RNA_def_property_enum_items(prop, modifier_decim_mode_items); RNA_def_property_ui_text(prop, "Mode", ""); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MESH); RNA_def_property_update(prop, 0, "rna_Modifier_update"); /* (mode == MOD_DECIM_MODE_COLLAPSE) */ diff --git a/source/blender/makesrna/intern/rna_nodetree.cc b/source/blender/makesrna/intern/rna_nodetree.cc index 5c9a06bd9d3..7fa6e172147 100644 --- a/source/blender/makesrna/intern/rna_nodetree.cc +++ b/source/blender/makesrna/intern/rna_nodetree.cc @@ -6782,6 +6782,7 @@ static void def_cmp_color_spill(StructRNA *srna) RNA_def_property_enum_sdna(prop, nullptr, "custom1"); RNA_def_property_enum_items(prop, channel_items); RNA_def_property_ui_text(prop, "Channel", ""); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_COLOR); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "limit_method", PROP_ENUM, PROP_NONE); @@ -6796,6 +6797,7 @@ static void def_cmp_color_spill(StructRNA *srna) RNA_def_property_enum_sdna(prop, nullptr, "limchan"); RNA_def_property_enum_items(prop, limit_channel_items); RNA_def_property_ui_text(prop, "Limit Channel", ""); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_COLOR); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "ratio", PROP_FLOAT, PROP_NONE); @@ -6813,18 +6815,21 @@ static void def_cmp_color_spill(StructRNA *srna) RNA_def_property_float_sdna(prop, nullptr, "uspillr"); RNA_def_property_range(prop, 0.0f, 1.5f); RNA_def_property_ui_text(prop, "R", "Red spillmap scale"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_COLOR); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "unspill_green", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, nullptr, "uspillg"); RNA_def_property_range(prop, 0.0f, 1.5f); RNA_def_property_ui_text(prop, "G", "Green spillmap scale"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_COLOR); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "unspill_blue", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, nullptr, "uspillb"); RNA_def_property_range(prop, 0.0f, 1.5f); RNA_def_property_ui_text(prop, "B", "Blue spillmap scale"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_COLOR); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } @@ -6930,6 +6935,7 @@ static void def_cmp_channel_matte(StructRNA *srna) RNA_def_property_enum_items(prop, prop_tri_channel_items); RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_Node_channel_itemf"); RNA_def_property_ui_text(prop, "Channel", "Channel used to determine matte"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_COLOR); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); RNA_def_struct_sdna_from(srna, "NodeChroma", "storage"); @@ -6945,6 +6951,7 @@ static void def_cmp_channel_matte(StructRNA *srna) RNA_def_property_enum_items(prop, prop_tri_channel_items); RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_Node_channel_itemf"); RNA_def_property_ui_text(prop, "Limit Channel", "Limit by this channel's value"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_COLOR); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcomb_hsva.cc b/source/blender/nodes/composite/nodes/node_composite_sepcomb_hsva.cc index b51daf10885..9cff2188888 100644 --- a/source/blender/nodes/composite/nodes/node_composite_sepcomb_hsva.cc +++ b/source/blender/nodes/composite/nodes/node_composite_sepcomb_hsva.cc @@ -21,10 +21,10 @@ static void cmp_node_sephsva_declare(NodeDeclarationBuilder &b) b.add_input("Image") .default_value({1.0f, 1.0f, 1.0f, 1.0f}) .compositor_domain_priority(0); - b.add_output("H"); - b.add_output("S"); - b.add_output("V"); - b.add_output("A"); + b.add_output("H").translation_context(BLT_I18NCONTEXT_COLOR); + b.add_output("S").translation_context(BLT_I18NCONTEXT_COLOR); + b.add_output("V").translation_context(BLT_I18NCONTEXT_COLOR); + b.add_output("A").translation_context(BLT_I18NCONTEXT_COLOR); } using namespace blender::realtime_compositor; @@ -70,11 +70,27 @@ namespace blender::nodes::node_composite_combine_hsva_cc { static void cmp_node_combhsva_declare(NodeDeclarationBuilder &b) { - b.add_input("H").min(0.0f).max(1.0f).compositor_domain_priority(0); - b.add_input("S").min(0.0f).max(1.0f).compositor_domain_priority(1); - b.add_input("V").min(0.0f).max(1.0f).compositor_domain_priority(2); - b.add_input("A").default_value(1.0f).min(0.0f).max(1.0f).compositor_domain_priority( - 3); + b.add_input("H") + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(0) + .translation_context(BLT_I18NCONTEXT_COLOR); + b.add_input("S") + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(1) + .translation_context(BLT_I18NCONTEXT_COLOR); + b.add_input("V") + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(2) + .translation_context(BLT_I18NCONTEXT_COLOR); + b.add_input("A") + .default_value(1.0f) + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(3) + .translation_context(BLT_I18NCONTEXT_COLOR); b.add_output("Image"); } diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcomb_rgba.cc b/source/blender/nodes/composite/nodes/node_composite_sepcomb_rgba.cc index fbd02ab3dda..5c6a84108e1 100644 --- a/source/blender/nodes/composite/nodes/node_composite_sepcomb_rgba.cc +++ b/source/blender/nodes/composite/nodes/node_composite_sepcomb_rgba.cc @@ -21,10 +21,10 @@ static void cmp_node_seprgba_declare(NodeDeclarationBuilder &b) b.add_input("Image") .default_value({1.0f, 1.0f, 1.0f, 1.0f}) .compositor_domain_priority(0); - b.add_output("R"); - b.add_output("G"); - b.add_output("B"); - b.add_output("A"); + b.add_output("R").translation_context(BLT_I18NCONTEXT_COLOR); + b.add_output("G").translation_context(BLT_I18NCONTEXT_COLOR); + b.add_output("B").translation_context(BLT_I18NCONTEXT_COLOR); + b.add_output("A").translation_context(BLT_I18NCONTEXT_COLOR); } using namespace blender::realtime_compositor; @@ -70,11 +70,27 @@ namespace blender::nodes::node_composite_combine_rgba_cc { static void cmp_node_combrgba_declare(NodeDeclarationBuilder &b) { - b.add_input("R").min(0.0f).max(1.0f).compositor_domain_priority(0); - b.add_input("G").min(0.0f).max(1.0f).compositor_domain_priority(1); - b.add_input("B").min(0.0f).max(1.0f).compositor_domain_priority(2); - b.add_input("A").default_value(1.0f).min(0.0f).max(1.0f).compositor_domain_priority( - 3); + b.add_input("R") + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(0) + .translation_context(BLT_I18NCONTEXT_COLOR); + b.add_input("G") + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(1) + .translation_context(BLT_I18NCONTEXT_COLOR); + b.add_input("B") + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(2) + .translation_context(BLT_I18NCONTEXT_COLOR); + b.add_input("A") + .default_value(1.0f) + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(3) + .translation_context(BLT_I18NCONTEXT_COLOR); b.add_output("Image"); } diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcomb_ycca.cc b/source/blender/nodes/composite/nodes/node_composite_sepcomb_ycca.cc index 5eefb7fbf00..cb83c561014 100644 --- a/source/blender/nodes/composite/nodes/node_composite_sepcomb_ycca.cc +++ b/source/blender/nodes/composite/nodes/node_composite_sepcomb_ycca.cc @@ -23,10 +23,10 @@ static void cmp_node_sepycca_declare(NodeDeclarationBuilder &b) b.add_input("Image") .default_value({1.0f, 1.0f, 1.0f, 1.0f}) .compositor_domain_priority(0); - b.add_output("Y"); + b.add_output("Y").translation_context(BLT_I18NCONTEXT_COLOR); b.add_output("Cb"); b.add_output("Cr"); - b.add_output("A"); + b.add_output("A").translation_context(BLT_I18NCONTEXT_COLOR); } static void node_composit_init_mode_sepycca(bNodeTree * /*ntree*/, bNode *node) @@ -98,7 +98,11 @@ namespace blender::nodes::node_composite_combine_ycca_cc { static void cmp_node_combycca_declare(NodeDeclarationBuilder &b) { - b.add_input("Y").min(0.0f).max(1.0f).compositor_domain_priority(0); + b.add_input("Y") + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(0) + .translation_context(BLT_I18NCONTEXT_COLOR); b.add_input("Cb") .default_value(0.5f) .min(0.0f) @@ -109,8 +113,12 @@ static void cmp_node_combycca_declare(NodeDeclarationBuilder &b) .min(0.0f) .max(1.0f) .compositor_domain_priority(2); - b.add_input("A").default_value(1.0f).min(0.0f).max(1.0f).compositor_domain_priority( - 3); + b.add_input("A") + .default_value(1.0f) + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(3) + .translation_context(BLT_I18NCONTEXT_COLOR); b.add_output("Image"); } diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcomb_yuva.cc b/source/blender/nodes/composite/nodes/node_composite_sepcomb_yuva.cc index f8b4ec41b56..0fd4002676e 100644 --- a/source/blender/nodes/composite/nodes/node_composite_sepcomb_yuva.cc +++ b/source/blender/nodes/composite/nodes/node_composite_sepcomb_yuva.cc @@ -21,10 +21,10 @@ static void cmp_node_sepyuva_declare(NodeDeclarationBuilder &b) b.add_input("Image") .default_value({1.0f, 1.0f, 1.0f, 1.0f}) .compositor_domain_priority(0); - b.add_output("Y"); - b.add_output("U"); - b.add_output("V"); - b.add_output("A"); + b.add_output("Y").translation_context(BLT_I18NCONTEXT_COLOR); + b.add_output("U").translation_context(BLT_I18NCONTEXT_COLOR); + b.add_output("V").translation_context(BLT_I18NCONTEXT_COLOR); + b.add_output("A").translation_context(BLT_I18NCONTEXT_COLOR); } using namespace blender::realtime_compositor; @@ -70,11 +70,27 @@ namespace blender::nodes::node_composite_combine_yuva_cc { static void cmp_node_combyuva_declare(NodeDeclarationBuilder &b) { - b.add_input("Y").min(0.0f).max(1.0f).compositor_domain_priority(0); - b.add_input("U").min(0.0f).max(1.0f).compositor_domain_priority(1); - b.add_input("V").min(0.0f).max(1.0f).compositor_domain_priority(2); - b.add_input("A").default_value(1.0f).min(0.0f).max(1.0f).compositor_domain_priority( - 3); + b.add_input("Y") + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(0) + .translation_context(BLT_I18NCONTEXT_COLOR); + b.add_input("U") + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(1) + .translation_context(BLT_I18NCONTEXT_COLOR); + b.add_input("V") + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(2) + .translation_context(BLT_I18NCONTEXT_COLOR); + b.add_input("A") + .default_value(1.0f) + .min(0.0f) + .max(1.0f) + .compositor_domain_priority(3) + .translation_context(BLT_I18NCONTEXT_COLOR); b.add_output("Image"); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc index 5d18e2c999c..2a5dd853d02 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc @@ -43,7 +43,7 @@ static void node_declare(NodeDeclarationBuilder &b) BLI_assert_unreachable(); break; } - value_declaration->supports_field().description(N_("The values to be accumulated")); + value_declaration->supports_field().description("The values to be accumulated"); } b.add_input("Group ID", "Group Index") @@ -54,15 +54,14 @@ static void node_declare(NodeDeclarationBuilder &b) const eCustomDataType data_type = eCustomDataType(node_storage(*node).data_type); b.add_output(data_type, "Leading") .field_source_reference_all() - .description(N_("The running total of values in the corresponding group, starting at the " - "first value")); + .description( + "The running total of values in the corresponding group, starting at the first value"); b.add_output(data_type, "Trailing") .field_source_reference_all() - .description( - N_("The running total of values in the corresponding group, starting at zero")); + .description("The running total of values in the corresponding group, starting at zero"); b.add_output(data_type, "Total") .field_source_reference_all() - .description(N_("The total of all of the values in the corresponding group")); + .description("The total of all of the values in the corresponding group"); } } diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc index 92cadeae334..6d964f1e329 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc @@ -31,14 +31,14 @@ static void node_declare(NodeDeclarationBuilder &b) const eCustomDataType data_type = eCustomDataType(node->custom1); b.add_input(data_type, "Attribute").hide_value().field_on_all(); - b.add_output(data_type, "Mean"); - b.add_output(data_type, "Median"); - b.add_output(data_type, "Sum"); - b.add_output(data_type, "Min"); - b.add_output(data_type, "Max"); - b.add_output(data_type, "Range"); - b.add_output(data_type, "Standard Deviation"); - b.add_output(data_type, "Variance"); + b.add_output(data_type, N_("Mean")); + b.add_output(data_type, N_("Median")); + b.add_output(data_type, N_("Sum")); + b.add_output(data_type, N_("Min")); + b.add_output(data_type, N_("Max")); + b.add_output(data_type, N_("Range")); + b.add_output(data_type, N_("Standard Deviation")); + b.add_output(data_type, N_("Variance")); } } diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_is_planar.cc b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_is_planar.cc index 46c5b0723f0..0fe558723f1 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_is_planar.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_is_planar.cc @@ -20,7 +20,9 @@ static void node_declare(NodeDeclarationBuilder &b) .description( "The distance a point can be from the surface before the face is no longer " "considered planar"); - b.add_output("Planar").field_source(); + b.add_output("Planar") + .translation_context(BLT_I18NCONTEXT_ID_NODETREE) + .field_source(); } class PlanarFieldInput final : public bke::MeshFieldInput { diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcomb_rgb.cc b/source/blender/nodes/shader/nodes/node_shader_sepcomb_rgb.cc index 0805ac1bb5d..8f4bc4f824d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcomb_rgb.cc +++ b/source/blender/nodes/shader/nodes/node_shader_sepcomb_rgb.cc @@ -18,9 +18,9 @@ static void sh_node_seprgb_declare(NodeDeclarationBuilder &b) { b.is_function_node(); b.add_input("Image").default_value({0.8f, 0.8f, 0.8f, 1.0f}); - b.add_output("R"); - b.add_output("G"); - b.add_output("B"); + b.add_output("R").translation_context(BLT_I18NCONTEXT_COLOR); + b.add_output("G").translation_context(BLT_I18NCONTEXT_COLOR); + b.add_output("B").translation_context(BLT_I18NCONTEXT_COLOR); } static int gpu_shader_seprgb(GPUMaterial *mat, @@ -94,9 +94,9 @@ namespace blender::nodes::node_shader_sepcomb_rgb_cc { static void sh_node_combrgb_declare(NodeDeclarationBuilder &b) { b.is_function_node(); - b.add_input("R").min(0.0f).max(1.0f); - b.add_input("G").min(0.0f).max(1.0f); - b.add_input("B").min(0.0f).max(1.0f); + b.add_input("R").min(0.0f).max(1.0f).translation_context(BLT_I18NCONTEXT_COLOR); + b.add_input("G").min(0.0f).max(1.0f).translation_context(BLT_I18NCONTEXT_COLOR); + b.add_input("B").min(0.0f).max(1.0f).translation_context(BLT_I18NCONTEXT_COLOR); b.add_output("Image"); }