[Bf-blender-cvs] [f5d67f3fdf2] master: I18n: disambiguate a few messages

Damien Picard noreply at git.blender.org
Wed Oct 5 17:54:20 CEST 2022


Commit: f5d67f3fdf2ddec073898bc60feeb2440f2c1b30
Author: Damien Picard
Date:   Wed Oct 5 17:53:28 2022 +0200
Branches: master
https://developer.blender.org/rBf5d67f3fdf2ddec073898bc60feeb2440f2c1b30

I18n: disambiguate a few messages

- Active Track (NLA vs movie clip)
- New (file)
- Object Index (loop cut)
- Object Index (render pass)
- Proxy Storage (sequence)
- Rim (Solidify modifier)
- Roughness (particle children)
- Spaces (text whitespace)
- Out (sequencer wipe transition)

Also make new asset tag name translatable.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D16067

===================================================================

M	release/scripts/startup/bl_operators/assets.py
M	release/scripts/startup/bl_ui/properties_output.py
M	release/scripts/startup/bl_ui/properties_particle.py
M	release/scripts/startup/bl_ui/space_topbar.py
M	source/blender/editors/mesh/editmesh_loopcut.c
M	source/blender/makesrna/intern/rna_animation.c
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/makesrna/intern/rna_sequencer.c
M	source/blender/makesrna/intern/rna_text.c
M	source/blender/makesrna/intern/rna_tracking.c
M	source/blender/modifiers/intern/MOD_solidify.c

===================================================================

diff --git a/release/scripts/startup/bl_operators/assets.py b/release/scripts/startup/bl_operators/assets.py
index 088f4189ca5..d8182e25641 100644
--- a/release/scripts/startup/bl_operators/assets.py
+++ b/release/scripts/startup/bl_operators/assets.py
@@ -4,6 +4,9 @@ from __future__ import annotations
 import bpy
 from bpy.types import Operator
 
+from bpy.app.translations import pgettext_data as data_
+
+
 from bpy_extras.asset_utils import (
     SpaceAssetInfo,
 )
@@ -33,7 +36,7 @@ class ASSET_OT_tag_add(AssetBrowserMetadataOperator, Operator):
 
     def execute(self, context):
         active_asset = SpaceAssetInfo.get_active_asset(context)
-        active_asset.tags.new("Tag")
+        active_asset.tags.new(data_("Tag"))
 
         return {'FINISHED'}
 
diff --git a/release/scripts/startup/bl_ui/properties_output.py b/release/scripts/startup/bl_ui/properties_output.py
index bc7e8bb4347..ca0e698500e 100644
--- a/release/scripts/startup/bl_ui/properties_output.py
+++ b/release/scripts/startup/bl_ui/properties_output.py
@@ -3,7 +3,10 @@ import bpy
 from bpy.types import Menu, Panel, UIList
 from bl_ui.utils import PresetPanel
 
-from bpy.app.translations import pgettext_tip as tip_
+from bpy.app.translations import (
+    contexts as i18n_contexts,
+    pgettext_tip as tip_,
+)
 
 
 class RENDER_PT_format_presets(PresetPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index 080c8ca5726..c42275fcd54 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -1679,7 +1679,7 @@ class PARTICLE_PT_children_roughness(ParticleButtonsPanel, Panel):
         if part.use_roughness_curve:
             sub = col.column()
             sub.template_curve_mapping(part, "roughness_curve")
-            sub.prop(part, "roughness_1", text=iface_("Roughness", i18n_contexts.id_particlesettings))
+            sub.prop(part, "roughness_1", text="Roughness", text_ctxt=i18n_contexts.id_particlesettings)
             sub.prop(part, "roughness_1_size", text="Size")
         else:
             sub = col.column(align=True)
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index da089ea23b0..2217a7b45bb 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -2,7 +2,10 @@
 import bpy
 from bpy.types import Header, Menu, Panel
 
-from bpy.app.translations import pgettext_iface as iface_
+from bpy.app.translations import (
+    pgettext_iface as iface_,
+    contexts as i18n_contexts,
+)
 
 
 class TOPBAR_HT_upper_bar(Header):
@@ -269,7 +272,9 @@ class TOPBAR_MT_file(Menu):
         layout = self.layout
 
         layout.operator_context = 'INVOKE_AREA'
-        layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW')
+        layout.menu("TOPBAR_MT_file_new", text="New",
+                    text_context=i18n_contexts.id_windowmanager,
+                    icon='FILE_NEW')
         layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
         layout.menu("TOPBAR_MT_file_open_recent")
         layout.operator("wm.revert_mainfile")
@@ -724,7 +729,7 @@ class TOPBAR_MT_file_context_menu(Menu):
         layout = self.layout
 
         layout.operator_context = 'INVOKE_AREA'
-        layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW')
+        layout.menu("TOPBAR_MT_file_new", text="New", text_context=i18n_contexts.id_windowmanager, icon='FILE_NEW')
         layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
 
         layout.separator()
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c
index 63b0eb778d7..494e0ff4a27 100644
--- a/source/blender/editors/mesh/editmesh_loopcut.c
+++ b/source/blender/editors/mesh/editmesh_loopcut.c
@@ -763,6 +763,7 @@ void MESH_OT_loopcut(wmOperatorType *ot)
 
   /* For redo only. */
   prop = RNA_def_int(ot->srna, "object_index", -1, -1, INT_MAX, "Object Index", "", 0, INT_MAX);
+  RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MESH);
   RNA_def_property_flag(prop, PROP_HIDDEN);
   prop = RNA_def_int(ot->srna, "edge_index", -1, -1, INT_MAX, "Edge Index", "", 0, INT_MAX);
   RNA_def_property_flag(prop, PROP_HIDDEN);
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index 4f07cb235fa..fa2ef98d3df 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -1207,6 +1207,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
       prop, "rna_NlaTrack_active_get", "rna_NlaTrack_active_set", NULL, NULL);
   RNA_def_property_flag(prop, PROP_EDITABLE);
   RNA_def_property_ui_text(prop, "Active Track", "Active NLA Track");
+  RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ACTION);
   /* XXX: should (but doesn't) update the active track in the NLA window */
   RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_SELECTED, NULL);
 }
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index a6881444d34..70afc763c2d 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -4617,6 +4617,7 @@ void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool sce
   prop = RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
   RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
+  RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SCENE);
   if (scene) {
     RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
   }
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index ea508bf117c..634754d54cc 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -2893,6 +2893,7 @@ static void rna_def_wipe(StructRNA *srna)
   RNA_def_property_enum_sdna(prop, NULL, "forward");
   RNA_def_property_enum_items(prop, wipe_direction_items);
   RNA_def_property_ui_text(prop, "Direction", "Wipe direction");
+  RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SEQUENCE);
   RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
 
   prop = RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index e9c67d71ceb..4f756c163d1 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -231,6 +231,7 @@ static void rna_def_text(BlenderRNA *brna)
   prop = RNA_def_property(srna, "indentation", PROP_ENUM, PROP_NONE); /* as an enum */
   RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
   RNA_def_property_enum_items(prop, indentation_items);
+  RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_TEXT);
   RNA_def_property_ui_text(prop, "Indentation", "Use tabs or spaces for indentation");
 
   prop = RNA_def_property(srna, "lines", PROP_COLLECTION, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c
index b9acd57430b..c4a11d4e9e0 100644
--- a/source/blender/makesrna/intern/rna_tracking.c
+++ b/source/blender/makesrna/intern/rna_tracking.c
@@ -13,6 +13,8 @@
 #include "BKE_node_tree_update.h"
 #include "BKE_tracking.h"
 
+#include "BLT_translation.h"
+
 #include "RNA_access.h"
 #include "RNA_define.h"
 
@@ -2197,6 +2199,7 @@ static void rna_def_trackingTracks(BlenderRNA *brna)
       prop, "rna_tracking_active_track_get", "rna_tracking_active_track_set", NULL, NULL);
   RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
   RNA_def_property_ui_text(prop, "Active Track", "Active track in this tracking data object");
+  RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MOVIECLIP);
 }
 
 static void rna_def_trackingPlaneTracks(BlenderRNA *brna)
@@ -2257,6 +2260,7 @@ static void rna_def_trackingObjectTracks(BlenderRNA *brna)
       prop, "rna_tracking_active_track_get", "rna_tracking_active_track_set", NULL, NULL);
   RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
   RNA_def_property_ui_text(prop, "Active Track", "Active track in this tracking data object");
+  RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MOVIECLIP);
 }
 
 static void rna_def_trackingObjectPlaneTracks(BlenderRNA *brna)
@@ -2278,6 +2282,7 @@ static void rna_def_trackingObjectPlaneTracks(BlenderRNA *brna)
                                  NULL);
   RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
   RNA_def_property_ui_text(prop, "Active Track", "Active track in this tracking data object");
+  RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MOVIECLIP);
 }
 
 static void rna_def_trackingObject(BlenderRNA *brna)
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 1c7369d9158..2da9c1e214e 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -108,7 +108,7 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
     uiItemR(layout, ptr, "use_even_offset", 0, NULL, ICON_NONE);
   }
 
-  col = uiLayoutColumnWithHeading(layout, false, IFACE_("Rim"));
+  col = uiLayoutColumnWithHeading(layout, false, CTX_IFACE_(BLT_I18NCONTEXT_ID_MESH, "Rim"));
   uiItemR(col, ptr, "use_rim", 0, IFACE_("Fill"), ICON_NONE);
   sub = uiLayoutColumn(col, false);
   uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_rim"));
@@ -162,7 +162,7 @@ static void materials_panel_draw(const bContext *UNUSED(C), Panel *panel)
   uiItemR(layout, ptr, "material_offset", 0, NULL, ICON_NONE);
   col = uiLayoutColumn(layout, true);
   uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_rim"));
-  uiItemR(col, ptr, "material_offset

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list