I18n: translate node group socket type and subtype

Node group sockets have user-exposed data types, and sometimes
subtypes for some data types (e.g. Percentage or Angle for floats).
The UI to select these types and subtypes use an operator menu with a
text depending on the current type or subtype.

This button needs to be manually translated since its label is
manually defined.

Additionally, some subtypes need to be extracted from the Property
class's RNA_ENUM_PROPERTY_SUBTYPE_NUMBER_ITEMS, so this commit also
removes Property from the extraction blacklist in
bl_extract_messages.py. This has the side effect that it introduces a
few dozens translations, which are probably not used anywhere.

Pull Request: https://projects.blender.org/blender/blender/pulls/107100
This commit is contained in:
Damien Picard 2023-04-18 01:13:17 +02:00 committed by Gitea
parent b905b02222
commit 3f1ea280cf
2 changed files with 5 additions and 6 deletions

View File

@ -204,7 +204,7 @@ def dump_rna_messages(msgs, reports, settings, verbose=False):
def class_blacklist():
blacklist_rna_class = {getattr(bpy.types, cls_id) for cls_id in (
# core classes
"Context", "Event", "Function", "UILayout", "UnknownType", "Property", "Struct",
"Context", "Event", "Function", "UILayout", "UnknownType", "Struct",
# registerable classes
"Panel", "Menu", "Header", "RenderEngine", "Operator", "OperatorMacro", "Macro", "KeyingSetInfo",
)

View File

@ -886,7 +886,8 @@ class NodeTreeInterfacePanel(Panel):
props = property_row.operator_menu_enum(
"node.tree_socket_change_type",
"socket_type",
text=active_socket.bl_label if active_socket.bl_label else active_socket.bl_idname,
text=(iface_(active_socket.bl_label) if active_socket.bl_label
else iface_(active_socket.bl_idname)),
)
props.in_out = in_out
@ -904,10 +905,8 @@ class NodeTreeInterfacePanel(Panel):
props = property_row.operator_menu_enum(
"node.tree_socket_change_subtype",
"socket_subtype",
text=(
active_socket.bl_subtype_label if active_socket.bl_subtype_label else
active_socket.bl_idname
),
text=(iface_(active_socket.bl_subtype_label) if active_socket.bl_subtype_label
else iface_(active_socket.bl_idname)),
)
layout.use_property_split = True