[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54393] trunk/blender: Fix uilists showing data names translated ( reported on bf-translations ML by Satoshi Yamasaki aka yamyam, thanks!).

Bastien Montagne montagne29 at wanadoo.fr
Fri Feb 8 17:01:22 CET 2013


Revision: 54393
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54393
Author:   mont29
Date:     2013-02-08 16:01:21 +0000 (Fri, 08 Feb 2013)
Log Message:
-----------
Fix uilists showing data names translated (reported on bf-translations ML by Satoshi Yamasaki aka yamyam, thanks!).

Modified Paths:
--------------
    trunk/blender/doc/python_api/examples/bpy.types.UIList.py
    trunk/blender/release/scripts/startup/bl_ui/properties_data_mesh.py
    trunk/blender/release/scripts/startup/bl_ui/properties_mask_common.py
    trunk/blender/release/scripts/startup/bl_ui/properties_material.py
    trunk/blender/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
    trunk/blender/release/scripts/startup/bl_ui/properties_render.py
    trunk/blender/release/scripts/startup/bl_ui/properties_scene.py
    trunk/blender/release/scripts/startup/bl_ui/properties_texture.py
    trunk/blender/release/scripts/startup/bl_ui/space_clip.py
    trunk/blender/release/scripts/templates_py/ui_list.py

Modified: trunk/blender/doc/python_api/examples/bpy.types.UIList.py
===================================================================
--- trunk/blender/doc/python_api/examples/bpy.types.UIList.py	2013-02-08 15:56:14 UTC (rev 54392)
+++ trunk/blender/doc/python_api/examples/bpy.types.UIList.py	2013-02-08 16:01:21 UTC (rev 54393)
@@ -31,7 +31,8 @@
             # You should always start your row layout by a label (icon + text), this will also make the row easily
             # selectable in the list!
             # We use icon_value of label, as our given icon is an integer value, not an enum ID.
-            layout.label(ma.name if ma else "", icon_value=icon)
+            # Note "data" names should never be translated!
+            layout.label(text=ma.name if ma else "", translate=False, icon_value=icon)
             # And now we can add other UI stuff...
             # Here, we add nodes info if this material uses (old!) shading nodes.
             if ma and not context.scene.render.use_shading_nodes:
@@ -39,15 +40,15 @@
                 if manode:
                     # The static method UILayout.icon returns the integer value of the icon ID "computed" for the given
                     # RNA object.
-                    layout.label("Node %s" % manode.name, icon_value=layout.icon(manode))
+                    layout.label(text="Node %s" % manode.name, translate=False, icon_value=layout.icon(manode))
                 elif ma.use_nodes:
-                    layout.label("Node <none>")
+                    layout.label(text="Node <none>", translate=False)
                 else:
-                    layout.label("")
+                    layout.label(text="")
         # 'GRID' layout type should be as compact as possible (typically a single icon!).
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 # And now we can use this list everywhere in Blender. Here is a small example panel.

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_data_mesh.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_data_mesh.py	2013-02-08 15:56:14 UTC (rev 54392)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_data_mesh.py	2013-02-08 16:01:21 UTC (rev 54393)
@@ -60,12 +60,12 @@
         # assert(isinstance(item, bpy.types.VertexGroup)
         vgroup = item
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            layout.label(vgroup.name, icon_value=icon)
+            layout.label(text=vgroup.name, translate=False, icon_value=icon)
             icon = 'LOCKED' if vgroup.lock_weight else 'UNLOCKED'
             layout.prop(vgroup, "lock_weight", text="", icon=icon, emboss=False)
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 class MESH_UL_shape_keys(UIList):
@@ -76,30 +76,30 @@
         key_block = item
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
             split = layout.split(0.66, False)
-            split.label(item.name, icon_value=icon)
+            split.label(text=item.name, translate=False, icon_value=icon)
             row = split.row(True)
             if key_block.mute or (obj.mode == 'EDIT' and not (obj.use_shape_key_edit_mode and obj.type == 'MESH')):
                 row.active = False
             if not item.relative_key or index > 0:
                 row.prop(key_block, "value", text="", emboss=False)
             else:
-                row.label("")
+                row.label(text="")
             row.prop(key_block, "mute", text="", emboss=False)
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 class MESH_UL_uvmaps_vcols(UIList):
     def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
         # assert(isinstance(item, (bpy.types.MeshTexturePolyLayer, bpy.types.MeshLoopColorLayer))
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            layout.label(item.name, icon_value=icon)
+            layout.label(text=item.name, translate=False, icon_value=icon)
             icon = 'RESTRICT_RENDER_OFF' if item.active_render else 'RESTRICT_RENDER_ON'
             layout.prop(item, "active_render", text="", icon=icon, emboss=False)
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 class MeshButtonsPanel():

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_mask_common.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_mask_common.py	2013-02-08 15:56:14 UTC (rev 54392)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_mask_common.py	2013-02-08 16:01:21 UTC (rev 54393)
@@ -32,7 +32,7 @@
         mask = item
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
             split = layout.split()
-            split.label(mask.name, icon_value=icon)
+            split.label(text=mask.name, translate=False, icon_value=icon)
             row = split.row(align=True)
             row.prop(mask, "alpha", text="", emboss=False)
             row.prop(mask, "hide", text="", emboss=False)
@@ -40,7 +40,7 @@
             row.prop(mask, "hide_render", text="", emboss=False)
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 class MASK_PT_mask:

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_material.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_material.py	2013-02-08 15:56:14 UTC (rev 54392)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_material.py	2013-02-08 16:01:21 UTC (rev 54393)
@@ -76,16 +76,18 @@
         slot = item
         ma = slot.material
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            layout.label(ma.name if ma else "", icon_value=icon)
+            layout.label(text=ma.name if ma else "", translate=False, icon_value=icon)
             if ma and not context.scene.render.use_shading_nodes:
                 manode = ma.active_node_material
                 if manode:
-                    layout.label("Node %s" % manode.name, icon_value=layout.icon(manode))
+                    layout.label(text="Node %s" % manode.name, translate=False, icon_value=layout.icon(manode))
                 elif ma.use_nodes:
-                    layout.label("Node <none>")
+                    layout.label(text="Node <none>", translate=False)
+                else:
+                    layout.label(text="")
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 class MaterialButtonsPanel():

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py	2013-02-08 15:56:14 UTC (rev 54392)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py	2013-02-08 16:01:21 UTC (rev 54393)
@@ -33,7 +33,7 @@
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
             row = layout.row(align=True)
             row.label(text="", icon_value=icon)
-            row.label(text=surf.name, icon_value=sticon)
+            row.label(text=surf.name, translate=False, icon_value=sticon)
             row = layout.row(align=True)
             if surf.use_color_preview:
                 row.prop(surf, "show_preview", text="", emboss=False,

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_render.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_render.py	2013-02-08 15:56:14 UTC (rev 54392)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_render.py	2013-02-08 16:01:21 UTC (rev 54393)
@@ -48,19 +48,13 @@
         # assert(isinstance(item, bpy.types.SceneRenderLayer)
         layer = item
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            layout.label(layer.name, icon_value=icon)
+            layout.label(text=layer.name, translate=False, icon_value=icon)
             layout.prop(layer, "use", text="", index=index)
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
-#	else if (RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer)) {
-#		uiItemL(sub, name, icon);
-#		uiBlockSetEmboss(block, UI_EMBOSS);
-#		uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "use", 0, 0, 0, 0, 0,  NULL);
-#	}
 
-
 class RenderButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_scene.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_scene.py	2013-02-08 15:56:14 UTC (rev 54392)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_scene.py	2013-02-08 16:01:21 UTC (rev 54393)
@@ -32,10 +32,10 @@
         kspath = item
         icon = layout.enum_item_icon(kspath, "id_type", kspath.id_type)
         if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            layout.label(kspath.data_path, icon_value=icon)
+            layout.label(text=kspath.data_path, translate=False, icon_value=icon)
         elif self.layout_type in {'GRID'}:
             layout.alignment = 'CENTER'
-            layout.label("", icon_value=icon)
+            layout.label(text="", icon_value=icon)
 
 
 class SceneButtonsPanel():

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_texture.py
===================================================================

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list