From 1b863041c9746029bd6d867539550043944822d9 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 3 Mar 2022 14:50:52 +0100 Subject: i18n: Fix more potential contextual issues with "Back" UI label. Add 'ID_ACTION' context to some animation curve interpolation enums. Related to T95506/T43295. --- source/blender/editors/gpencil/gpencil_interpolate.c | 18 +++++++++++------- source/blender/editors/space_action/action_edit.c | 1 + source/blender/editors/space_graph/graph_edit.c | 1 + source/blender/editors/space_view3d/view3d_navigate.c | 4 ++++ source/blender/makesrna/intern/rna_fcurve.c | 2 ++ source/blender/makesrna/intern/rna_userdef.c | 1 + 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index 40722862949..91d6ab49a60 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -1574,6 +1574,8 @@ void GPENCIL_OT_interpolate_sequence(wmOperatorType *ot) {0, NULL, 0, NULL, NULL}, }; + PropertyRNA *prop; + /* identifiers */ ot->name = "Interpolate Sequence"; ot->idname = "GPENCIL_OT_interpolate_sequence"; @@ -1634,14 +1636,15 @@ void GPENCIL_OT_interpolate_sequence(wmOperatorType *ot) 0.0f, 2.0f); - RNA_def_enum(ot->srna, - "type", - gpencil_interpolation_type_items, - 0, - "Type", - "Interpolation method to use the next time 'Interpolate Sequence' is run"); + prop = RNA_def_enum(ot->srna, + "type", + gpencil_interpolation_type_items, + 0, + "Type", + "Interpolation method to use the next time 'Interpolate Sequence' is run"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_GPENCIL); - RNA_def_enum( + prop = RNA_def_enum( ot->srna, "easing", gpencil_interpolation_easing_items, @@ -1649,6 +1652,7 @@ void GPENCIL_OT_interpolate_sequence(wmOperatorType *ot) "Easing", "Which ends of the segment between the preceding and following grease pencil frames " "easing interpolation is applied to"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_GPENCIL); RNA_def_float(ot->srna, "back", diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 9d686f03bec..f0ada312d82 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -1374,6 +1374,7 @@ void ACTION_OT_interpolation_type(wmOperatorType *ot) /* id-props */ ot->prop = RNA_def_enum( ot->srna, "type", rna_enum_beztriple_interpolation_mode_items, 0, "Type", ""); + RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_ACTION); } /* ******************** Set Easing Operator *********************** */ diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index b030d0778fa..4c1fcf5263a 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1524,6 +1524,7 @@ void GRAPH_OT_interpolation_type(wmOperatorType *ot) /* Id-props */ ot->prop = RNA_def_enum( ot->srna, "type", rna_enum_beztriple_interpolation_mode_items, 0, "Type", ""); + RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_ACTION); } /** \} */ diff --git a/source/blender/editors/space_view3d/view3d_navigate.c b/source/blender/editors/space_view3d/view3d_navigate.c index d1e7f6ffb12..daf534ce0ba 100644 --- a/source/blender/editors/space_view3d/view3d_navigate.c +++ b/source/blender/editors/space_view3d/view3d_navigate.c @@ -12,6 +12,8 @@ #include "BLI_math.h" #include "BLI_rect.h" +#include "BLT_translation.h" + #include "BKE_armature.h" #include "BKE_context.h" #include "BKE_gpencil_geom.h" @@ -1239,6 +1241,8 @@ void VIEW3D_OT_view_axis(wmOperatorType *ot) ot->prop = RNA_def_enum(ot->srna, "type", prop_view_items, 0, "View", "Preset viewpoint to use"); RNA_def_property_flag(ot->prop, PROP_SKIP_SAVE); + RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_EDITOR_VIEW3D); + prop = RNA_def_boolean( ot->srna, "align_active", 0, "Align Active", "Align to the active object's axis"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 8f418fcc7c7..af14a169d68 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -2111,6 +2111,7 @@ static void rna_def_fkeyframe(BlenderRNA *brna) "Interpolation", "Interpolation method to use for segment of the F-Curve from " "this Keyframe until the next Keyframe"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ACTION); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, "rna_Keyframe_update"); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); @@ -2131,6 +2132,7 @@ static void rna_def_fkeyframe(BlenderRNA *brna) prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "back"); RNA_def_property_ui_text(prop, "Back", "Amount of overshoot for 'back' easing"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ACTION); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, "rna_Keyframe_update"); prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 2a759dde39a..9c4e51c260c 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -5134,6 +5134,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) "New Interpolation Type", "Interpolation mode used for first keyframe on newly added F-Curves " "(subsequent keyframes take interpolation from preceding keyframe)"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ACTION); prop = RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_keyframe_handle_type_items); -- cgit v1.2.3