[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54424] trunk/blender/release/scripts/ startup/bl_ui: Another fix for r54414 (cleaner to "import" pgettext once at top of files, also now using usual '_' shortcut).

Bastien Montagne montagne29 at wanadoo.fr
Sun Feb 10 10:09:26 CET 2013


Revision: 54424
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54424
Author:   mont29
Date:     2013-02-10 09:09:26 +0000 (Sun, 10 Feb 2013)
Log Message:
-----------
Another fix for r54414 (cleaner to "import" pgettext once at top of files, also now using usual '_' shortcut).

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54414

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/properties_data_modifier.py
    trunk/blender/release/scripts/startup/bl_ui/properties_material.py
    trunk/blender/release/scripts/startup/bl_ui/properties_particle.py
    trunk/blender/release/scripts/startup/bl_ui/properties_physics_fluid.py
    trunk/blender/release/scripts/startup/bl_ui/space_clip.py
    trunk/blender/release/scripts/startup/bl_ui/space_image.py
    trunk/blender/release/scripts/startup/bl_ui/space_sequencer.py
    trunk/blender/release/scripts/startup/bl_ui/space_text.py
    trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
    trunk/blender/release/scripts/startup/bl_ui/space_userpref_keymap.py

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_data_modifier.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_data_modifier.py	2013-02-10 08:54:10 UTC (rev 54423)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_data_modifier.py	2013-02-10 09:09:26 UTC (rev 54424)
@@ -20,7 +20,9 @@
 import bpy
 from bpy.types import Panel
 
+_ = bpy.app.translations.pgettext
 
+
 class ModifierButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
@@ -265,8 +267,7 @@
             layout.prop(md, "angle_limit")
             layout.prop(md, "use_dissolve_boundaries")
 
-        pgettext = bpy.app.translations.pgettext
-        layout.label(text=pgettext("Face Count: %d") % md.face_count, translate=False)
+        layout.label(text=_("Face Count: %d") % md.face_count, translate=False)
 
     def DISPLACE(self, layout, ob, md):
         has_texture = (md.texture is not None)

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_material.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_material.py	2013-02-10 08:54:10 UTC (rev 54423)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_material.py	2013-02-10 09:09:26 UTC (rev 54424)
@@ -21,7 +21,9 @@
 from bpy.types import Menu, Panel, UIList
 from rna_prop_ui import PropertyPanel
 
+_ = bpy.app.translations.pgettext
 
+
 def active_node_mat(mat):
     # TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
     # which settings from node-materials are used
@@ -80,8 +82,7 @@
             if ma and not context.scene.render.use_shading_nodes:
                 manode = ma.active_node_material
                 if manode:
-                    pgettext = bpy.app.translations.pgettext
-                    layout.label(text=pgettext("Node %s") % manode.name, translate=False, 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(text="Node <none>")
                 else:

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_particle.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_particle.py	2013-02-10 08:54:10 UTC (rev 54423)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_particle.py	2013-02-10 09:09:26 UTC (rev 54424)
@@ -21,6 +21,8 @@
 from bpy.types import Panel
 from rna_prop_ui import PropertyPanel
 
+_ = bpy.app.translations.pgettext
+
 from bl_ui.properties_physics_common import (point_cache_ui,
                                              effector_weights_ui,
                                              basic_force_field_settings_ui,
@@ -148,8 +150,7 @@
             #row.label(text="Render")
 
             if part.is_fluid:
-                pgettext = bpy.app.translations.pgettext
-                layout.label(text=pgettext("%d fluid particles for this frame") % part.count, translate=False)
+                layout.label(text=_("%d fluid particles for this frame") % part.count, translate=False)
                 return
 
             row = col.row()

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_physics_fluid.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_physics_fluid.py	2013-02-10 08:54:10 UTC (rev 54423)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_physics_fluid.py	2013-02-10 09:09:26 UTC (rev 54424)
@@ -20,7 +20,9 @@
 import bpy
 from bpy.types import Panel, Menu
 
+_ = bpy.app.translations.pgettext
 
+
 class FLUID_MT_presets(Menu):
     bl_label = "Fluid Presets"
     preset_subdir = "fluid"
@@ -64,8 +66,7 @@
 
         if fluid.type == 'DOMAIN':
             # odd formatting here so translation script can extract string
-            pgettext = bpy.app.translations.pgettext
-            layout.operator("fluid.bake", text=pgettext("Bake (Req. Memory: %s)") % fluid.memory_estimate,
+            layout.operator("fluid.bake", text=_("Bake (Req. Memory: %s)") % fluid.memory_estimate,
                             translate=False, icon='MOD_FLUIDSIM')
             split = layout.split()
 

Modified: trunk/blender/release/scripts/startup/bl_ui/space_clip.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_clip.py	2013-02-10 08:54:10 UTC (rev 54423)
+++ trunk/blender/release/scripts/startup/bl_ui/space_clip.py	2013-02-10 09:09:26 UTC (rev 54424)
@@ -21,7 +21,9 @@
 import bpy
 from bpy.types import Panel, Header, Menu, UIList
 
+_ = bpy.app.translations.pgettext
 
+
 class CLIP_UL_tracking_objects(UIList):
     def draw_item(self, context, layout, data, item, icon,
                   active_data, active_propname, index):
@@ -911,11 +913,9 @@
 
             ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
 
-            text = bpy.app.translations.pgettext("Zoom %d:%d")
+            text = _("Zoom %d:%d")
             for a, b in ratios:
-                layout.operator("clip.view_zoom_ratio",
-                                text=text % (a, b),
-                                translate=False).ratio = a / b
+                layout.operator("clip.view_zoom_ratio", text=text % (a, b), translate=False).ratio = a / b
         else:
             if sc.view == 'GRAPH':
                 layout.operator_context = 'INVOKE_REGION_PREVIEW'

Modified: trunk/blender/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_image.py	2013-02-10 08:54:10 UTC (rev 54423)
+++ trunk/blender/release/scripts/startup/bl_ui/space_image.py	2013-02-10 09:09:26 UTC (rev 54424)
@@ -22,7 +22,9 @@
 from bl_ui.properties_paint_common import UnifiedPaintPanel
 from bl_ui.properties_paint_common import brush_texture_settings
 
+_ = bpy.app.translations.pgettext
 
+
 class ImagePaintPanel(UnifiedPaintPanel):
     bl_space_type = 'IMAGE_EDITOR'
     bl_region_type = 'UI'
@@ -71,10 +73,8 @@
 
         ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
 
-        pgettext = bpy.app.translations.pgettext
         for a, b in ratios:
-            layout.operator("image.view_zoom_ratio", text=pgettext("Zoom %d:%d") % (a, b),
-                            translate=False).ratio = a / b
+            layout.operator("image.view_zoom_ratio", text=_("Zoom %d:%d") % (a, b), translate=False).ratio = a / b
 
         layout.separator()
 
@@ -723,7 +723,7 @@
 
         col = layout.column()
         col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
-
+        
         brush_texture_settings(col, brush, 0)
 
 

Modified: trunk/blender/release/scripts/startup/bl_ui/space_sequencer.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_sequencer.py	2013-02-10 08:54:10 UTC (rev 54423)
+++ trunk/blender/release/scripts/startup/bl_ui/space_sequencer.py	2013-02-10 09:09:26 UTC (rev 54424)
@@ -20,7 +20,9 @@
 import bpy
 from bpy.types import Header, Menu, Panel
 
+_ = bpy.app.translations.pgettext
 
+
 def act_strip(context):
     try:
         return context.scene.sequence_editor.active_strip
@@ -420,19 +422,15 @@
         sub.prop(strip, "frame_start")
         sub.prop(strip, "frame_final_duration")
 
-        pgettext = bpy.app.translations.pgettext
         col = layout.column(align=True)
         row = col.row()
-        row.label(text=pgettext("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration),
-                  translate=False)
+        row.label(text=_("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration), translate=False)
         row = col.row()
         row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_duration)
-        row.label(text=pgettext("Playhead: %d") % (frame_current - strip.frame_start), translate=False)
+        row.label(text=_("Playhead: %d") % (frame_current - strip.frame_start), translate=False)
 
-        col.label(text=pgettext("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end),
-                  translate=False)
-        col.label(text=pgettext("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end),
-                  translate=False)
+        col.label(text=_("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end), translate=False)
+        col.label(text=_("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end), translate=False)
 
         elem = False
 
@@ -442,7 +440,7 @@
             elem = strip.elements[0]
 
         if elem and elem.orig_width > 0 and elem.orig_height > 0:
-            col.label(text=pgettext("Original Dimension: %dx%d") % (elem.orig_width, elem.orig_height), translate=False)
+            col.label(text=_("Original Dimension: %dx%d") % (elem.orig_width, elem.orig_height), translate=False)
         else:
             col.label(text="Original Dimension: None")
 
@@ -719,8 +717,7 @@
         if scene:
             sta = scene.frame_start
             end = scene.frame_end
-            pgettext = bpy.app.translations.pgettext
-            layout.label(text=pgettext("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
+            layout.label(text=_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
 
 
 class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
@@ -749,8 +746,7 @@
         if mask:
             sta = mask.frame_start
             end = mask.frame_end
-            pgettext = bpy.app.translations.pgettext
-            layout.label(text=pgettext("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
+            layout.label(text=_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
 
 
 class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):

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

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list