Commit: b099cf73ae3644175c0668c1c2253420daf059a3 Author: Damien Picard Date: Mon Oct 10 13:03:13 2022 +0200 Branches: master https://developer.blender.org/rBb099cf73ae3644175c0668c1c2253420daf059a3
I18n: disambiguate or extract a few messages Disambiguate: - "Active Only" (GPencil copy material and layer, add NLA modifier) - "Clip" (movie clip, image extension mode) - "Emission" (particles) - "New" (scene) - "Tracking" (movie clip) Extract: - "ViewLayer", the default view layer name when creating new scene Ref T43295 Reviewed By: mont29 Maniphest Tasks: T43295 Differential Revision: https://developer.blender.org/D16196 =================================================================== M release/scripts/startup/bl_ui/properties_particle.py M release/scripts/startup/bl_ui/space_clip.py M release/scripts/startup/bl_ui/space_sequencer.py M source/blender/blenkernel/intern/scene.cc M source/blender/editors/gpencil/gpencil_data.c M source/blender/editors/scene/scene_edit.c M source/blender/editors/space_clip/clip_ops.c M source/blender/editors/space_nla/nla_edit.c M source/blender/makesrna/intern/rna_nodetree.c M source/blender/makesrna/intern/rna_space.c M source/blender/makesrna/intern/rna_texture.c =================================================================== diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index c42275fcd54..8567ddb9372 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -239,6 +239,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): class PARTICLE_PT_emission(ParticleButtonsPanel, Panel): bl_label = "Emission" + bl_translation_context = i18n_contexts.id_particlesettings COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} @classmethod diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index c337e8018e6..54b3a20f966 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -2,7 +2,10 @@ import bpy from bpy.types import Panel, Header, Menu, UIList -from bpy.app.translations import pgettext_iface as iface_ +from bpy.app.translations import ( + pgettext_iface as iface_, + contexts as i18n_contexts, +) from bl_ui.utils import PresetPanel from bl_ui.properties_grease_pencil_common import ( AnnotationDrawingToolsPanel, @@ -1751,6 +1754,7 @@ class CLIP_MT_marker_pie(Menu): class CLIP_MT_tracking_pie(Menu): # Tracking Operators bl_label = "Tracking" + bl_translation_context = i18n_contexts.id_movieclip @classmethod def poll(cls, context): diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index a99df1164a0..e703cf7f9c6 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -683,7 +683,7 @@ class SEQUENCER_MT_add(Menu): elif bpy_data_movieclips_len > 0: layout.operator_menu_enum("sequencer.movieclip_strip_add", "clip", text="Clip", icon='TRACKER') else: - layout.menu("SEQUENCER_MT_add_empty", text="Clip", icon='TRACKER') + layout.menu("SEQUENCER_MT_add_empty", text="Clip", text_ctxt=i18n_contexts.id_movieclip, icon='TRACKER') del bpy_data_movieclips_len bpy_data_masks_len = len(bpy.data.masks) diff --git a/source/blender/blenkernel/intern/scene.cc b/source/blender/blenkernel/intern/scene.cc index d6183210186..fc47fb71bf3 100644 --- a/source/blender/blenkernel/intern/scene.cc +++ b/source/blender/blenkernel/intern/scene.cc @@ -244,7 +244,7 @@ static void scene_init_data(ID *id) /* Master Collection */ scene->master_collection = BKE_collection_master_add(scene); - BKE_view_layer_add(scene, "ViewLayer", nullptr, VIEWLAYER_ADD_NEW); + BKE_view_layer_add(scene, DATA_("ViewLayer"), nullptr, VIEWLAYER_ADD_NEW); } static void scene_copy_markers(Scene *scene_dst, const Scene *scene_src, const int flag) diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index 340288b2d74..c6d7eb294fb 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -623,6 +623,7 @@ void GPENCIL_OT_layer_duplicate_object(wmOperatorType *ot) true, "Only Active", "Copy only active Layer, uncheck to append all layers"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_GPENCIL); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } @@ -3686,6 +3687,7 @@ void GPENCIL_OT_materials_copy_to_object(wmOperatorType *ot) true, "Only Active", "Append only active material, uncheck to append all materials"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_GPENCIL); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c index f19017cb723..01877deb716 100644 --- a/source/blender/editors/scene/scene_edit.c +++ b/source/blender/editors/scene/scene_edit.c @@ -286,6 +286,7 @@ static void SCENE_OT_new(wmOperatorType *ot) /* properties */ ot->prop = RNA_def_enum(ot->srna, "type", scene_new_items, SCE_COPY_NEW, "Type", ""); + RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_SCENE); } /** \} */ diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index f276c2acd1a..b10ad86504c 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1611,7 +1611,8 @@ void CLIP_OT_mode_set(wmOperatorType *ot) ot->poll = ED_space_clip_poll; /* properties */ - RNA_def_enum(ot->srna, "mode", rna_enum_clip_editor_mode_items, SC_MODE_TRACKING, "Mode", ""); + ot->prop = RNA_def_enum(ot->srna, "mode", rna_enum_clip_editor_mode_items, SC_MODE_TRACKING, "Mode", ""); + RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_MOVIECLIP); } /** \} */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 9df25b1229e..8a3c6745259 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -2641,6 +2641,8 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op) void NLA_OT_fmodifier_add(wmOperatorType *ot) { + PropertyRNA *prop; + /* identifiers */ ot->name = "Add F-Modifier"; ot->idname = "NLA_OT_fmodifier_add"; @@ -2659,11 +2661,12 @@ void NLA_OT_fmodifier_add(wmOperatorType *ot) RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_ACTION); RNA_def_enum_funcs(ot->prop, nla_fmodifier_itemf); - RNA_def_boolean(ot->srna, - "only_active", - true, - "Only Active", - "Only add a F-Modifier of the specified type to the active strip"); + prop = RNA_def_boolean(ot->srna, + "only_active", + true, + "Only Active", + "Only add a F-Modifier of the specified type to the active strip"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ACTION); } /** \} */ @@ -2832,8 +2835,10 @@ void NLA_OT_fmodifier_paste(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ - RNA_def_boolean( + ot->prop = RNA_def_boolean( ot->srna, "only_active", true, "Only Active", "Only paste F-Modifiers on active strip"); + RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_ACTION); + RNA_def_boolean( ot->srna, "replace", diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index dde3a3d8d14..2b138b3b9b4 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -5509,6 +5509,7 @@ static void def_sh_tex_image(StructRNA *srna) RNA_def_property_enum_items(prop, prop_image_extension); RNA_def_property_ui_text( prop, "Extension", "How the image is extrapolated past its original bounds"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_IMAGE); RNA_def_property_update(prop, 0, "rna_Node_update"); prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE); @@ -5573,6 +5574,7 @@ static void def_geo_image_texture(StructRNA *srna) RNA_def_property_enum_items(prop, prop_image_extension); RNA_def_property_ui_text( prop, "Extension", "How the image is extrapolated past its original bounds"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_IMAGE); RNA_def_property_update(prop, 0, "rna_Node_update"); } diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 738b41828e0..bee68c2949c 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -7515,6 +7515,7 @@ static void rna_def_space_clip(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, rna_enum_clip_editor_mode_items); RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MOVIECLIP); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_clip_mode_update"); /* view */ diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 26849bfa622..2254db4edaf 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -24,6 +24,8 @@ #include "BKE_node_tree_update.h" #include "BKE_paint.h" +#include "BLT_translation.h" + #include "RNA_define.h" #include "RNA_enum_types.h" @@ -1191,6 +1193,7 @@ static void rna_def_texture_image(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_image_extension); RNA_def_property_ui_text( prop, "Extension", "How the image is extrapolated past its original bounds"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_IMAGE); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop = RNA_def_property(srna, "repeat_x", PROP_INT, PROP_NONE); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs