Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Picard <pioverfour>2022-08-04 17:13:18 +0300
committerBastien Montagne <bastien@blender.org>2022-08-04 18:05:34 +0300
commitaa53eca6b5984f94b8ab151492355d448abf7d86 (patch)
tree616ad0a611361e69e4073b8e7802ac89d0d89906 /release/scripts/startup/bl_operators
parent0844781961e8fb92c5b3a09de23ca0c3a0fff0c2 (diff)
I18n: make several parts of the UI translatable
- batch rename - keyframe settings - tool name in Tool properties header - tool name in Tool properties Drag (fake) enum - new file templates - new preset - new text datablock - new collection datablock - new geometry nodes (modifier and node group) - new grease pencil data (layers and materials) Ref. T43295 Reviewed By: mont29 Differential Revision: https://developer.blender.org/D15533
Diffstat (limited to 'release/scripts/startup/bl_operators')
-rw-r--r--release/scripts/startup/bl_operators/geometry_nodes.py6
-rw-r--r--release/scripts/startup/bl_operators/presets.py4
-rw-r--r--release/scripts/startup/bl_operators/wm.py46
3 files changed, 30 insertions, 26 deletions
diff --git a/release/scripts/startup/bl_operators/geometry_nodes.py b/release/scripts/startup/bl_operators/geometry_nodes.py
index ea4d40bb778..1f573543e7b 100644
--- a/release/scripts/startup/bl_operators/geometry_nodes.py
+++ b/release/scripts/startup/bl_operators/geometry_nodes.py
@@ -3,9 +3,11 @@
import bpy
from bpy.types import Operator
+from bpy.app.translations import pgettext_data as data_
+
def geometry_node_group_empty_new():
- group = bpy.data.node_groups.new("Geometry Nodes", 'GeometryNodeTree')
+ group = bpy.data.node_groups.new(data_("Geometry Nodes"), 'GeometryNodeTree')
group.inputs.new('NodeSocketGeometry', "Geometry")
group.outputs.new('NodeSocketGeometry', "Geometry")
input_node = group.nodes.new('NodeGroupInput')
@@ -45,7 +47,7 @@ class NewGeometryNodesModifier(Operator):
return geometry_modifier_poll(context)
def execute(self, context):
- modifier = context.object.modifiers.new("GeometryNodes", "NODES")
+ modifier = context.object.modifiers.new(data_("GeometryNodes"), "NODES")
if not modifier:
return {'CANCELLED'}
diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py
index cde4348977f..6bfce948412 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -11,11 +11,13 @@ from bpy.props import (
StringProperty,
)
+from bpy.app.translations import pgettext_data as data_
+
# For preset popover menu
WindowManager.preset_name = StringProperty(
name="Preset Name",
description="Name for new preset",
- default="New Preset"
+ default=data_("New Preset")
)
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 3ab124bf4cf..7e7dbbc387e 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -2483,8 +2483,8 @@ class BatchRenameAction(bpy.types.PropertyGroup):
)
# Weak, add/remove as properties.
- op_add: BoolProperty()
- op_remove: BoolProperty()
+ op_add: BoolProperty(name="Add")
+ op_remove: BoolProperty(name="Remove")
class WM_OT_batch_rename(Operator):
@@ -2570,7 +2570,7 @@ class WM_OT_batch_rename(Operator):
if only_selected else
scene.sequence_editor.sequences_all,
"name",
- "Strip(s)",
+ iface_("Strip(s)"),
)
elif space_type == 'NODE_EDITOR':
data_type_test = 'NODE'
@@ -2582,7 +2582,7 @@ class WM_OT_batch_rename(Operator):
if only_selected else
list(space.node_tree.nodes),
"name",
- "Node(s)",
+ iface_("Node(s)"),
)
elif space_type == 'OUTLINER':
data_type_test = 'COLLECTION'
@@ -2594,7 +2594,7 @@ class WM_OT_batch_rename(Operator):
if only_selected else
scene.collection.children_recursive,
"name",
- "Collection(s)",
+ iface_("Collection(s)"),
)
else:
if mode == 'POSE' or (mode == 'WEIGHT_PAINT' and context.pose_object):
@@ -2607,7 +2607,7 @@ class WM_OT_batch_rename(Operator):
if only_selected else
[pbone.bone for ob in context.objects_in_mode_unique_data for pbone in ob.pose.bones],
"name",
- "Bone(s)",
+ iface_("Bone(s)"),
)
elif mode == 'EDIT_ARMATURE':
data_type_test = 'BONE'
@@ -2619,24 +2619,24 @@ class WM_OT_batch_rename(Operator):
if only_selected else
[ebone for ob in context.objects_in_mode_unique_data for ebone in ob.data.edit_bones],
"name",
- "Edit Bone(s)",
+ iface_("Edit Bone(s)"),
)
if check_context:
return 'OBJECT'
object_data_type_attrs_map = {
- 'MESH': ("meshes", "Mesh(es)", bpy.types.Mesh),
- 'CURVE': ("curves", "Curve(s)", bpy.types.Curve),
- 'META': ("metaballs", "Metaball(s)", bpy.types.MetaBall),
- 'VOLUME': ("volumes", "Volume(s)", bpy.types.Volume),
- 'GPENCIL': ("grease_pencils", "Grease Pencil(s)", bpy.types.GreasePencil),
- 'ARMATURE': ("armatures", "Armature(s)", bpy.types.Armature),
- 'LATTICE': ("lattices", "Lattice(s)", bpy.types.Lattice),
- 'LIGHT': ("lights", "Light(s)", bpy.types.Light),
- 'LIGHT_PROBE': ("light_probes", "Light Probe(s)", bpy.types.LightProbe),
- 'CAMERA': ("cameras", "Camera(s)", bpy.types.Camera),
- 'SPEAKER': ("speakers", "Speaker(s)", bpy.types.Speaker),
+ 'MESH': ("meshes", iface_("Mesh(es)"), bpy.types.Mesh),
+ 'CURVE': ("curves", iface_("Curve(s)"), bpy.types.Curve),
+ 'META': ("metaballs", iface_("Metaball(s)"), bpy.types.MetaBall),
+ 'VOLUME': ("volumes", iface_("Volume(s)"), bpy.types.Volume),
+ 'GPENCIL': ("grease_pencils", iface_("Grease Pencil(s)"), bpy.types.GreasePencil),
+ 'ARMATURE': ("armatures", iface_("Armature(s)"), bpy.types.Armature),
+ 'LATTICE': ("lattices", iface_("Lattice(s)"), bpy.types.Lattice),
+ 'LIGHT': ("lights", iface_("Light(s)"), bpy.types.Light),
+ 'LIGHT_PROBE': ("light_probes", iface_("Light Probe(s)"), bpy.types.LightProbe),
+ 'CAMERA': ("cameras", iface_("Camera(s)"), bpy.types.Camera),
+ 'SPEAKER': ("speakers", iface_("Speaker(s)"), bpy.types.Speaker),
}
# Finish with space types.
@@ -2654,7 +2654,7 @@ class WM_OT_batch_rename(Operator):
if only_selected else
[id for id in bpy.data.objects if id.library is None],
"name",
- "Object(s)",
+ iface_("Object(s)"),
)
elif data_type == 'COLLECTION':
data = (
@@ -2669,7 +2669,7 @@ class WM_OT_batch_rename(Operator):
if only_selected else
[id for id in bpy.data.collections if id.library is None],
"name",
- "Collection(s)",
+ iface_("Collection(s)"),
)
elif data_type == 'MATERIAL':
data = (
@@ -2688,7 +2688,7 @@ class WM_OT_batch_rename(Operator):
if only_selected else
[id for id in bpy.data.materials if id.library is None],
"name",
- "Material(s)",
+ iface_("Material(s)"),
)
elif data_type in object_data_type_attrs_map.keys():
attr, descr, ty = object_data_type_attrs_map[data_type]
@@ -2913,7 +2913,7 @@ class WM_OT_batch_rename(Operator):
row.prop(action, "op_remove", text="", icon='REMOVE')
row.prop(action, "op_add", text="", icon='ADD')
- layout.label(text="Rename %d %s" % (len(self._data[0]), self._data[2]))
+ layout.label(text=iface_("Rename %d %s") % (len(self._data[0]), self._data[2]))
def check(self, context):
changed = False
@@ -2974,7 +2974,7 @@ class WM_OT_batch_rename(Operator):
change_len += 1
total_len += 1
- self.report({'INFO'}, "Renamed %d of %d %s" % (change_len, total_len, descr))
+ self.report({'INFO'}, tip_("Renamed %d of %d %s") % (change_len, total_len, descr))
return {'FINISHED'}