[Bf-blender-cvs] [ee985fa9257] blender-v3.3-release: I18n: disambiguate a few translations

Damien Picard noreply at git.blender.org
Mon Aug 22 14:37:23 CEST 2022


Commit: ee985fa92577bd7df945b3a0146414209e109c29
Author: Damien Picard
Date:   Mon Aug 22 14:30:32 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rBee985fa92577bd7df945b3a0146414209e109c29

I18n: disambiguate a few translations

- Keying (keyframe insertion)
- Roughness (particle children)
- New image, collection, text (in menus)
- Parents (particles)
- Wrap (text)
- Light (add menu)
- Empty (volume add menu)
- Empty (empty add menu)
- Cycles (f-curve modifier)
- Drag (workspace tool type)
- Power (light intensity)
- Power (math nodes)

This last change also moves all math operations in nodes to the
ID_nodetree context. It's needed only for some operations, but we
can't be more granular here.

Also...

- Fix context extraction for interpolation mode headers in F-Curves
  and GPencil interpolation operator
- Enable new translation: "Slot %d" in image editor
- Fix an English message in the node editor:
  "Replace the input image's alpha channels by..." -> channel

Ref. T43295

Reviewed By: mont29

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

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

M	release/scripts/startup/bl_ui/properties_particle.py
M	release/scripts/startup/bl_ui/space_image.py
M	release/scripts/startup/bl_ui/space_outliner.py
M	release/scripts/startup/bl_ui/space_text.py
M	release/scripts/startup/bl_ui/space_time.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/blenkernel/intern/fmodifier.c
M	source/blender/blenkernel/intern/image.cc
M	source/blender/editors/gpencil/gpencil_interpolate.c
M	source/blender/editors/mesh/editmesh_select_similar.c
M	source/blender/makesrna/intern/rna_curve.c
M	source/blender/makesrna/intern/rna_light.c
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/makesrna/intern/rna_particle.c
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/nodes/intern/node_util.c
M	source/blender/nodes/shader/nodes/node_shader_math.cc

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

diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index cd390eee970..2bf12401f79 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -1654,6 +1654,7 @@ class PARTICLE_PT_children_clumping_noise(ParticleButtonsPanel, Panel):
 
 class PARTICLE_PT_children_roughness(ParticleButtonsPanel, Panel):
     bl_label = "Roughness"
+    bl_translation_context = i18n_contexts.id_particlesettings
     bl_parent_id = "PARTICLE_PT_children"
     bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'}
@@ -1676,7 +1677,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="Roughness")
+            sub.prop(part, "roughness_1", text=iface_("Roughness", 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_image.py b/release/scripts/startup/bl_ui/space_image.py
index ab3c863ea2d..6a231c74cd9 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -29,8 +29,10 @@ from bl_ui.space_toolsystem_common import (
     ToolActivePanelHelper,
 )
 
-from bpy.app.translations import pgettext_iface as iface_
-
+from bpy.app.translations import (
+    contexts as i18n_contexts,
+    pgettext_iface as iface_,
+)
 
 class ImagePaintPanel:
     bl_space_type = 'IMAGE_EDITOR'
@@ -187,7 +189,8 @@ class IMAGE_MT_image(Menu):
         ima = sima.image
         show_render = sima.show_render
 
-        layout.operator("image.new", text="New")
+        layout.operator("image.new", text="New",
+                        text_ctxt=i18n_contexts.id_image)
         layout.operator("image.open", text="Open...", icon='FILE_FOLDER')
 
         layout.operator("image.read_viewlayers")
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index 4867237f353..2a2d67d78a4 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -2,6 +2,10 @@
 import bpy
 from bpy.types import Header, Menu, Panel
 
+from bpy.app.translations import (
+    contexts as i18n_contexts,
+    pgettext_iface as iface_,
+)
 
 class OUTLINER_HT_header(Header):
     bl_space_type = 'OUTLINER'
@@ -211,7 +215,8 @@ class OUTLINER_MT_collection(Menu):
 
         space = context.space_data
 
-        layout.operator("outliner.collection_new", text="New").nested = True
+        layout.operator("outliner.collection_new", text="New",
+                        text_ctxt=i18n_contexts.id_collection).nested = True
         layout.operator("outliner.collection_duplicate", text="Duplicate Collection")
         layout.operator("outliner.collection_duplicate_linked", text="Duplicate Linked")
         layout.operator("outliner.id_copy", text="Copy", icon='COPYDOWN')
diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py
index 52d66e48d1c..e6f4ea75189 100644
--- a/release/scripts/startup/bl_ui/space_text.py
+++ b/release/scripts/startup/bl_ui/space_text.py
@@ -1,7 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 import bpy
 from bpy.types import Header, Menu, Panel
-from bpy.app.translations import pgettext_iface as iface_
+from bpy.app.translations import (
+    contexts as i18n_contexts,
+    pgettext_iface as iface_,
+)
 
 
 class TEXT_HT_header(Header):
@@ -168,7 +171,8 @@ class TEXT_PT_find(Panel):
         if not st.text:
             row.active = False
         row.prop(st, "use_match_case", text="Case", toggle=True)
-        row.prop(st, "use_find_wrap", text="Wrap", toggle=True)
+        row.prop(st, "use_find_wrap", text="Wrap",
+                 text_ctxt=i18n_contexts.id_text, toggle=True)
         row.prop(st, "use_find_all", text="All", toggle=True)
 
 
@@ -234,7 +238,8 @@ class TEXT_MT_text(Menu):
         st = context.space_data
         text = st.text
 
-        layout.operator("text.new", text="New", icon='FILE_NEW')
+        layout.operator("text.new", text="New",
+                        text_ctxt=i18n_contexts.id_text, icon='FILE_NEW')
         layout.operator("text.open", text="Open...", icon='FILE_FOLDER')
 
         if text:
diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py
index 115f61a7c19..d948ea09a74 100644
--- a/release/scripts/startup/bl_ui/space_time.py
+++ b/release/scripts/startup/bl_ui/space_time.py
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 import bpy
 from bpy.types import Menu, Panel
+from bpy.app.translations import contexts as i18n_contexts
 
 
 # Header buttons for timeline header (play, etc.)
@@ -87,6 +88,7 @@ class TIME_MT_editor_menus(Menu):
         sub.popover(
             panel="TIME_PT_keyframing_settings",
             text="Keying",
+            text_ctxt=i18n_contexts.id_windowmanager,
         )
 
         # Add a separator to keep the popover button from aligning with the menu button.
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 5dcfa60665a..e0970a9708e 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2212,6 +2212,7 @@ class VIEW3D_MT_armature_add(Menu):
 
 class VIEW3D_MT_light_add(Menu):
     bl_idname = "VIEW3D_MT_light_add"
+    bl_context = i18n_contexts.id_light
     bl_label = "Light"
 
     def draw(self, _context):
@@ -2249,7 +2250,9 @@ class VIEW3D_MT_volume_add(Menu):
     def draw(self, _context):
         layout = self.layout
         layout.operator("object.volume_import", text="Import OpenVDB...", icon='OUTLINER_DATA_VOLUME')
-        layout.operator("object.volume_add", text="Empty", icon='OUTLINER_DATA_VOLUME')
+        layout.operator("object.volume_add", text="Empty",
+                        text_ctxt=i18n_contexts.id_volume,
+                        icon='OUTLINER_DATA_VOLUME')
 
 
 class VIEW3D_MT_add(Menu):
@@ -2290,7 +2293,9 @@ class VIEW3D_MT_add(Menu):
 
         layout.separator()
 
-        layout.operator_menu_enum("object.empty_add", "type", text="Empty", icon='OUTLINER_OB_EMPTY')
+        layout.operator_menu_enum("object.empty_add", "type", text="Empty",
+                                  text_ctxt=i18n_contexts.id_id,
+                                  icon='OUTLINER_OB_EMPTY')
         layout.menu("VIEW3D_MT_image_add", text="Image", icon='OUTLINER_OB_IMAGE')
 
         layout.separator()
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index e4c7572b9e4..11c3dfc18dc 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -768,19 +768,19 @@ static void fcm_cycles_evaluate(FCurve *UNUSED(fcu),
 }
 
 static FModifierTypeInfo FMI_CYCLES = {
-    FMODIFIER_TYPE_CYCLES,      /* type */
-    sizeof(FMod_Cycles),        /* size */
-    FMI_TYPE_EXTRAPOLATION,     /* action type */
-    FMI_REQUIRES_ORIGINAL_DATA, /* requirements */
-    N_("Cycles"),               /* name */
-    "FMod_Cycles",              /* struct name */
-    sizeof(tFCMED_Cycles),      /* storage size */
-    NULL,                       /* free data */
-    NULL,                       /* copy data */
-    fcm_cycles_new_data,        /* new data */
-    NULL /*fcm_cycles_verify*/, /* verify */
-    fcm_cycles_time,            /* evaluate time */
-    fcm_cycles_evaluate,        /* evaluate */
+    FMODIFIER_TYPE_CYCLES,                       /* type */
+    sizeof(FMod_Cycles),                         /* size */
+    FMI_TYPE_EXTRAPOLATION,                      /* action type */
+    FMI_REQUIRES_ORIGINAL_DATA,                  /* requirements */
+    CTX_N_(BLT_I18NCONTEXT_ID_ACTION, "Cycles"), /* name */
+    "FMod_Cycles",                               /* struct name */
+    sizeof(tFCMED_Cycles),                       /* storage size */
+    NULL,                                        /* free data */
+    NULL,                                        /* copy data */
+    fcm_cycles_new_data,                         /* new data */
+    NULL /*fcm_cycles_verify*/,                  /* verify */
+    fcm_cycles_time,                             /* evaluate time */
+    fcm_cycles_evaluate,                         /* evaluate */
 };
 
 /* Noise F-Curve Modifier  --------------------------- */
diff --git a/source/blender/blenkernel/intern/image.cc b/source/blender/blenkernel/intern/image.cc
index 78eaba44a08..b196bcd7207 100644
--- a/source/blender/blenkernel/intern/image.cc
+++ b/source/blender/blenkernel/intern/image.cc
@@ -5428,7 +5428,7 @@ RenderSlot *BKE_image_add_renderslot(Image *ima, const char *name)
   }
   else {
     int n = BLI_listbase_count(&ima->renderslots) + 1;
-    BLI_snprintf(slot->name, sizeof(slot->name), "Slot %d", n);
+    BLI_snprintf(slot->name, sizeof(slot->name), DATA_("Slot %d"), n);
   }
   BLI_addtail(&ima->renderslots, slot);
   return slot;
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index e7a4f2fe2dc..94afc36f5ee 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -1483,7 +1483,8 @@ void GPENCIL_OT_interpolate_sequence(wmOperatorType *ot)
    */
   static const EnumPropertyItem gpencil_interpolation_type_items[] = {
       /* Interpolation. */
-      RNA_ENUM_ITEM_HEADING(N_("Interpolation"), "Standard transitions between keyframes"),
+      RNA_ENUM_ITEM_HEADING(CTX_N_(BLT_I18NCONTEXT_ID_GPENCIL, "Interpolation"),
+                            "Standard transitions between keyframes"),
       {GP_IPO_LINEAR,
        "LINEAR",
        ICON_IPO_LINEAR,
@@ -1496,7 +1497,8 @@ void GPENCIL_OT_interpolate_sequence(wmOpera

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list