From 564bbdf6e77ac56bfef042d182f4ceafc675c635 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Mon, 4 Sep 2023 16:16:26 +0200 Subject: [PATCH] I18n: disambiguate and extract a few messages This commit disambiguates the following messages: - Sequencer effect strip types: use "Sequence" context in relevant places, as that is already extracted as part of the `sequencer_prop_effect_types` enum, and more specific. - "Language" (a natural or programming language) - "Flat" (gender) - "Smooth" (action or amount -- very partial disambiguation for now because this is all over the place) It also extracts these messages: - Newly created Freestyle data - LineStyle - LineSet - Modifiers - "Registering panel class:" error message from RNA registration - "Node must be run as tool" error message from tool geometry nodes Ref #43295 Pull Request: https://projects.blender.org/blender/blender/pulls/111146 --- scripts/startup/bl_operators/console.py | 2 + scripts/startup/bl_ui/space_sequencer.py | 21 +++++--- source/blender/blenkernel/intern/freestyle.cc | 8 +-- source/blender/blenkernel/intern/linestyle.cc | 2 +- .../blender/blentranslation/BLT_translation.h | 2 + .../blender/editors/render/render_shading.cc | 2 +- .../editors/space_sequencer/sequencer_add.cc | 13 ++--- .../editors/space_sequencer/sequencer_edit.cc | 1 + source/blender/makesrna/intern/rna_brush.cc | 4 ++ .../makesrna/intern/rna_dynamicpaint.cc | 1 + .../makesrna/intern/rna_gpencil_legacy.cc | 2 + .../blender/makesrna/intern/rna_linestyle.cc | 4 ++ source/blender/makesrna/intern/rna_mask.cc | 1 + .../blender/makesrna/intern/rna_material.cc | 1 + .../blender/makesrna/intern/rna_modifier.cc | 1 + .../blender/makesrna/intern/rna_nodetree.cc | 2 + .../blender/makesrna/intern/rna_particle.cc | 1 + source/blender/makesrna/intern/rna_space.cc | 1 + source/blender/makesrna/intern/rna_texture.cc | 1 + source/blender/makesrna/intern/rna_ui.cc | 2 +- .../makesrna/intern/rna_wm_gizmo_api.cc | 9 +++- .../nodes/geometry/node_geometry_util.cc | 2 +- source/blender/sequencer/intern/utils.cc | 50 +++++++++---------- 23 files changed, 86 insertions(+), 47 deletions(-) diff --git a/scripts/startup/bl_operators/console.py b/scripts/startup/bl_operators/console.py index eb0c6b79a86..682fbf5023b 100644 --- a/scripts/startup/bl_operators/console.py +++ b/scripts/startup/bl_operators/console.py @@ -10,6 +10,7 @@ from bpy.props import ( BoolProperty, StringProperty, ) +from bpy.app.translations import contexts as i18n_contexts def _lang_module_get(sc): @@ -126,6 +127,7 @@ class ConsoleLanguage(Operator): language: StringProperty( name="Language", + translation_context=i18n_contexts.editor_python_console, maxlen=32, ) diff --git a/scripts/startup/bl_ui/space_sequencer.py b/scripts/startup/bl_ui/space_sequencer.py index 7cb4c1fc01d..f56f3059078 100644 --- a/scripts/startup/bl_ui/space_sequencer.py +++ b/scripts/startup/bl_ui/space_sequencer.py @@ -794,13 +794,20 @@ class SEQUENCER_MT_add_effect(Menu): layout.operator_context = 'INVOKE_REGION_WIN' col = layout.column() - col.operator("sequencer.effect_strip_add", text="Add").type = 'ADD' - col.operator("sequencer.effect_strip_add", text="Subtract").type = 'SUBTRACT' - col.operator("sequencer.effect_strip_add", text="Multiply").type = 'MULTIPLY' - col.operator("sequencer.effect_strip_add", text="Over Drop").type = 'OVER_DROP' - col.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER' - col.operator("sequencer.effect_strip_add", text="Alpha Under").type = 'ALPHA_UNDER' - col.operator("sequencer.effect_strip_add", text="Color Mix").type = 'COLORMIX' + col.operator("sequencer.effect_strip_add", text="Add", + text_ctxt=i18n_contexts.id_sequence).type = 'ADD' + col.operator("sequencer.effect_strip_add", text="Subtract", + text_ctxt=i18n_contexts.id_sequence).type = 'SUBTRACT' + col.operator("sequencer.effect_strip_add", text="Multiply", + text_ctxt=i18n_contexts.id_sequence).type = 'MULTIPLY' + col.operator("sequencer.effect_strip_add", text="Over Drop", + text_ctxt=i18n_contexts.id_sequence).type = 'OVER_DROP' + col.operator("sequencer.effect_strip_add", text="Alpha Over", + text_ctxt=i18n_contexts.id_sequence).type = 'ALPHA_OVER' + col.operator("sequencer.effect_strip_add", text="Alpha Under", + text_ctxt=i18n_contexts.id_sequence).type = 'ALPHA_UNDER' + col.operator("sequencer.effect_strip_add", text="Color Mix", + text_ctxt=i18n_contexts.id_sequence).type = 'COLORMIX' col.enabled = selected_sequences_len(context) >= 2 layout.separator() diff --git a/source/blender/blenkernel/intern/freestyle.cc b/source/blender/blenkernel/intern/freestyle.cc index 1cb75a73252..f93143d58fc 100644 --- a/source/blender/blenkernel/intern/freestyle.cc +++ b/source/blender/blenkernel/intern/freestyle.cc @@ -15,6 +15,8 @@ #include "BLI_math_rotation.h" #include "BLI_string_utils.h" +#include "BLT_translation.h" + #include "BKE_freestyle.h" #include "BKE_lib_id.h" #include "BKE_linestyle.h" @@ -166,7 +168,7 @@ FreestyleLineSet *BKE_freestyle_lineset_add(Main *bmain, FreestyleConfig *config BLI_addtail(&config->linesets, (void *)lineset); BKE_freestyle_lineset_set_active_index(config, lineset_index); - lineset->linestyle = BKE_linestyle_new(bmain, "LineStyle"); + lineset->linestyle = BKE_linestyle_new(bmain, DATA_("LineStyle")); lineset->flags |= FREESTYLE_LINESET_ENABLED; lineset->selection = FREESTYLE_SEL_VISIBILITY | FREESTYLE_SEL_EDGE_TYPES | FREESTYLE_SEL_IMAGE_BORDER; @@ -180,10 +182,10 @@ FreestyleLineSet *BKE_freestyle_lineset_add(Main *bmain, FreestyleConfig *config STRNCPY(lineset->name, name); } else if (lineset_index > 0) { - SNPRINTF(lineset->name, "LineSet %i", lineset_index + 1); + SNPRINTF(lineset->name, DATA_("LineSet %i"), lineset_index + 1); } else { - STRNCPY(lineset->name, "LineSet"); + STRNCPY(lineset->name, DATA_("LineSet")); } BKE_freestyle_lineset_unique_name(config, lineset); diff --git a/source/blender/blenkernel/intern/linestyle.cc b/source/blender/blenkernel/intern/linestyle.cc index 241f6a0bc9c..4b5db35a79e 100644 --- a/source/blender/blenkernel/intern/linestyle.cc +++ b/source/blender/blenkernel/intern/linestyle.cc @@ -711,7 +711,7 @@ static LineStyleModifier *new_modifier(const char *name, int type, size_t size) } m = (LineStyleModifier *)MEM_callocN(size, "line style modifier"); m->type = type; - STRNCPY(m->name, name); + STRNCPY(m->name, DATA_(name)); m->influence = 1.0f; m->flags = LS_MODIFIER_ENABLED | LS_MODIFIER_EXPANDED; diff --git a/source/blender/blentranslation/BLT_translation.h b/source/blender/blentranslation/BLT_translation.h index 5ed13c4e50e..8d122cf46e6 100644 --- a/source/blender/blentranslation/BLT_translation.h +++ b/source/blender/blentranslation/BLT_translation.h @@ -124,6 +124,7 @@ 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_VIEW3D "View3D" @@ -196,6 +197,7 @@ typedef struct { 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_VIEW3D, "editor_view3d"), \ BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_AMOUNT, "amount"), \ diff --git a/source/blender/editors/render/render_shading.cc b/source/blender/editors/render/render_shading.cc index e4bdf57a200..373a59a4046 100644 --- a/source/blender/editors/render/render_shading.cc +++ b/source/blender/editors/render/render_shading.cc @@ -2257,7 +2257,7 @@ static int freestyle_linestyle_new_exec(bContext *C, wmOperator *op) lineset->linestyle = (FreestyleLineStyle *)BKE_id_copy(bmain, &lineset->linestyle->id); } else { - lineset->linestyle = BKE_linestyle_new(bmain, "LineStyle"); + lineset->linestyle = BKE_linestyle_new(bmain, DATA_("LineStyle")); } DEG_id_tag_update(&lineset->linestyle->id, 0); WM_event_add_notifier(C, NC_LINESTYLE, lineset->linestyle); diff --git a/source/blender/editors/space_sequencer/sequencer_add.cc b/source/blender/editors/space_sequencer/sequencer_add.cc index 513e84329f7..bbe73f169b3 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.cc +++ b/source/blender/editors/space_sequencer/sequencer_add.cc @@ -1552,12 +1552,13 @@ void SEQUENCER_OT_effect_strip_add(wmOperatorType *ot) /* Flags. */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - RNA_def_enum(ot->srna, - "type", - sequencer_prop_effect_types, - SEQ_TYPE_CROSS, - "Type", - "Sequencer effect type"); + prop = RNA_def_enum(ot->srna, + "type", + sequencer_prop_effect_types, + SEQ_TYPE_CROSS, + "Type", + "Sequencer effect type"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SEQUENCE); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME | SEQPROP_ENDFRAME); /* Only used when strip is of the Color type. */ prop = RNA_def_float_color(ot->srna, diff --git a/source/blender/editors/space_sequencer/sequencer_edit.cc b/source/blender/editors/space_sequencer/sequencer_edit.cc index 3427c865ed1..95e19276993 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.cc +++ b/source/blender/editors/space_sequencer/sequencer_edit.cc @@ -2894,6 +2894,7 @@ void SEQUENCER_OT_change_effect_type(wmOperatorType *ot) SEQ_TYPE_CROSS, "Type", "Sequencer effect type"); + RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_SEQUENCE); } /** \} */ diff --git a/source/blender/makesrna/intern/rna_brush.cc b/source/blender/makesrna/intern/rna_brush.cc index 3e735eeb61e..5efe6117894 100644 --- a/source/blender/makesrna/intern/rna_brush.cc +++ b/source/blender/makesrna/intern/rna_brush.cc @@ -1513,6 +1513,7 @@ static void rna_def_gpencil_options(BlenderRNA *brna) prop, "Smooth", "Amount of smoothing to apply after finish newly created strokes, to reduce jitter/noise"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_AMOUNT); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr); @@ -1925,6 +1926,7 @@ static void rna_def_gpencil_options(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, nullptr, "caps_type"); RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_caps_types_items); RNA_def_property_ui_text(prop, "Caps Type", "The shape of the start and end of the stroke"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_GPENCIL); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); prop = RNA_def_property(srna, "fill_draw_mode", PROP_ENUM, PROP_NONE); @@ -2627,6 +2629,7 @@ static void rna_def_brush(BlenderRNA *brna) prop = RNA_def_property(srna, "curves_sculpt_tool", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_brush_curves_sculpt_tool_items); RNA_def_property_ui_text(prop, "Curves Sculpt Tool", ""); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVES); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /** End per mode tool properties. */ @@ -2653,6 +2656,7 @@ static void rna_def_brush(BlenderRNA *brna) prop = RNA_def_property(srna, "mask_tool", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, brush_mask_tool_items); RNA_def_property_ui_text(prop, "Mask Tool", ""); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MASK); RNA_def_property_update(prop, 0, "rna_Brush_update"); prop = RNA_def_property(srna, "curve_preset", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.cc b/source/blender/makesrna/intern/rna_dynamicpaint.cc index 6e875c21d45..3658118627b 100644 --- a/source/blender/makesrna/intern/rna_dynamicpaint.cc +++ b/source/blender/makesrna/intern/rna_dynamicpaint.cc @@ -909,6 +909,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, nullptr, "proximity_falloff"); RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff); RNA_def_property_ui_text(prop, "Falloff", "Proximity falloff type"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_BRUSH); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "use_proximity_project", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_gpencil_legacy.cc b/source/blender/makesrna/intern/rna_gpencil_legacy.cc index 41b86f2f5ea..89b66b0f11d 100644 --- a/source/blender/makesrna/intern/rna_gpencil_legacy.cc +++ b/source/blender/makesrna/intern/rna_gpencil_legacy.cc @@ -1673,12 +1673,14 @@ static void rna_def_gpencil_stroke(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, nullptr, "caps[0]"); RNA_def_property_enum_items(prop, rna_enum_gpencil_caps_modes_items); RNA_def_property_ui_text(prop, "Start Cap", "Stroke start extreme cap style"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_GPENCIL); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); prop = RNA_def_property(srna, "end_cap_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, nullptr, "caps[1]"); RNA_def_property_enum_items(prop, rna_enum_gpencil_caps_modes_items); RNA_def_property_ui_text(prop, "End Cap", "Stroke end extreme cap style"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_GPENCIL); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); /* No fill: The stroke never must fill area and must use fill color as stroke color diff --git a/source/blender/makesrna/intern/rna_linestyle.cc b/source/blender/makesrna/intern/rna_linestyle.cc index 5fb76178a53..f52177783e1 100644 --- a/source/blender/makesrna/intern/rna_linestyle.cc +++ b/source/blender/makesrna/intern/rna_linestyle.cc @@ -12,6 +12,8 @@ #include "BLI_math_rotation.h" #include "BLI_utildefines.h" +#include "BLT_translation.h" + #include "RNA_define.hh" #include "RNA_enum_types.hh" @@ -595,6 +597,7 @@ static void rna_def_linestyle_mtex(BlenderRNA *brna) prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mapping_items); RNA_def_property_ui_text(prop, "Mapping", ""); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_IMAGE); RNA_def_property_update(prop, 0, "rna_LineStyle_update"); /* map to */ @@ -1336,6 +1339,7 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna) prop = RNA_def_property(srna, "smooth", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, nullptr, "flags", LS_MODIFIER_SPATIAL_NOISE_SMOOTH); RNA_def_property_ui_text(prop, "Smooth", "If true, the spatial noise is smooth"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_FREESTYLELINESTYLE); RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update"); prop = RNA_def_property(srna, "use_pure_random", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_mask.cc b/source/blender/makesrna/intern/rna_mask.cc index e36e73a4f1d..30cff162272 100644 --- a/source/blender/makesrna/intern/rna_mask.cc +++ b/source/blender/makesrna/intern/rna_mask.cc @@ -893,6 +893,7 @@ static void rna_def_maskSpline(BlenderRNA *brna) RNA_def_property_enum_items(prop, spline_offset_mode_items); RNA_def_property_ui_text( prop, "Feather Offset", "The method used for calculating the feather offset"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MASK); RNA_def_property_update(prop, 0, "rna_Mask_update_data"); /* weight interpolation */ diff --git a/source/blender/makesrna/intern/rna_material.cc b/source/blender/makesrna/intern/rna_material.cc index ed7028193bc..e0e61b617df 100644 --- a/source/blender/makesrna/intern/rna_material.cc +++ b/source/blender/makesrna/intern/rna_material.cc @@ -884,6 +884,7 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, nullptr, "pr_type"); RNA_def_property_enum_items(prop, preview_type_items); RNA_def_property_ui_text(prop, "Preview Render Type", "Type of preview render"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MATERIAL); RNA_def_property_update(prop, 0, "rna_Material_update_previews"); prop = RNA_def_property(srna, "use_preview_world", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_modifier.cc b/source/blender/makesrna/intern/rna_modifier.cc index 5a276900df1..d48d7bc9c18 100644 --- a/source/blender/makesrna/intern/rna_modifier.cc +++ b/source/blender/makesrna/intern/rna_modifier.cc @@ -4812,6 +4812,7 @@ static void rna_def_modifier_solidify(BlenderRNA *brna) prop = RNA_def_property(srna, "nonmanifold_boundary_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, nonmanifold_boundary_mode_items); RNA_def_property_ui_text(prop, "Boundary Shape", "Selects the boundary adjustment algorithm"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MESH); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "nonmanifold_merge_threshold", PROP_FLOAT, PROP_DISTANCE); diff --git a/source/blender/makesrna/intern/rna_nodetree.cc b/source/blender/makesrna/intern/rna_nodetree.cc index 15af7119c22..fdde2e9dd1e 100644 --- a/source/blender/makesrna/intern/rna_nodetree.cc +++ b/source/blender/makesrna/intern/rna_nodetree.cc @@ -4817,6 +4817,7 @@ static void def_sh_tex_image(StructRNA *srna) RNA_def_property_enum_items(prop, prop_projection_items); RNA_def_property_ui_text( prop, "Projection", "Method to project 2D image on object with a 3D texture vector"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_IMAGE); RNA_def_property_update(prop, 0, "rna_Node_update"); prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); @@ -5984,6 +5985,7 @@ static void def_cmp_blur(StructRNA *srna) RNA_def_property_enum_sdna(prop, nullptr, "filtertype"); RNA_def_property_enum_items(prop, filter_type_items); RNA_def_property_ui_text(prop, "Filter Type", ""); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_NODETREE); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "use_bokeh", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_particle.cc b/source/blender/makesrna/intern/rna_particle.cc index 1943aaae075..32a87f191e1 100644 --- a/source/blender/makesrna/intern/rna_particle.cc +++ b/source/blender/makesrna/intern/rna_particle.cc @@ -2224,6 +2224,7 @@ static void rna_def_particle_settings_mtex(BlenderRNA *brna) prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mapping_items); RNA_def_property_ui_text(prop, "Mapping", ""); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_IMAGE); RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* map to */ diff --git a/source/blender/makesrna/intern/rna_space.cc b/source/blender/makesrna/intern/rna_space.cc index b8a5fa33513..df8458ec65a 100644 --- a/source/blender/makesrna/intern/rna_space.cc +++ b/source/blender/makesrna/intern/rna_space.cc @@ -6615,6 +6615,7 @@ static void rna_def_space_console(BlenderRNA *brna) prop = RNA_def_property(srna, "language", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Language", "Command line prompt language"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_EDITOR_PYTHON_CONSOLE); prop = RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, nullptr, "history", nullptr); diff --git a/source/blender/makesrna/intern/rna_texture.cc b/source/blender/makesrna/intern/rna_texture.cc index 3fdf3072d65..6b747f9c71e 100644 --- a/source/blender/makesrna/intern/rna_texture.cc +++ b/source/blender/makesrna/intern/rna_texture.cc @@ -556,6 +556,7 @@ static void rna_def_texmapping(BlenderRNA *brna) prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mapping_items); RNA_def_property_ui_text(prop, "Mapping", ""); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_IMAGE); RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); } diff --git a/source/blender/makesrna/intern/rna_ui.cc b/source/blender/makesrna/intern/rna_ui.cc index d57a840fb4d..aae955cbff9 100644 --- a/source/blender/makesrna/intern/rna_ui.cc +++ b/source/blender/makesrna/intern/rna_ui.cc @@ -251,7 +251,7 @@ static StructRNA *rna_Panel_register(Main *bmain, StructCallbackFunc call, StructFreeFunc free) { - const char *error_prefix = "Registering panel class:"; + const char *error_prefix = TIP_("Registering panel class:"); ARegionType *art; PanelType *pt, *parent = nullptr, dummy_pt = {nullptr}; Panel dummy_panel = {nullptr}; diff --git a/source/blender/makesrna/intern/rna_wm_gizmo_api.cc b/source/blender/makesrna/intern/rna_wm_gizmo_api.cc index fd14e3a75c4..602d469d64b 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo_api.cc +++ b/source/blender/makesrna/intern/rna_wm_gizmo_api.cc @@ -11,6 +11,8 @@ #include "BLI_utildefines.h" +#include "BLT_translation.h" + #include "BKE_report.h" #include "RNA_define.hh" @@ -151,8 +153,11 @@ static PointerRNA rna_gizmo_target_set_operator(wmGizmo *gz, ot = WM_operatortype_find(opname, false); /* print error next */ if (!ot || !ot->srna) { - BKE_reportf( - reports, RPT_ERROR, "%s '%s'", ot ? "unknown operator" : "operator missing srna", opname); + BKE_reportf(reports, + RPT_ERROR, + "%s '%s'", + ot ? TIP_("unknown operator") : TIP_("operator missing srna"), + opname); return PointerRNA_NULL; } diff --git a/source/blender/nodes/geometry/node_geometry_util.cc b/source/blender/nodes/geometry/node_geometry_util.cc index 5490afc1037..67615a95c2a 100644 --- a/source/blender/nodes/geometry/node_geometry_util.cc +++ b/source/blender/nodes/geometry/node_geometry_util.cc @@ -52,7 +52,7 @@ std::optional node_socket_to_custom_data_type(const bNodeSocket bool check_tool_context_and_error(GeoNodeExecParams ¶ms) { if (!params.user_data()->operator_data) { - params.error_message_add(NodeWarningType::Error, "Node must be run as tool"); + params.error_message_add(NodeWarningType::Error, TIP_("Node must be run as tool")); params.set_default_remaining_outputs(); return false; } diff --git a/source/blender/sequencer/intern/utils.cc b/source/blender/sequencer/intern/utils.cc index ab7f47ff9da..18496dc3540 100644 --- a/source/blender/sequencer/intern/utils.cc +++ b/source/blender/sequencer/intern/utils.cc @@ -107,55 +107,55 @@ static const char *give_seqname_by_type(int type) { switch (type) { case SEQ_TYPE_META: - return DATA_("Meta"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Meta"); case SEQ_TYPE_IMAGE: - return DATA_("Image"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Image"); case SEQ_TYPE_SCENE: - return DATA_("Scene"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Scene"); case SEQ_TYPE_MOVIE: - return DATA_("Movie"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Movie"); case SEQ_TYPE_MOVIECLIP: - return DATA_("Clip"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Clip"); case SEQ_TYPE_MASK: - return DATA_("Mask"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Mask"); case SEQ_TYPE_SOUND_RAM: - return DATA_("Audio"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Audio"); case SEQ_TYPE_CROSS: - return DATA_("Cross"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Cross"); case SEQ_TYPE_GAMCROSS: - return DATA_("Gamma Cross"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Gamma Cross"); case SEQ_TYPE_ADD: - return DATA_("Add"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Add"); case SEQ_TYPE_SUB: - return DATA_("Sub"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Sub"); case SEQ_TYPE_MUL: - return DATA_("Mul"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Mul"); case SEQ_TYPE_ALPHAOVER: - return DATA_("Alpha Over"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Alpha Over"); case SEQ_TYPE_ALPHAUNDER: - return DATA_("Alpha Under"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Alpha Under"); case SEQ_TYPE_OVERDROP: - return DATA_("Over Drop"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Over Drop"); case SEQ_TYPE_COLORMIX: - return DATA_("Color Mix"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Color Mix"); case SEQ_TYPE_WIPE: - return DATA_("Wipe"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Wipe"); case SEQ_TYPE_GLOW: - return DATA_("Glow"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Glow"); case SEQ_TYPE_TRANSFORM: - return DATA_("Transform"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Transform"); case SEQ_TYPE_COLOR: - return DATA_("Color"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Color"); case SEQ_TYPE_MULTICAM: - return DATA_("Multicam"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Multicam"); case SEQ_TYPE_ADJUSTMENT: - return DATA_("Adjustment"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Adjustment"); case SEQ_TYPE_SPEED: - return DATA_("Speed"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Speed"); case SEQ_TYPE_GAUSSIAN_BLUR: - return DATA_("Gaussian Blur"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Gaussian Blur"); case SEQ_TYPE_TEXT: - return DATA_("Text"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_SEQUENCE, "Text"); default: return nullptr; }