I18n: translate node group socket type and subtype #107100

Merged
Bastien Montagne merged 1 commits from pioverfour/blender:dp_translate_node_group_socket_type into main 2023-05-16 14:53:36 +02:00
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",
Review

I find it weird that you need to remove this from the blacklist.... can you elaborate on the why?

I find it weird that you need to remove this from the blacklist.... can you elaborate on the why?
Review

Yes, Time (Scene Relative) and Time (Absolute) are both defined as part of bpy.types.Property:

print(bpy.types.Property.bl_rna.properties['subtype'].enum_items.get("TIME").name)  # Time (Scene Relative)
print(bpy.types.Property.bl_rna.properties['subtype'].enum_items.get("TIME_ABSOLUTE").name)  # Time (Absolute)

They are not extracted from anywhere else.

Is there a better way to extract just those?

Yes, `Time (Scene Relative)` and `Time (Absolute)` are both defined as part of `bpy.types.Property`: ```python print(bpy.types.Property.bl_rna.properties['subtype'].enum_items.get("TIME").name) # Time (Scene Relative) print(bpy.types.Property.bl_rna.properties['subtype'].enum_items.get("TIME_ABSOLUTE").name) # Time (Absolute) ``` They are not extracted from anywhere else. Is there a better way to extract just those?
Review

Mmmm I see.... But are these strings actually shown in the UI? In theory this should only be API-related, they are not expected to be exposed directly to the user in the UI :|

Mmmm I see.... But are these strings actually shown in the UI? In theory this should only be API-related, they are not expected to be exposed directly to the user in the UI :|
Review

They are since e7f395dd20

They are since e7f395dd20
# registerable classes
"Panel", "Menu", "Header", "RenderEngine", "Operator", "OperatorMacro", "Macro", "KeyingSetInfo",
)

View File

@ -885,7 +885,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
@ -903,10 +904,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