[Bf-blender-cvs] [9795f2645c7] blender-v3.4-release: I18n: fix description_from_data_path() for property assignment

Damien Picard noreply at git.blender.org
Tue Nov 15 11:29:16 CET 2022


Commit: 9795f2645c75e1ad80ba853d3f2dd35e63921860
Author: Damien Picard
Date:   Tue Nov 15 11:28:41 2022 +0100
Branches: blender-v3.4-release
https://developer.blender.org/rB9795f2645c75e1ad80ba853d3f2dd35e63921860

I18n: fix description_from_data_path() for property assignment

The property assignment operators' tooltips were never actually
translated when they were constructed dynamically from the description
in the prop's RNA.

This was visible when using such operators in menus (example I found
was the Marker Settings, Shift + E in the Movie Clip Editor).

"%s: %s" is already extracted elsewhere, might as well use it.

Reviewed By: mont29

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

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

M	release/scripts/startup/bl_operators/wm.py

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

diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 1487236038c..0bf9e71d130 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -203,9 +203,9 @@ def description_from_data_path(base, data_path, *, prefix, value=Ellipsis):
 
     if (
             (rna_prop := context_path_to_rna_property(base, data_path)) and
-            (description := rna_prop.description)
+            (description := iface_(rna_prop.description))
     ):
-        description = "%s: %s" % (prefix, description)
+        description = iface_("%s: %s") % (prefix, description)
         if value != Ellipsis:
             description = "%s\n%s: %s" % (description, iface_("Value"), str(value))
         return description
@@ -305,7 +305,7 @@ class WM_OT_context_set_int(Operator):  # same as enum
 
     @classmethod
     def description(cls, context, props):
-        return description_from_data_path(context, props.data_path, prefix="Assign", value=props.value)
+        return description_from_data_path(context, props.data_path, prefix=iface_("Assign"), value=props.value)
 
     execute = execute_context_assign
 
@@ -406,7 +406,7 @@ class WM_OT_context_set_float(Operator):  # same as enum
 
     @classmethod
     def description(cls, context, props):
-        return description_from_data_path(context, props.data_path, prefix="Assign", value=props.value)
+        return description_from_data_path(context, props.data_path, prefix=iface_("Assign"), value=props.value)
 
     execute = execute_context_assign



More information about the Bf-blender-cvs mailing list