forked from bartvdbraak/blender
Another fix for r54414 (cleaner to "import" pgettext once at top of files, also now using usual '_' shortcut).
This commit is contained in:
parent
5d4df1a999
commit
c0fa16f2c9
@ -20,6 +20,8 @@
|
||||
import bpy
|
||||
from bpy.types import Panel
|
||||
|
||||
_ = bpy.app.translations.pgettext
|
||||
|
||||
|
||||
class ModifierButtonsPanel():
|
||||
bl_space_type = 'PROPERTIES'
|
||||
@ -265,8 +267,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
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)
|
||||
|
@ -21,6 +21,8 @@ import bpy
|
||||
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
|
||||
@ -80,8 +82,7 @@ class MATERIAL_UL_matslots(UIList):
|
||||
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:
|
||||
|
@ -21,6 +21,8 @@ import bpy
|
||||
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 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
|
||||
#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()
|
||||
|
@ -20,6 +20,8 @@
|
||||
import bpy
|
||||
from bpy.types import Panel, Menu
|
||||
|
||||
_ = bpy.app.translations.pgettext
|
||||
|
||||
|
||||
class FLUID_MT_presets(Menu):
|
||||
bl_label = "Fluid Presets"
|
||||
@ -64,8 +66,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
|
||||
|
||||
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()
|
||||
|
||||
|
@ -21,6 +21,8 @@
|
||||
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,
|
||||
@ -911,11 +913,9 @@ class CLIP_MT_view(Menu):
|
||||
|
||||
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'
|
||||
|
@ -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 brush_texture_settings
|
||||
|
||||
_ = bpy.app.translations.pgettext
|
||||
|
||||
|
||||
class ImagePaintPanel(UnifiedPaintPanel):
|
||||
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))
|
||||
|
||||
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()
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
import bpy
|
||||
from bpy.types import Header, Menu, Panel
|
||||
|
||||
_ = bpy.app.translations.pgettext
|
||||
|
||||
|
||||
def act_strip(context):
|
||||
try:
|
||||
@ -420,19 +422,15 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
|
||||
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 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
|
||||
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 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
|
||||
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 @@ class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
|
||||
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):
|
||||
|
@ -20,6 +20,8 @@
|
||||
import bpy
|
||||
from bpy.types import Header, Menu, Panel
|
||||
|
||||
_ = bpy.app.translations.pgettext
|
||||
|
||||
|
||||
class TEXT_HT_header(Header):
|
||||
bl_space_type = 'TEXT_EDITOR'
|
||||
@ -71,9 +73,8 @@ class TEXT_HT_header(Header):
|
||||
|
||||
row = layout.row()
|
||||
if text.filepath:
|
||||
pgettext = bpy.app.translations.pgettext
|
||||
if text.is_dirty:
|
||||
row.label(text=pgettext("File: *%r (unsaved)") %
|
||||
row.label(text=_("File: *%r (unsaved)") %
|
||||
text.filepath, translate=False)
|
||||
else:
|
||||
row.label(text=pgettext("File: %r") %
|
||||
|
@ -20,6 +20,8 @@
|
||||
import bpy
|
||||
from bpy.types import Header, Menu, Panel
|
||||
|
||||
_ = bpy.app.translations.pgettext
|
||||
|
||||
|
||||
def ui_style_items(col, context):
|
||||
""" UI Style settings """
|
||||
@ -778,10 +780,9 @@ class USERPREF_PT_theme(Panel):
|
||||
layout.separator()
|
||||
elif theme.theme_area == 'BONE_COLOR_SETS':
|
||||
col = split.column()
|
||||
pgettext = bpy.app.translations.pgettext
|
||||
|
||||
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()
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
import bpy
|
||||
from bpy.types import Menu
|
||||
|
||||
_ = bpy.app.translations.pgettext
|
||||
|
||||
|
||||
class USERPREF_MT_keyconfigs(Menu):
|
||||
bl_label = "KeyPresets"
|
||||
@ -97,8 +99,7 @@ class InputKeyMapPanel:
|
||||
subcol = self.indented_layout(col, level + 1)
|
||||
subrow = subcol.row()
|
||||
subrow.prop(km, "show_expanded_items", text="", emboss=False)
|
||||
pgettext = bpy.app.translations.pgettext
|
||||
subrow.label(text=pgettext("%s (Global)") % km.name, translate=False)
|
||||
subrow.label(text=_("%s (Global)") % km.name, translate=False)
|
||||
else:
|
||||
km.show_expanded_items = True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user