diff --git a/scripts/startup/bl_ui/node_add_menu_geometry.py b/scripts/startup/bl_ui/node_add_menu_geometry.py index 43fd87d0f83..7212dbfe38c 100644 --- a/scripts/startup/bl_ui/node_add_menu_geometry.py +++ b/scripts/startup/bl_ui/node_add_menu_geometry.py @@ -2,7 +2,10 @@ import bpy from bpy.types import Menu from bl_ui import node_add_menu -from bpy.app.translations import pgettext_iface as iface_ +from bpy.app.translations import ( + pgettext_iface as iface_, + contexts as i18n_contexts, +) class NODE_MT_geometry_node_GEO_ATTRIBUTE(Menu): @@ -238,6 +241,7 @@ class NODE_MT_geometry_node_GEO_INPUT(Menu): class NODE_MT_geometry_node_GEO_INPUT_CONSTANT(Menu): bl_idname = "NODE_MT_geometry_node_GEO_INPUT_CONSTANT" bl_label = "Constant" + bl_translation_context = i18n_contexts.id_nodetree def draw(self, _context): layout = self.layout diff --git a/scripts/startup/bl_ui/space_text.py b/scripts/startup/bl_ui/space_text.py index aba15d050f9..d4060721661 100644 --- a/scripts/startup/bl_ui/space_text.py +++ b/scripts/startup/bl_ui/space_text.py @@ -79,6 +79,7 @@ class TEXT_HT_footer(Header): text=iface_("Text: External") if text.library else iface_("Text: Internal"), + translate=False ) diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index b6e82fb9ecf..dbe3814f371 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -342,7 +342,7 @@ MaskLayer *BKE_mask_layer_new(Mask *mask, const char *name) BLI_strncpy(masklay->name, name, sizeof(masklay->name)); } else { - strcpy(masklay->name, "MaskLayer"); + strcpy(masklay->name, DATA_("MaskLayer")); } BLI_addtail(&mask->masklayers, masklay); diff --git a/source/blender/blentranslation/BLT_translation.h b/source/blender/blentranslation/BLT_translation.h index 372519cb69f..eb884a91412 100644 --- a/source/blender/blentranslation/BLT_translation.h +++ b/source/blender/blentranslation/BLT_translation.h @@ -130,6 +130,8 @@ const char *BLT_translate_do_new_dataname(const char *msgctxt, const char *msgid #define BLT_I18NCONTEXT_VIRTUAL_REALITY "Virtual reality" #define BLT_I18NCONTEXT_CONSTRAINT "Constraint" #define BLT_I18NCONTEXT_COLOR "Color" +#define BLT_I18NCONTEXT_AMOUNT "Amount" +#define BLT_I18NCONTEXT_UNIT "Unit" /* Helper for bpy.app.i18n object... */ typedef struct { @@ -198,6 +200,8 @@ typedef struct { BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_VIRTUAL_REALITY, "virtual_reality"), \ BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_CONSTRAINT, "constraint"), \ BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_COLOR, "color"), \ + BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_AMOUNT, "amount"), \ + BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_UNIT, "unit"), \ { \ NULL, NULL, NULL \ } \ diff --git a/source/blender/editors/interface/interface.cc b/source/blender/editors/interface/interface.cc index 73da3b65ecd..1543e38fb97 100644 --- a/source/blender/editors/interface/interface.cc +++ b/source/blender/editors/interface/interface.cc @@ -3877,7 +3877,7 @@ static void ui_but_update_ex(uiBut *but, const bool validate) case UI_BTYPE_KEY_EVENT: { const char *str; if (but->flag & UI_SELECT) { - str = "Press a key"; + str = IFACE_("Press a key"); } else { UI_GET_BUT_VALUE_INIT(but, value); @@ -3910,7 +3910,7 @@ static void ui_but_update_ex(uiBut *but, const bool validate) (void)str; /* UNUSED */ } else { - BLI_strncpy(but->drawstr, "Press a key", UI_MAX_DRAW_STR); + BLI_strncpy(but->drawstr, IFACE_("Press a key"), UI_MAX_DRAW_STR); } } else { diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index b01ce34617a..ef4e559ea46 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -2810,8 +2810,10 @@ void TEXT_OT_scroll(wmOperatorType *ot) ot->flag = OPTYPE_BLOCKING | OPTYPE_GRAB_CURSOR_XY | OPTYPE_INTERNAL; /* properties */ - RNA_def_int( + PropertyRNA *prop; + prop = RNA_def_int( ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll", -100, 100); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_TEXT); } /** \} */ @@ -2915,8 +2917,10 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot) ot->flag = OPTYPE_BLOCKING | OPTYPE_INTERNAL; /* properties */ - RNA_def_int( + PropertyRNA *prop; + prop = RNA_def_int( ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll", -100, 100); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_TEXT); } /** \} */ diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 319531d6821..9a8ce819236 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -2556,6 +2556,8 @@ static void rna_def_brush(BlenderRNA *brna) prop = RNA_def_property(srna, "curve_preset", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, brush_curve_preset_items); RNA_def_property_ui_text(prop, "Curve Preset", ""); + RNA_def_property_translation_context(prop, + BLT_I18NCONTEXT_ID_CURVES); /* Abusing id_curves :/ */ RNA_def_property_update(prop, 0, "rna_Brush_update"); prop = RNA_def_property(srna, "deform_target", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_cachefile.c b/source/blender/makesrna/intern/rna_cachefile.c index c8b154b9b04..a5d0155f82f 100644 --- a/source/blender/makesrna/intern/rna_cachefile.c +++ b/source/blender/makesrna/intern/rna_cachefile.c @@ -8,6 +8,8 @@ #include "DNA_cachefile_types.h" #include "DNA_scene_types.h" +#include "BLT_translation.h" + #include "RNA_access.h" #include "RNA_define.h" #include "RNA_enum_types.h" @@ -364,6 +366,7 @@ static void rna_def_cachefile(BlenderRNA *brna) "Velocity Unit", "Define how the velocity vectors are interpreted with regard to time, 'frame' means " "the delta time is 1 frame, 'second' means the delta time is 1 / FPS"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_UNIT); RNA_def_property_update(prop, 0, "rna_CacheFile_update"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); diff --git a/source/blender/makesrna/intern/rna_fluid.c b/source/blender/makesrna/intern/rna_fluid.c index bd601d0a736..545d4268edd 100644 --- a/source/blender/makesrna/intern/rna_fluid.c +++ b/source/blender/makesrna/intern/rna_fluid.c @@ -1821,6 +1821,7 @@ static void rna_def_fluid_domain_settings(BlenderRNA *brna) RNA_def_property_range(prop, 1, 5); RNA_def_property_ui_text( prop, "Number", "Particle number factor (higher value results in more particles)"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_AMOUNT); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Fluid_datacache_reset"); prop = RNA_def_property(srna, "particle_min", PROP_INT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index d94cad3893f..f33c0c443c2 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -2948,6 +2948,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_range(prop, 0, 1000000, 1, -1); RNA_def_property_ui_text(prop, "Number", "Total number of particles"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_AMOUNT); RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop = RNA_def_property( diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index ffedea37c33..2629373f452 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -6440,6 +6440,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop = RNA_def_property(srna, "hair_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, hair_shape_type_items); RNA_def_property_ui_text(prop, "Curves Shape Type", "Curves shape type"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVES); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update"); prop = RNA_def_property(srna, "hair_subdiv", PROP_INT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c index 4f756c163d1..0aea8b63432 100644 --- a/source/blender/makesrna/intern/rna_text.c +++ b/source/blender/makesrna/intern/rna_text.c @@ -237,6 +237,7 @@ static void rna_def_text(BlenderRNA *brna) prop = RNA_def_property(srna, "lines", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "TextLine"); RNA_def_property_ui_text(prop, "Lines", "Lines of text"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_TEXT); prop = RNA_def_property(srna, "current_line", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); diff --git a/source/blender/makesrna/intern/rna_volume.c b/source/blender/makesrna/intern/rna_volume.c index b842954a3be..582f029ce55 100644 --- a/source/blender/makesrna/intern/rna_volume.c +++ b/source/blender/makesrna/intern/rna_volume.c @@ -664,6 +664,7 @@ static void rna_def_volume(BlenderRNA *brna) "Velocity Unit", "Define how the velocity vectors are interpreted with regard to time, 'frame' means " "the delta time is 1 frame, 'second' means the delta time is 1 / FPS"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_UNIT); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); prop = RNA_def_property(srna, "velocity_scale", PROP_FLOAT, PROP_NONE);