Another fix for r54414 (cleaner to "import" pgettext once at top of files, also now using usual '_' shortcut).
This commit is contained in:
@@ -20,6 +20,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Panel
|
from bpy.types import Panel
|
||||||
|
|
||||||
|
_ = bpy.app.translations.pgettext
|
||||||
|
|
||||||
|
|
||||||
class ModifierButtonsPanel():
|
class ModifierButtonsPanel():
|
||||||
bl_space_type = 'PROPERTIES'
|
bl_space_type = 'PROPERTIES'
|
||||||
@@ -265,8 +267,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
|||||||
layout.prop(md, "angle_limit")
|
layout.prop(md, "angle_limit")
|
||||||
layout.prop(md, "use_dissolve_boundaries")
|
layout.prop(md, "use_dissolve_boundaries")
|
||||||
|
|
||||||
pgettext = bpy.app.translations.pgettext
|
layout.label(text=_("Face Count: %d") % md.face_count, translate=False)
|
||||||
layout.label(text=pgettext("Face Count: %d") % md.face_count, translate=False)
|
|
||||||
|
|
||||||
def DISPLACE(self, layout, ob, md):
|
def DISPLACE(self, layout, ob, md):
|
||||||
has_texture = (md.texture is not None)
|
has_texture = (md.texture is not None)
|
||||||
|
@@ -21,6 +21,8 @@ import bpy
|
|||||||
from bpy.types import Menu, Panel, UIList
|
from bpy.types import Menu, Panel, UIList
|
||||||
from rna_prop_ui import PropertyPanel
|
from rna_prop_ui import PropertyPanel
|
||||||
|
|
||||||
|
_ = bpy.app.translations.pgettext
|
||||||
|
|
||||||
|
|
||||||
def active_node_mat(mat):
|
def active_node_mat(mat):
|
||||||
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
|
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
|
||||||
@@ -80,8 +82,7 @@ class MATERIAL_UL_matslots(UIList):
|
|||||||
if ma and not context.scene.render.use_shading_nodes:
|
if ma and not context.scene.render.use_shading_nodes:
|
||||||
manode = ma.active_node_material
|
manode = ma.active_node_material
|
||||||
if manode:
|
if manode:
|
||||||
pgettext = bpy.app.translations.pgettext
|
layout.label(text=_("Node %s") % manode.name, translate=False, icon_value=layout.icon(manode))
|
||||||
layout.label(text=pgettext("Node %s") % manode.name, translate=False, icon_value=layout.icon(manode))
|
|
||||||
elif ma.use_nodes:
|
elif ma.use_nodes:
|
||||||
layout.label(text="Node <none>")
|
layout.label(text="Node <none>")
|
||||||
else:
|
else:
|
||||||
|
@@ -21,6 +21,8 @@ import bpy
|
|||||||
from bpy.types import Panel
|
from bpy.types import Panel
|
||||||
from rna_prop_ui import PropertyPanel
|
from rna_prop_ui import PropertyPanel
|
||||||
|
|
||||||
|
_ = bpy.app.translations.pgettext
|
||||||
|
|
||||||
from bl_ui.properties_physics_common import (point_cache_ui,
|
from bl_ui.properties_physics_common import (point_cache_ui,
|
||||||
effector_weights_ui,
|
effector_weights_ui,
|
||||||
basic_force_field_settings_ui,
|
basic_force_field_settings_ui,
|
||||||
@@ -148,8 +150,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
|
|||||||
#row.label(text="Render")
|
#row.label(text="Render")
|
||||||
|
|
||||||
if part.is_fluid:
|
if part.is_fluid:
|
||||||
pgettext = bpy.app.translations.pgettext
|
layout.label(text=_("%d fluid particles for this frame") % part.count, translate=False)
|
||||||
layout.label(text=pgettext("%d fluid particles for this frame") % part.count, translate=False)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
row = col.row()
|
row = col.row()
|
||||||
|
@@ -20,6 +20,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Panel, Menu
|
from bpy.types import Panel, Menu
|
||||||
|
|
||||||
|
_ = bpy.app.translations.pgettext
|
||||||
|
|
||||||
|
|
||||||
class FLUID_MT_presets(Menu):
|
class FLUID_MT_presets(Menu):
|
||||||
bl_label = "Fluid Presets"
|
bl_label = "Fluid Presets"
|
||||||
@@ -64,8 +66,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
|
|||||||
|
|
||||||
if fluid.type == 'DOMAIN':
|
if fluid.type == 'DOMAIN':
|
||||||
# odd formatting here so translation script can extract string
|
# odd formatting here so translation script can extract string
|
||||||
pgettext = bpy.app.translations.pgettext
|
layout.operator("fluid.bake", text=_("Bake (Req. Memory: %s)") % fluid.memory_estimate,
|
||||||
layout.operator("fluid.bake", text=pgettext("Bake (Req. Memory: %s)") % fluid.memory_estimate,
|
|
||||||
translate=False, icon='MOD_FLUIDSIM')
|
translate=False, icon='MOD_FLUIDSIM')
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
|
@@ -21,6 +21,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Panel, Header, Menu, UIList
|
from bpy.types import Panel, Header, Menu, UIList
|
||||||
|
|
||||||
|
_ = bpy.app.translations.pgettext
|
||||||
|
|
||||||
|
|
||||||
class CLIP_UL_tracking_objects(UIList):
|
class CLIP_UL_tracking_objects(UIList):
|
||||||
def draw_item(self, context, layout, data, item, icon,
|
def draw_item(self, context, layout, data, item, icon,
|
||||||
@@ -911,11 +913,9 @@ class CLIP_MT_view(Menu):
|
|||||||
|
|
||||||
ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
|
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:
|
for a, b in ratios:
|
||||||
layout.operator("clip.view_zoom_ratio",
|
layout.operator("clip.view_zoom_ratio", text=text % (a, b), translate=False).ratio = a / b
|
||||||
text=text % (a, b),
|
|
||||||
translate=False).ratio = a / b
|
|
||||||
else:
|
else:
|
||||||
if sc.view == 'GRAPH':
|
if sc.view == 'GRAPH':
|
||||||
layout.operator_context = 'INVOKE_REGION_PREVIEW'
|
layout.operator_context = 'INVOKE_REGION_PREVIEW'
|
||||||
|
@@ -22,6 +22,8 @@ from bpy.types import Header, Menu, Panel
|
|||||||
from bl_ui.properties_paint_common import UnifiedPaintPanel
|
from bl_ui.properties_paint_common import UnifiedPaintPanel
|
||||||
from bl_ui.properties_paint_common import brush_texture_settings
|
from bl_ui.properties_paint_common import brush_texture_settings
|
||||||
|
|
||||||
|
_ = bpy.app.translations.pgettext
|
||||||
|
|
||||||
|
|
||||||
class ImagePaintPanel(UnifiedPaintPanel):
|
class ImagePaintPanel(UnifiedPaintPanel):
|
||||||
bl_space_type = 'IMAGE_EDITOR'
|
bl_space_type = 'IMAGE_EDITOR'
|
||||||
@@ -71,10 +73,8 @@ class IMAGE_MT_view(Menu):
|
|||||||
|
|
||||||
ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
|
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:
|
for a, b in ratios:
|
||||||
layout.operator("image.view_zoom_ratio", text=pgettext("Zoom %d:%d") % (a, b),
|
layout.operator("image.view_zoom_ratio", text=_("Zoom %d:%d") % (a, b), translate=False).ratio = a / b
|
||||||
translate=False).ratio = a / b
|
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
@@ -723,7 +723,7 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
|
|||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
|
col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
|
||||||
|
|
||||||
brush_texture_settings(col, brush, 0)
|
brush_texture_settings(col, brush, 0)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -20,6 +20,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Header, Menu, Panel
|
from bpy.types import Header, Menu, Panel
|
||||||
|
|
||||||
|
_ = bpy.app.translations.pgettext
|
||||||
|
|
||||||
|
|
||||||
def act_strip(context):
|
def act_strip(context):
|
||||||
try:
|
try:
|
||||||
@@ -420,19 +422,15 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
|
|||||||
sub.prop(strip, "frame_start")
|
sub.prop(strip, "frame_start")
|
||||||
sub.prop(strip, "frame_final_duration")
|
sub.prop(strip, "frame_final_duration")
|
||||||
|
|
||||||
pgettext = bpy.app.translations.pgettext
|
|
||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
row = col.row()
|
row = col.row()
|
||||||
row.label(text=pgettext("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration),
|
row.label(text=_("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration), translate=False)
|
||||||
translate=False)
|
|
||||||
row = col.row()
|
row = col.row()
|
||||||
row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_duration)
|
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),
|
col.label(text=_("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end), translate=False)
|
||||||
translate=False)
|
col.label(text=_("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end), translate=False)
|
||||||
col.label(text=pgettext("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end),
|
|
||||||
translate=False)
|
|
||||||
|
|
||||||
elem = False
|
elem = False
|
||||||
|
|
||||||
@@ -442,7 +440,7 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
|
|||||||
elem = strip.elements[0]
|
elem = strip.elements[0]
|
||||||
|
|
||||||
if elem and elem.orig_width > 0 and elem.orig_height > 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:
|
else:
|
||||||
col.label(text="Original Dimension: None")
|
col.label(text="Original Dimension: None")
|
||||||
|
|
||||||
@@ -719,8 +717,7 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
|
|||||||
if scene:
|
if scene:
|
||||||
sta = scene.frame_start
|
sta = scene.frame_start
|
||||||
end = scene.frame_end
|
end = scene.frame_end
|
||||||
pgettext = bpy.app.translations.pgettext
|
layout.label(text=_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
|
||||||
layout.label(text=pgettext("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
|
|
||||||
|
|
||||||
|
|
||||||
class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
|
class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
|
||||||
@@ -749,8 +746,7 @@ class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
|
|||||||
if mask:
|
if mask:
|
||||||
sta = mask.frame_start
|
sta = mask.frame_start
|
||||||
end = mask.frame_end
|
end = mask.frame_end
|
||||||
pgettext = bpy.app.translations.pgettext
|
layout.label(text=_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
|
||||||
layout.label(text=pgettext("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
|
|
||||||
|
|
||||||
|
|
||||||
class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
|
class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
|
||||||
|
@@ -20,6 +20,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Header, Menu, Panel
|
from bpy.types import Header, Menu, Panel
|
||||||
|
|
||||||
|
_ = bpy.app.translations.pgettext
|
||||||
|
|
||||||
|
|
||||||
class TEXT_HT_header(Header):
|
class TEXT_HT_header(Header):
|
||||||
bl_space_type = 'TEXT_EDITOR'
|
bl_space_type = 'TEXT_EDITOR'
|
||||||
@@ -71,9 +73,8 @@ class TEXT_HT_header(Header):
|
|||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
if text.filepath:
|
if text.filepath:
|
||||||
pgettext = bpy.app.translations.pgettext
|
|
||||||
if text.is_dirty:
|
if text.is_dirty:
|
||||||
row.label(text=pgettext("File: *%r (unsaved)") %
|
row.label(text=_("File: *%r (unsaved)") %
|
||||||
text.filepath, translate=False)
|
text.filepath, translate=False)
|
||||||
else:
|
else:
|
||||||
row.label(text=pgettext("File: %r") %
|
row.label(text=pgettext("File: %r") %
|
||||||
|
@@ -20,6 +20,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Header, Menu, Panel
|
from bpy.types import Header, Menu, Panel
|
||||||
|
|
||||||
|
_ = bpy.app.translations.pgettext
|
||||||
|
|
||||||
|
|
||||||
def ui_style_items(col, context):
|
def ui_style_items(col, context):
|
||||||
""" UI Style settings """
|
""" UI Style settings """
|
||||||
@@ -778,10 +780,9 @@ class USERPREF_PT_theme(Panel):
|
|||||||
layout.separator()
|
layout.separator()
|
||||||
elif theme.theme_area == 'BONE_COLOR_SETS':
|
elif theme.theme_area == 'BONE_COLOR_SETS':
|
||||||
col = split.column()
|
col = split.column()
|
||||||
pgettext = bpy.app.translations.pgettext
|
|
||||||
|
|
||||||
for i, ui in enumerate(theme.bone_color_sets):
|
for i, ui in enumerate(theme.bone_color_sets):
|
||||||
col.label(text=pgettext("Color Set %d:") % (i + 1), translate=False) # i starts from 0
|
col.label(text=_("Color Set %d:") % (i + 1), translate=False) # i starts from 0
|
||||||
|
|
||||||
row = col.row()
|
row = col.row()
|
||||||
|
|
||||||
|
@@ -20,6 +20,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Menu
|
from bpy.types import Menu
|
||||||
|
|
||||||
|
_ = bpy.app.translations.pgettext
|
||||||
|
|
||||||
|
|
||||||
class USERPREF_MT_keyconfigs(Menu):
|
class USERPREF_MT_keyconfigs(Menu):
|
||||||
bl_label = "KeyPresets"
|
bl_label = "KeyPresets"
|
||||||
@@ -97,8 +99,7 @@ class InputKeyMapPanel:
|
|||||||
subcol = self.indented_layout(col, level + 1)
|
subcol = self.indented_layout(col, level + 1)
|
||||||
subrow = subcol.row()
|
subrow = subcol.row()
|
||||||
subrow.prop(km, "show_expanded_items", text="", emboss=False)
|
subrow.prop(km, "show_expanded_items", text="", emboss=False)
|
||||||
pgettext = bpy.app.translations.pgettext
|
subrow.label(text=_("%s (Global)") % km.name, translate=False)
|
||||||
subrow.label(text=pgettext("%s (Global)") % km.name, translate=False)
|
|
||||||
else:
|
else:
|
||||||
km.show_expanded_items = True
|
km.show_expanded_items = True
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user