[Bf-blender-cvs] [db87e2a638f] master: I18n: extract and disambiguate a few messages

Damien Picard noreply at git.blender.org
Mon Jan 30 09:46:02 CET 2023


Commit: db87e2a638f97fa20e8b9bf054548b263c005c35
Author: Damien Picard
Date:   Mon Jan 30 09:32:47 2023 +0100
Branches: master
https://developer.blender.org/rBdb87e2a638f97fa20e8b9bf054548b263c005c35

I18n: extract and disambiguate a few messages

Extract:
- EEVEE: Compiling Shaders (the same message exists in EEVEE Next, but
  it uses string concatenation and I don't know yet how to deal with
  those--see T92758)

Disambiguate:
- Pan (audio, camera)
- Box (TextSequence)
- Mix (noun in constraints, GP materials)
- Volume (object type, file system)
- Floor (math integer part, 3D viewport horizontal plane)
  - Impossible to disambiguate the constraint name because
    bConstraintTypeInfo doesn't have a context field.
- Show Overlay (in the sequence editor, use the same message as other
  editors to avoid a confusion with the Frame Overlay feature, also
  called "Show Overlay")

Additionally, fix a few issues reported by Joan Pujolar (@jpujolar)
in T101830.

Reviewed By: mont29

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

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

M	release/scripts/startup/bl_ui/properties_constraint.py
M	release/scripts/startup/bl_ui/space_filebrowser.py
M	release/scripts/startup/bl_ui/space_sequencer.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/blentranslation/BLT_translation.h
M	source/blender/draw/engines/eevee/eevee_engine.c
M	source/blender/makesrna/intern/rna_material.c
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/makesrna/intern/rna_nla.c
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/makesrna/intern/rna_sequencer.c
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py
index 38e5f5719d4..64dc64cd525 100644
--- a/release/scripts/startup/bl_ui/properties_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_constraint.py
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 from bpy.types import Panel
+from bpy.app.translations import contexts as i18n_contexts
 
 
 class ObjectConstraintPanel:
@@ -397,7 +398,7 @@ class ConstraintButtonsPanel:
         sub.prop(con, "invert_z", text="Z", toggle=True)
         row.label(icon='BLANK1')
 
-        layout.prop(con, "mix_mode", text="Mix")
+        layout.prop(con, "mix_mode", text="Mix", text_ctxt=i18n_contexts.constraint)
 
         self.space_template(layout, con)
 
@@ -488,7 +489,7 @@ class ConstraintButtonsPanel:
         self.target_template(layout, con)
 
         layout.prop(con, "remove_target_shear")
-        layout.prop(con, "mix_mode", text="Mix")
+        layout.prop(con, "mix_mode", text="Mix", text_ctxt=i18n_contexts.constraint)
 
         self.space_template(layout, con)
 
@@ -513,7 +514,7 @@ class ConstraintButtonsPanel:
         subsub.prop(con, "eval_time", text="")
         row.prop_decorator(con, "eval_time")
 
-        layout.prop(con, "mix_mode", text="Mix")
+        layout.prop(con, "mix_mode", text="Mix", text_ctxt=i18n_contexts.constraint)
 
         self.draw_influence(layout, con)
 
@@ -1024,7 +1025,7 @@ class ConstraintButtonsSubPanel:
         col.prop(con, "to_min_z" + ext, text="Min")
         col.prop(con, "to_max_z" + ext, text="Max")
 
-        layout.prop(con, "mix_mode" + ext, text="Mix")
+        layout.prop(con, "mix_mode" + ext, text="Mix", text_ctxt=i18n_contexts.constraint)
 
     def draw_armature_bones(self, context):
         layout = self.layout
diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py
index a7e9663d186..85313b14341 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -8,6 +8,8 @@ from bpy_extras import (
     asset_utils,
 )
 
+from bpy.app.translations import contexts as i18n_contexts
+
 
 class FILEBROWSER_HT_header(Header):
     bl_space_type = 'FILE_BROWSER'
@@ -229,6 +231,7 @@ class FILEBROWSER_PT_bookmarks_volumes(Panel):
     bl_region_type = 'TOOLS'
     bl_category = "Bookmarks"
     bl_label = "Volumes"
+    bl_translation_context = i18n_contexts.editor_filebrowser
 
     @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 dfe73356bcd..8b08ec99d89 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -1579,7 +1579,7 @@ class SEQUENCER_PT_effect_text_style(SequencerButtonsPanel, Panel):
         subsub.prop(strip, "shadow_color", text="")
         row.prop_decorator(strip, "shadow_color")
 
-        row = layout.row(align=True, heading="Box")
+        row = layout.row(align=True, heading="Box", heading_ctxt=i18n_contexts.id_sequence)
         row.use_property_decorate = False
         sub = row.row(align=True)
         sub.prop(strip, "use_box", text="")
@@ -1996,7 +1996,7 @@ class SEQUENCER_PT_adjust_sound(SequencerButtonsPanel, Panel):
 
             split = col.split(factor=0.4)
             split.alignment = 'RIGHT'
-            split.label(text="Pan")
+            split.label(text="Pan", heading_ctxt=i18n_contexts.id_sound)
             split.prop(strip, "pan", text="")
             split.enabled = pan_enabled
 
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index cccb5389037..50629e70aae 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2246,6 +2246,7 @@ class VIEW3D_MT_camera_add(Menu):
 class VIEW3D_MT_volume_add(Menu):
     bl_idname = "VIEW3D_MT_volume_add"
     bl_label = "Volume"
+    bl_translation_context = i18n_contexts.id_id
 
     def draw(self, _context):
         layout = self.layout
@@ -6293,7 +6294,7 @@ class VIEW3D_PT_overlay_guides(Panel):
             (view.region_3d.is_orthographic_side_view and not view.region_3d.is_perspective)
         )
         row_el.active = grid_active
-        row.prop(overlay, "show_floor", text="Floor")
+        row.prop(overlay, "show_floor", text="Floor", text_ctxt=i18n_contexts.editor_view3d)
 
         if overlay.show_floor or overlay.show_ortho_grid:
             sub = col.row(align=True)
diff --git a/source/blender/blentranslation/BLT_translation.h b/source/blender/blentranslation/BLT_translation.h
index a4554c4e0bd..b85169fb03c 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
 
 /* Editors-types contexts. */
 #define BLT_I18NCONTEXT_EDITOR_VIEW3D "View3D"
+#define BLT_I18NCONTEXT_EDITOR_FILEBROWSER "File browser"
 
 /* Helper for bpy.app.i18n object... */
 typedef struct {
@@ -188,6 +189,7 @@ typedef struct {
         BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_WORKSPACE, "id_workspace"), \
         BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_WINDOWMANAGER, "id_windowmanager"), \
         BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_EDITOR_VIEW3D, "editor_view3d"), \
+        BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_EDITOR_FILEBROWSER, "editor_filebrowser"), \
     { \
       NULL, NULL, NULL \
     } \
diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c
index 0bdee957af2..9f70a2dd72b 100644
--- a/source/blender/draw/engines/eevee/eevee_engine.c
+++ b/source/blender/draw/engines/eevee/eevee_engine.c
@@ -11,6 +11,8 @@
 
 #include "BLI_rand.h"
 
+#include "BLT_translation.h"
+
 #include "BKE_object.h"
 
 #include "DEG_depsgraph_query.h"
@@ -174,7 +176,7 @@ static void eevee_cache_finish(void *vedata)
   }
 
   if (g_data->queued_shaders_count > 0) {
-    SNPRINTF(ved->info, "Compiling Shaders (%d remaining)", g_data->queued_shaders_count);
+    SNPRINTF(ved->info, TIP_("Compiling Shaders (%d remaining)"), g_data->queued_shaders_count);
   }
 }
 
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 7874f06da47..d1b601e6f96 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -13,6 +13,8 @@
 
 #include "BLI_math.h"
 
+#include "BLT_translation.h"
+
 #include "BKE_customdata.h"
 
 #include "RNA_define.h"
@@ -530,6 +532,7 @@ static void rna_def_material_greasepencil(BlenderRNA *brna)
   RNA_def_property_float_sdna(prop, NULL, "mix_factor");
   RNA_def_property_range(prop, 0.0f, 1.0f);
   RNA_def_property_ui_text(prop, "Mix", "Mix Factor");
+  RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_GPENCIL);
   RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update");
 
   /* Stroke Mix factor */
@@ -537,6 +540,7 @@ static void rna_def_material_greasepencil(BlenderRNA *brna)
   RNA_def_property_float_sdna(prop, NULL, "mix_stroke_factor");
   RNA_def_property_range(prop, 0.0f, 1.0f);
   RNA_def_property_ui_text(prop, "Mix", "Mix Stroke Factor");
+  RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_GPENCIL);
   RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update");
 
   /* Texture angle */
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 0639ad29db4..aa7b1ae01dc 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -6826,7 +6826,7 @@ static void rna_def_modifier_normaledit(BlenderRNA *brna)
   prop = RNA_def_property(srna, "mix_factor", PROP_FLOAT, PROP_FACTOR);
   RNA_def_property_range(prop, 0.0, 1.0);
   RNA_def_property_ui_text(
-      prop, "Mix Factor", "How much of generated normals to mix with exiting ones");
+      prop, "Mix Factor", "How much of generated normals to mix with existing ones");
   RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
   prop = RNA_def_property(srna, "mix_limit", PROP_FLOAT, PROP_ANGLE);
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index 3d8b5159323..b53b055cda8 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -954,7 +954,7 @@ static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop)
   RNA_def_property_srna(cprop, "NlaStrips");
   srna = RNA_def_struct(brna, "NlaStrips", NULL);
   RNA_def_struct_sdna(srna, "NlaTrack");
-  RNA_def_struct_ui_text(srna, "Nla Strips", "Collection of Nla Strips");
+  RNA_def_struct_ui_text(srna, "NLA Strips", "Collection of NLA Strips");
 
   func = RNA_def_function(srna, "new", "rna_NlaStrip_new");
   RNA_def_function_flag(func,
@@ -994,7 +994,7 @@ static void rna_def_nlatrack(BlenderRNA *brna)
 
   srna = RNA_def_struct(brna, "NlaTrack", NULL);
   RNA_def_struct_ui_text(
-      srna, "NLA Track", "A animation layer containing Actions referenced as NLA strips");
+      srna, "NLA Track", "An animation layer containing Actions referenced as NLA strips");
   RNA_def_struct_ui_icon(srna, ICON_NLA);
 
   /* strips collection */
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index e007457297e..7ba3971b4ea 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -4968,6 +4968,7 @@ static void def_float_to_int(StructRNA *srna)
   RNA_def_property_enum_items(prop, rna_enum_node_float_to_int_items);
   RNA_def_property_ui_text(
       prop, "Rounding Mode", "Method used to convert the float to an integer");
+  RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_NODETREE);
   RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 }
 
@@ -4979,6 +4980,7 @@ static void def_vector_math(StructRNA *srna)
   RNA_def_property_enum_sdna(prop

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list