diff options
author | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-06-20 14:07:46 +0400 |
---|---|---|
committer | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-06-20 14:07:46 +0400 |
commit | 9a2f36b50f818c0c1b659363a1df298f7043e207 (patch) | |
tree | 29356fc32cdf7faba05e099e67e3da5adf349c39 /release | |
parent | 558d549aeb2ec7da41d31986707774eae0821da8 (diff) |
handle SpaceType and UserPref popups
Diffstat (limited to 'release')
8 files changed, 319 insertions, 312 deletions
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index 0342a14a1b2..a23982e8e4e 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -20,6 +20,7 @@ import bpy from bpy.props import StringProperty, BoolProperty, EnumProperty, IntProperty +from blf import gettext as _ class SelectPattern(bpy.types.Operator): @@ -412,7 +413,7 @@ class ShapeTransfer(bpy.types.Operator): class JoinUVs(bpy.types.Operator): '''Copy UV Layout to objects with matching geometry''' bl_idname = "object.join_uvs" - bl_label = "Join as UVs" + bl_label = _("Join as UVs") @classmethod def poll(cls, context): @@ -470,7 +471,7 @@ class JoinUVs(bpy.types.Operator): class MakeDupliFace(bpy.types.Operator): '''Make linked objects into dupli-faces''' bl_idname = "object.make_dupli_face" - bl_label = "Make Dupli-Face" + bl_label = _("Make Dupli-Face") @classmethod def poll(cls, context): diff --git a/release/scripts/startup/bl_operators/object_align.py b/release/scripts/startup/bl_operators/object_align.py index 644f30a4745..89b02fc98b0 100644 --- a/release/scripts/startup/bl_operators/object_align.py +++ b/release/scripts/startup/bl_operators/object_align.py @@ -20,7 +20,7 @@ import bpy from mathutils import Vector - +from blf import gettext as _ def align_objects(align_x, align_y, align_z, align_mode, relative_to): @@ -236,7 +236,7 @@ from bpy.props import EnumProperty class AlignObjects(bpy.types.Operator): '''Align Objects''' bl_idname = "object.align" - bl_label = "Align Objects" + bl_label = _("Align Objects") bl_options = {'REGISTER', 'UNDO'} align_mode = EnumProperty(items=( diff --git a/release/scripts/startup/bl_operators/object_randomize_transform.py b/release/scripts/startup/bl_operators/object_randomize_transform.py index 9dc5086086f..68f97f63c73 100644 --- a/release/scripts/startup/bl_operators/object_randomize_transform.py +++ b/release/scripts/startup/bl_operators/object_randomize_transform.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy - +from blf import gettext as _ def randomize_selected(seed, delta, loc, rot, scale, scale_even): @@ -90,7 +90,7 @@ from bpy.props import IntProperty, BoolProperty, FloatVectorProperty class RandomizeLocRotSize(bpy.types.Operator): '''Randomize objects loc/rot/scale''' bl_idname = "object.randomize_transform" - bl_label = "Randomize Transform" + bl_label = _("Randomize Transform") bl_options = {'REGISTER', 'UNDO'} random_seed = IntProperty(name="Random Seed", diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py index 64af25e7b0f..017b3b82d0b 100644 --- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py +++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py @@ -26,7 +26,7 @@ import bpy import os - +from blf import gettext as _ def guess_player_path(preset): import sys @@ -66,7 +66,7 @@ def guess_player_path(preset): class PlayRenderedAnim(bpy.types.Operator): '''Plays back rendered frames/movies using an external player.''' bl_idname = "render.play_rendered_anim" - bl_label = "Play Rendered Animation" + bl_label = _("Play Rendered Animation") bl_options = {'REGISTER'} def execute(self, context): diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index fcc30ecbb4b..de071a155f3 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -21,6 +21,7 @@ import bpy from bpy.props import StringProperty, BoolProperty, IntProperty, FloatProperty from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear +from blf import gettext as _ class MESH_OT_delete_edgeloop(bpy.types.Operator): @@ -546,6 +547,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator): class WM_OT_url_open(bpy.types.Operator): "Open a website in the Webbrowser" + __doc__ = _("Open a website in the Webbrowser") bl_idname = "wm.url_open" bl_label = "" @@ -914,7 +916,8 @@ class WM_OT_appconfig_activate(bpy.types.Operator): class WM_OT_sysinfo(bpy.types.Operator): '''Generate System Info''' bl_idname = "wm.sysinfo" - bl_label = "System Info" + bl_label = _("System Info") + __doc__ = _("Generate System Info") def execute(self, context): import sys_info diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 265debd10f4..ed4f47860a3 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -64,10 +64,10 @@ def opengl_lamp_buttons(column, lamp): col = split.column() col.active = lamp.use row = col.row() - row.label(text="Diffuse:") + row.label(text=_("Diffuse:")) row.prop(lamp, "diffuse_color", text="") row = col.row() - row.label(text="Specular:") + row.label(text=_("Specular:")) row.prop(lamp, "specular_color", text="") col = split.column() @@ -85,7 +85,7 @@ class USERPREF_HT_header(bpy.types.Header): userpref = context.user_preferences layout.operator_context = 'EXEC_AREA' - layout.operator("wm.save_homefile", text="Save As Default") + layout.operator("wm.save_homefile", text=_("Save As Default")) layout.operator_context = 'INVOKE_DEFAULT' @@ -94,7 +94,7 @@ class USERPREF_HT_header(bpy.types.Header): layout.operator("wm.keyconfig_import") elif userpref.active_section == 'ADDONS': layout.operator("wm.addon_install") - layout.menu("USERPREF_MT_addons_dev_guides", text=" Addons Developer Guides", icon='INFO') + layout.menu("USERPREF_MT_addons_dev_guides", text=_(" Addons Developer Guides"), icon='INFO') elif userpref.active_section == 'THEMES': layout.operator("ui.reset_default_theme") @@ -114,7 +114,7 @@ class USERPREF_PT_tabs(bpy.types.Panel): class USERPREF_MT_interaction_presets(bpy.types.Menu): - bl_label = "Presets" + bl_label = _("Presets") preset_subdir = "interaction" preset_operator = "script.execute_preset" draw = bpy.types.Menu.draw_preset @@ -151,7 +151,7 @@ class USERPREF_MT_splash(bpy.types.Menu): class USERPREF_PT_interface(bpy.types.Panel): bl_space_type = 'USER_PREFERENCES' - bl_label = "Interface" + bl_label = _("Interface") bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @@ -169,13 +169,13 @@ class USERPREF_PT_interface(bpy.types.Panel): row = layout.row() col = row.column() - col.label(text="Display:") + col.label(text=_("Display:")) col.prop(view, "show_tooltips") col.prop(view, "show_tooltips_python") - col.prop(view, "show_object_info", text="Object Info") + col.prop(view, "show_object_info", text=_("Object Info")) col.prop(view, "show_large_cursors") - col.prop(view, "show_view_name", text="View Name") - col.prop(view, "show_playback_fps", text="Playback FPS") + col.prop(view, "show_view_name", text=_("View Name")) + col.prop(view, "show_playback_fps", text=_("Playback FPS")) col.prop(view, "use_global_scene") col.prop(view, "object_origin_size") @@ -183,18 +183,18 @@ class USERPREF_PT_interface(bpy.types.Panel): col.separator() col.separator() - col.prop(view, "show_mini_axis", text="Display Mini Axis") + col.prop(view, "show_mini_axis", text=_("Display Mini Axis")) sub = col.column() sub.active = view.show_mini_axis - sub.prop(view, "mini_axis_size", text="Size") - sub.prop(view, "mini_axis_brightness", text="Brightness") + sub.prop(view, "mini_axis_size", text=_("Size")) + sub.prop(view, "mini_axis_brightness", text=_("Brightness")) col.separator() row.separator() row.separator() col = row.column() - col.label(text="View Manipulation:") + col.label(text=_("View Manipulation:")) col.prop(view, "use_mouse_auto_depth") col.prop(view, "use_zoom_to_mouse") col.prop(view, "use_rotate_around_active") @@ -210,8 +210,8 @@ class USERPREF_PT_interface(bpy.types.Panel): col.separator() col.separator() - col.label(text="2D Viewports:") - col.prop(view, "view2d_grid_spacing_min", text="Minimum Grid Spacing") + col.label(text=_("2D Viewports:")) + col.prop(view, "view2d_grid_spacing_min", text=_("Minimum Grid Spacing")) col.prop(view, "timecode_style") row.separator() @@ -227,19 +227,19 @@ class USERPREF_PT_interface(bpy.types.Panel): col.prop(view, "show_manipulator") sub = col.column() sub.active = view.show_manipulator - sub.prop(view, "manipulator_size", text="Size") - sub.prop(view, "manipulator_handle_size", text="Handle Size") - sub.prop(view, "manipulator_hotspot", text="Hotspot") + sub.prop(view, "manipulator_size", text=_("Size")) + sub.prop(view, "manipulator_handle_size", text=_("Handle Size")) + sub.prop(view, "manipulator_hotspot", text=_("Hotspot")) col.separator() col.separator() col.separator() - col.label(text="Menus:") + col.label(text=_("Menus:")) col.prop(view, "use_mouse_over_open") - col.label(text="Menu Open Delay:") - col.prop(view, "open_toplevel_delay", text="Top Level") - col.prop(view, "open_sublevel_delay", text="Sub Level") + col.label(text=_("Menu Open Delay:")) + col.prop(view, "open_toplevel_delay", text=_("Top Level")) + col.prop(view, "open_sublevel_delay", text=_("Sub Level")) col.separator() @@ -248,7 +248,7 @@ class USERPREF_PT_interface(bpy.types.Panel): class USERPREF_PT_edit(bpy.types.Panel): bl_space_type = 'USER_PREFERENCES' - bl_label = "Edit" + bl_label = _("Edit") bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @@ -266,102 +266,102 @@ class USERPREF_PT_edit(bpy.types.Panel): row = layout.row() col = row.column() - col.label(text="Link Materials To:") + col.label(text=_("Link Materials To:")) col.prop(edit, "material_link", text="") col.separator() col.separator() col.separator() - col.label(text="New Objects:") + col.label(text=_("New Objects:")) col.prop(edit, "use_enter_edit_mode") - col.label(text="Align To:") + col.label(text=_("Align To:")) col.prop(edit, "object_align", text="") col.separator() col.separator() col.separator() - col.label(text="Undo:") + col.label(text=_("Undo:")) col.prop(edit, "use_global_undo") - col.prop(edit, "undo_steps", text="Steps") - col.prop(edit, "undo_memory_limit", text="Memory Limit") + col.prop(edit, "undo_steps", text=_("Steps")) + col.prop(edit, "undo_memory_limit", text=_("Memory Limit")) row.separator() row.separator() col = row.column() - col.label(text="Grease Pencil:") - col.prop(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance") - col.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance") + col.label(text=_("Grease Pencil:")) + col.prop(edit, "grease_pencil_manhattan_distance", text=_("Manhattan Distance")) + col.prop(edit, "grease_pencil_euclidean_distance", text=_("Euclidean Distance")) #col.prop(edit, "use_grease_pencil_simplify_stroke", text="Simplify Stroke") - col.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius") - col.prop(edit, "use_grease_pencil_smooth_stroke", text="Smooth Stroke") + col.prop(edit, "grease_pencil_eraser_radius", text=_("Eraser Radius")) + col.prop(edit, "use_grease_pencil_smooth_stroke", text=_("Smooth Stroke")) col.separator() col.separator() col.separator() - col.label(text="Playback:") + col.label(text=_("Playback:")) col.prop(edit, "use_negative_frames") row.separator() row.separator() col = row.column() - col.label(text="Keyframing:") + col.label(text=_("Keyframing:")) col.prop(edit, "use_visual_keying") - col.prop(edit, "use_keyframe_insert_needed", text="Only Insert Needed") + col.prop(edit, "use_keyframe_insert_needed", text=_("Only Insert Needed")) col.separator() - col.prop(edit, "use_auto_keying", text="Auto Keyframing:") + col.prop(edit, "use_auto_keying", text=_("Auto Keyframing:")) sub = col.column() # sub.active = edit.use_keyframe_insert_auto # incorrect, timeline can enable - sub.prop(edit, "use_keyframe_insert_available", text="Only Insert Available") + sub.prop(edit, "use_keyframe_insert_available", text=_("Only Insert Available")) col.separator() - col.label(text="New F-Curve Defaults:") - col.prop(edit, "keyframe_new_interpolation_type", text="Interpolation") - col.prop(edit, "keyframe_new_handle_type", text="Handles") - col.prop(edit, "use_insertkey_xyz_to_rgb", text="XYZ to RGB") + col.label(text=_("New F-Curve Defaults:")) + col.prop(edit, "keyframe_new_interpolation_type", text=_("Interpolation")) + col.prop(edit, "keyframe_new_handle_type", text=_("Handles")) + col.prop(edit, "use_insertkey_xyz_to_rgb", text=_("XYZ to RGB")) col.separator() col.separator() col.separator() - col.label(text="Transform:") + col.label(text=_("Transform:")) col.prop(edit, "use_drag_immediately") row.separator() row.separator() col = row.column() - col.prop(edit, "sculpt_paint_overlay_color", text="Sculpt Overlay Color") + col.prop(edit, "sculpt_paint_overlay_color", text=_("Sculpt Overlay Color")) col.separator() col.separator() col.separator() - col.label(text="Duplicate Data:") - col.prop(edit, "use_duplicate_mesh", text="Mesh") - col.prop(edit, "use_duplicate_surface", text="Surface") - col.prop(edit, "use_duplicate_curve", text="Curve") - col.prop(edit, "use_duplicate_text", text="Text") - col.prop(edit, "use_duplicate_metaball", text="Metaball") - col.prop(edit, "use_duplicate_armature", text="Armature") - col.prop(edit, "use_duplicate_lamp", text="Lamp") - col.prop(edit, "use_duplicate_material", text="Material") - col.prop(edit, "use_duplicate_texture", text="Texture") + col.label(text=_("Duplicate Data:")) + col.prop(edit, "use_duplicate_mesh", text=_("Mesh")) + col.prop(edit, "use_duplicate_surface", text=_("Surface")) + col.prop(edit, "use_duplicate_curve", text=_("Curve")) + col.prop(edit, "use_duplicate_text", text=_("Text")) + col.prop(edit, "use_duplicate_metaball", text=_("Metaball")) + col.prop(edit, "use_duplicate_armature", text=_("Armature")) + col.prop(edit, "use_duplicate_lamp", text=_("Lamp")) + col.prop(edit, "use_duplicate_material", text=_("Material")) + col.prop(edit, "use_duplicate_texture", text=_("Texture")) #col.prop(edit, "use_duplicate_fcurve", text="F-Curve") - col.prop(edit, "use_duplicate_action", text="Action") - col.prop(edit, "use_duplicate_particle", text="Particle") + col.prop(edit, "use_duplicate_action", text=_("Action")) + col.prop(edit, "use_duplicate_particle", text=_("Particle")) class USERPREF_PT_system(bpy.types.Panel): bl_space_type = 'USER_PREFERENCES' - bl_label = "System" + bl_label = _("System") bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @@ -383,11 +383,11 @@ class USERPREF_PT_system(bpy.types.Panel): colsplit = column.split(percentage=0.85) col = colsplit.column() - col.label(text="General:") + col.label(text=_("General:")) col.prop(system, "dpi") col.prop(system, "frame_server_port") - col.prop(system, "scrollback", text="Console Scrollback") - col.prop(system, "author", text="Author") + col.prop(system, "scrollback", text=_("Console Scrollback")) + col.prop(system, "author", text=_("Author")) col.prop(system, "use_scripts_auto_execute") col.prop(system, "use_tabs_as_spaces") @@ -395,21 +395,21 @@ class USERPREF_PT_system(bpy.types.Panel): col.separator() col.separator() - col.label(text="Sound:") + col.label(text=_("Sound:")) col.row().prop(system, "audio_device", expand=True) sub = col.column() sub.active = system.audio_device != 'NONE' #sub.prop(system, "use_preview_images") - sub.prop(system, "audio_channels", text="Channels") - sub.prop(system, "audio_mixing_buffer", text="Mixing Buffer") - sub.prop(system, "audio_sample_rate", text="Sample Rate") - sub.prop(system, "audio_sample_format", text="Sample Format") + sub.prop(system, "audio_channels", text=_("Channels")) + sub.prop(system, "audio_mixing_buffer", text=_("Mixing Buffer")) + sub.prop(system, "audio_sample_rate", text=_("Sample Rate")) + sub.prop(system, "audio_sample_format", text=_("Sample Format")) col.separator() col.separator() col.separator() - col.label(text="Screencast:") + col.label(text=_("Screencast:")) col.prop(system, "screencast_fps") col.prop(system, "screencast_wait_time") col.separator() @@ -435,38 +435,38 @@ class USERPREF_PT_system(bpy.types.Panel): colsplit = column.split(percentage=0.85) col = colsplit.column() - col.label(text="OpenGL:") + col.label(text=_("OpenGL:")) col.prop(system, "gl_clip_alpha", slider=True) col.prop(system, "use_mipmaps") col.prop(system, "use_vertex_buffer_objects") #Anti-aliasing is disabled as it breaks broder/lasso select #col.prop(system, "use_antialiasing") - col.label(text="Window Draw Method:") + col.label(text=_("Window Draw Method:")) col.prop(system, "window_draw_method", text="") - col.label(text="Text Draw Options:") + col.label(text=_("Text Draw Options:")) col.prop(system, "use_text_antialiasing") - col.label(text="Textures:") - col.prop(system, "gl_texture_limit", text="Limit Size") - col.prop(system, "texture_time_out", text="Time Out") - col.prop(system, "texture_collection_rate", text="Collection Rate") + col.label(text=_("Textures:")) + col.prop(system, "gl_texture_limit", text=_("Limit Size")) + col.prop(system, "texture_time_out", text=_("Time Out")) + col.prop(system, "texture_collection_rate", text=_("Collection Rate")) col.separator() col.separator() col.separator() - col.label(text="Sequencer:") + col.label(text=_("Sequencer:")) col.prop(system, "prefetch_frames") col.prop(system, "memory_cache_limit") # 3. Column column = split.column() - column.label(text="Solid OpenGL lights:") + column.label(text=_("Solid OpenGL lights:")) split = column.split(percentage=0.1) split.label() - split.label(text="Colors:") - split.label(text="Direction:") + split.label(text=_("Colors:")) + split.label(text=_("Direction:")) lamp = system.solid_lights[0] opengl_lamp_buttons(column, lamp) @@ -481,14 +481,14 @@ class USERPREF_PT_system(bpy.types.Panel): column.separator() column.separator() - column.label(text="Color Picker Type:") + column.label(text=_("Color Picker Type:")) column.row().prop(system, "color_picker_type", text="") column.separator() column.separator() column.separator() - column.prop(system, "use_weight_color_range", text="Custom Weight Paint Range") + column.prop(system, "use_weight_color_range", text=_("Custom Weight Paint Range")) sub = column.column() sub.active = system.use_weight_color_range sub.template_color_ramp(system, "weight_color_range", expand=True) @@ -496,7 +496,7 @@ class USERPREF_PT_system(bpy.types.Panel): class USERPREF_PT_theme(bpy.types.Panel): bl_space_type = 'USER_PREFERENCES' - bl_label = "Themes" + bl_label = _("Themes") bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @@ -554,71 +554,71 @@ class USERPREF_PT_theme(bpy.types.Panel): col = split.column() ui = theme.user_interface.wcol_regular - col.label(text="Regular:") + col.label(text=_("Regular:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_tool - col.label(text="Tool:") + col.label(text=_("Tool:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_radio - col.label(text="Radio Buttons:") + col.label(text=_("Radio Buttons:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_text - col.label(text="Text:") + col.label(text=_("Text:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_option - col.label(text="Option:") + col.label(text=_("Option:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_toggle - col.label(text="Toggle:") + col.label(text=_("Toggle:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_num - col.label(text="Number Field:") + col.label(text=_("Number Field:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_numslider - col.label(text="Value Slider:") + col.label(text=_("Value Slider:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_box - col.label(text="Box:") + col.label(text=_("Box:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_menu - col.label(text="Menu:") + col.label(text=_("Menu:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_pulldown - col.label(text="Pulldown:") + col.label(text=_("Pulldown:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_menu_back - col.label(text="Menu Back:") + col.label(text=_("Menu Back:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_menu_item - col.label(text="Menu Item:") + col.label(text=_("Menu Item:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_scroll - col.label(text="Scroll Bar:") + col.label(text=_("Scroll Bar:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_progress - col.label(text="Progress Bar:") + col.label(text=_("Progress Bar:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_list_item - col.label(text="List Item:") + col.label(text=_("List Item:")) ui_items_general(col, ui) ui = theme.user_interface.wcol_state - col.label(text="State:") + col.label(text=_("State:")) row = col.row() @@ -654,7 +654,7 @@ class USERPREF_PT_theme(bpy.types.Panel): col = split.column() for i, ui in enumerate(theme.bone_color_sets): - col.label(text="Color Set %d:" % (i + 1)) # i starts from 0 + col.label(text=_("Color Set %d:") % (i + 1)) # i starts from 0 row = col.row() @@ -679,7 +679,7 @@ class USERPREF_PT_theme(bpy.types.Panel): class USERPREF_PT_file(bpy.types.Panel): bl_space_type = 'USER_PREFERENCES' - bl_label = "Files" + bl_label = _("Files") bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @@ -697,22 +697,22 @@ class USERPREF_PT_file(bpy.types.Panel): split = layout.split(percentage=0.7) col = split.column() - col.label(text="File Paths:") + col.label(text=_("File Paths:")) colsplit = col.split(percentage=0.95) col1 = colsplit.split(percentage=0.3) sub = col1.column() - sub.label(text="Fonts:") - sub.label(text="Textures:") - sub.label(text="Texture Plugins:") - sub.label(text="Sequence Plugins:") - sub.label(text="Render Output:") - sub.label(text="Scripts:") - sub.label(text="Sounds:") - sub.label(text="Temp:") - sub.label(text="Image Editor:") - sub.label(text="Animation Player:") + sub.label(text=_("Fonts:")) + sub.label(text=_("Textures:")) + sub.label(text=_("Texture Plugins:")) + sub.label(text=_("Sequence Plugins:")) + sub.label(text=_("Render Output:")) + sub.label(text=_("Scripts:")) + sub.label(text=_("Sounds:")) + sub.label(text=_("Temp:")) + sub.label(text=_("Image Editor:")) + sub.label(text=_("Animation Player:")) sub = col1.column() sub.prop(paths, "font_directory", text="") @@ -729,7 +729,7 @@ class USERPREF_PT_file(bpy.types.Panel): subsplit.prop(paths, "animation_player", text="") col = split.column() - col.label(text="Save & Load:") + col.label(text=_("Save & Load:")) col.prop(paths, "use_relative_paths") col.prop(paths, "use_file_compression") col.prop(paths, "use_load_ui") @@ -744,18 +744,18 @@ class USERPREF_PT_file(bpy.types.Panel): col.prop(paths, "save_version") col.prop(paths, "recent_files") col.prop(paths, "use_save_preview_images") - col.label(text="Auto Save:") + col.label(text=_("Auto Save:")) col.prop(paths, "use_auto_save_temporary_files") sub = col.column() sub.active = paths.use_auto_save_temporary_files - sub.prop(paths, "auto_save_time", text="Timer (mins)") + sub.prop(paths, "auto_save_time", text=_("Timer (mins)")) from bl_ui.space_userpref_keymap import InputKeyMapPanel class USERPREF_PT_input(bpy.types.Panel, InputKeyMapPanel): bl_space_type = 'USER_PREFERENCES' - bl_label = "Input" + bl_label = _("Input") @classmethod def poll(cls, context): @@ -768,7 +768,7 @@ class USERPREF_PT_input(bpy.types.Panel, InputKeyMapPanel): col = row.column() sub = col.column() - sub.label(text="Presets:") + sub.label(text=_("Presets:")) subrow = sub.row(align=True) subrow.menu("USERPREF_MT_interaction_presets", text=bpy.types.USERPREF_MT_interaction_presets.bl_label) @@ -776,19 +776,19 @@ class USERPREF_PT_input(bpy.types.Panel, InputKeyMapPanel): subrow.operator("wm.interaction_preset_add", text="", icon='ZOOMOUT').remove_active = True sub.separator() - sub.label(text="Mouse:") + sub.label(text=_("Mouse:")) sub1 = sub.column() sub1.active = (inputs.select_mouse == 'RIGHT') sub1.prop(inputs, "use_mouse_emulate_3_button") sub.prop(inputs, "use_mouse_continuous") sub.prop(inputs, "drag_threshold") - sub.label(text="Select With:") + sub.label(text=_("Select With:")) sub.row().prop(inputs, "select_mouse", expand=True) sub = col.column() - sub.label(text="Double Click:") - sub.prop(inputs, "mouse_double_click_time", text="Speed") + sub.label(text=_("Double Click:")) + sub.prop(inputs, "mouse_double_click_time", text=_("Speed")) sub.separator() @@ -796,10 +796,10 @@ class USERPREF_PT_input(bpy.types.Panel, InputKeyMapPanel): sub.separator() - sub.label(text="Orbit Style:") + sub.label(text=_("Orbit Style:")) sub.row().prop(inputs, "view_rotate_method", expand=True) - sub.label(text="Zoom Style:") + sub.label(text=_("Zoom Style:")) sub.row().prop(inputs, "view_zoom_method", text="") if inputs.view_zoom_method in {'DOLLY', 'CONTINUE'}: sub.row().prop(inputs, "view_zoom_axis", expand=True) @@ -810,8 +810,8 @@ class USERPREF_PT_input(bpy.types.Panel, InputKeyMapPanel): #col.separator() sub = col.column() - sub.label(text="Mouse Wheel:") - sub.prop(inputs, "invert_zoom_wheel", text="Invert Wheel Zoom Direction") + sub.label(text=_("Mouse Wheel:")) + sub.prop(inputs, "invert_zoom_wheel", text=_("Invert Wheel Zoom Direction")) #sub.prop(view, "wheel_scroll_lines", text="Scroll Lines") col.separator() @@ -847,22 +847,22 @@ class USERPREF_PT_input(bpy.types.Panel, InputKeyMapPanel): class USERPREF_MT_addons_dev_guides(bpy.types.Menu): - bl_label = "Addons develoment guides" + bl_label = _("Addons develoment guides") # menu to open webpages with addons development guides def draw(self, context): layout = self.layout - layout.operator('wm.url_open', text='API Concepts' + layout.operator('wm.url_open', text=_('API Concepts') ).url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro' - layout.operator('wm.url_open', text='Addons guidelines', + layout.operator('wm.url_open', text=_('Addons guidelines') ).url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons' - layout.operator('wm.url_open', text='How to share your addon', + layout.operator('wm.url_open', text=_('How to share your addon') ).url = 'http://wiki.blender.org/index.php/Dev:Py/Sharing' class USERPREF_PT_addons(bpy.types.Panel): bl_space_type = 'USER_PREFERENCES' - bl_label = "Addons" + bl_label = _("Addons") bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @@ -889,10 +889,10 @@ class USERPREF_PT_addons(bpy.types.Panel): split = layout.split(percentage=0.2) col = split.column() col.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM') - col.label(text="Categories") + col.label(text=_("Categories")) col.prop(context.window_manager, "addon_filter", text="") # , expand=True, too slow with dynamic enum. - col.label(text="Supported Level") + col.label(text=_("Supported Level")) col.prop(context.window_manager, "addon_support", expand=True) col = split.column() @@ -952,31 +952,31 @@ class USERPREF_PT_addons(bpy.types.Panel): if info["show_expanded"]: if info["description"]: split = colsub.row().split(percentage=0.15) - split.label(text='Description:') + split.label(text=_('Description:')) split.label(text=info["description"]) if info["location"]: split = colsub.row().split(percentage=0.15) - split.label(text='Location:') + split.label(text=_('Location:')) split.label(text=info["location"]) if info["author"]: split = colsub.row().split(percentage=0.15) - split.label(text='Author:') + split.label(text=_('Author:')) split.label(text=info["author"]) if info["version"]: split = colsub.row().split(percentage=0.15) - split.label(text='Version:') + split.label(text=_('Version:')) split.label(text='.'.join(str(x) for x in info["version"])) if info["warning"]: split = colsub.row().split(percentage=0.15) - split.label(text="Warning:") + split.label(text=_("Warning:")) split.label(text=' ' + info["warning"], icon='ERROR') if info["wiki_url"] or info["tracker_url"]: split = colsub.row().split(percentage=0.15) - split.label(text="Internet:") + split.label(text=_("Internet:")) if info["wiki_url"]: - split.operator("wm.url_open", text="Link to the Wiki", icon='HELP').url = info["wiki_url"] + split.operator("wm.url_open", text=_("Link to the Wiki"), icon='HELP').url = info["wiki_url"] if info["tracker_url"]: - split.operator("wm.url_open", text="Report a Bug", icon='URL').url = info["tracker_url"] + split.operator("wm.url_open", text=_("Report a Bug"), icon='URL').url = info["tracker_url"] if info["wiki_url"] and info["tracker_url"]: split.separator() @@ -991,7 +991,7 @@ class USERPREF_PT_addons(bpy.types.Panel): if missing_modules and filter in {"All", "Enabled"}: col.column().separator() - col.column().label(text="Missing script files") + col.column().label(text=_("Missing script files")) module_names = {mod.__name__ for mod, info in addons} for module_name in sorted(missing_modules): @@ -1010,9 +1010,9 @@ class USERPREF_PT_addons(bpy.types.Panel): class WM_OT_addon_enable(bpy.types.Operator): "Enable an addon" bl_idname = "wm.addon_enable" - bl_label = "Enable Add-On" + bl_label = _("Enable Add-On") - module = StringProperty(name="Module", description="Module name of the addon to enable") + module = StringProperty(name=_("Module"), description=_("Module name of the addon to enable")) def execute(self, context): mod = addon_utils.enable(self.module) @@ -1031,9 +1031,9 @@ class WM_OT_addon_enable(bpy.types.Operator): class WM_OT_addon_disable(bpy.types.Operator): "Disable an addon" bl_idname = "wm.addon_disable" - bl_label = "Disable Add-On" + bl_label = _("Disable Add-On") - module = StringProperty(name="Module", description="Module name of the addon to disable") + module = StringProperty(name=_("Module"), description=_("Module name of the addon to disable")) def execute(self, context): addon_utils.disable(self.module) @@ -1043,17 +1043,17 @@ class WM_OT_addon_disable(bpy.types.Operator): class WM_OT_addon_install(bpy.types.Operator): "Install an addon" bl_idname = "wm.addon_install" - bl_label = "Install Add-On..." + bl_label = _("Install Add-On...") - overwrite = BoolProperty(name="Overwrite", description="Remove existing addons with the same ID", default=True) + overwrite = BoolProperty(name=_("Overwrite"), description=_("Remove existing addons with the same ID"), default=True) target = EnumProperty( name="Target Path", items=(('DEFAULT', "Default", ""), ('PREFS', "User Prefs", ""))) - filepath = StringProperty(name="File Path", description="File path to write file to") - filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) - filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'}) + filepath = StringProperty(name=_("File Path"), description=_("File path to write file to")) + filter_folder = BoolProperty(name=_("Filter folders"), description="", default=True, options={'HIDDEN'}) + filter_python = BoolProperty(name=_("Filter python"), description="", default=True, options={'HIDDEN'}) filter_glob = StringProperty(default="*.py;*.zip", options={'HIDDEN'}) @staticmethod @@ -1192,7 +1192,7 @@ class WM_OT_addon_expand(bpy.types.Operator): bl_idname = "wm.addon_expand" bl_label = "" - module = StringProperty(name="Module", description="Module name of the addon to expand") + module = StringProperty(name=_("Module"), description=_("Module name of the addon to expand")) def execute(self, context): module_name = self.module diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py index e99cefb91b8..d2e672e0c35 100644 --- a/release/scripts/startup/bl_ui/space_userpref_keymap.py +++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py @@ -19,91 +19,92 @@ # <pep8 compliant> import bpy import os - +from blf import gettext as _ +from blf import fake_gettext as N_ KM_HIERARCHY = [ - ('Window', 'EMPTY', 'WINDOW', []), # file save, window change, exit - ('Screen', 'EMPTY', 'WINDOW', [ # full screen, undo, screenshot - ('Screen Editing', 'EMPTY', 'WINDOW', []), # resizing, action corners + ( N_('Window'), 'EMPTY', 'WINDOW', []), # file save, window change, exit + ( N_('Screen'), 'EMPTY', 'WINDOW', [ # full screen, undo, screenshot + ( N_('Screen Editing'), 'EMPTY', 'WINDOW', []), # resizing, action corners ]), - ('View2D', 'EMPTY', 'WINDOW', []), # view 2d navigation (per region) - ('View2D Buttons List', 'EMPTY', 'WINDOW', []), # view 2d with buttons navigation - ('Header', 'EMPTY', 'WINDOW', []), # header stuff (per region) - ('Grease Pencil', 'EMPTY', 'WINDOW', []), # grease pencil stuff (per region) + ( N_('View2D'), 'EMPTY', 'WINDOW', []), # view 2d navigation (per region) + ( N_('View2D Buttons List'), 'EMPTY', 'WINDOW', []), # view 2d with buttons navigation + ( N_('Header'), 'EMPTY', 'WINDOW', []), # header stuff (per region) + ( N_('Grease Pencil'), 'EMPTY', 'WINDOW', []), # grease pencil stuff (per region) - ('3D View', 'VIEW_3D', 'WINDOW', [ # view 3d navigation and generic stuff (select, transform) - ('Object Mode', 'EMPTY', 'WINDOW', []), - ('Mesh', 'EMPTY', 'WINDOW', []), - ('Curve', 'EMPTY', 'WINDOW', []), - ('Armature', 'EMPTY', 'WINDOW', []), - ('Metaball', 'EMPTY', 'WINDOW', []), - ('Lattice', 'EMPTY', 'WINDOW', []), - ('Font', 'EMPTY', 'WINDOW', []), + ( N_('3D View'), 'VIEW_3D', 'WINDOW', [ # view 3d navigation and generic stuff (select, transform) + ( N_('Object Mode'), 'EMPTY', 'WINDOW', []), + ( N_('Mesh'), 'EMPTY', 'WINDOW', []), + ( N_('Curve'), 'EMPTY', 'WINDOW', []), + ( N_('Armature'), 'EMPTY', 'WINDOW', []), + ( N_('Metaball'), 'EMPTY', 'WINDOW', []), + ( N_('Lattice'), 'EMPTY', 'WINDOW', []), + ( N_('Font'), 'EMPTY', 'WINDOW', []), - ('Pose', 'EMPTY', 'WINDOW', []), + ( N_('Pose'), 'EMPTY', 'WINDOW', []), - ('Vertex Paint', 'EMPTY', 'WINDOW', []), - ('Weight Paint', 'EMPTY', 'WINDOW', []), - ('Face Mask', 'EMPTY', 'WINDOW', []), - ('Image Paint', 'EMPTY', 'WINDOW', []), # image and view3d - ('Sculpt', 'EMPTY', 'WINDOW', []), + ( N_('Vertex Paint'), 'EMPTY', 'WINDOW', []), + ( N_('Weight Paint'), 'EMPTY', 'WINDOW', []), + ( N_('Face Mask'), 'EMPTY', 'WINDOW', []), + ( N_('Image Paint'), 'EMPTY', 'WINDOW', []), # image and view3d + ( N_('Sculpt'), 'EMPTY', 'WINDOW', []), - ('Armature Sketch', 'EMPTY', 'WINDOW', []), - ('Particle', 'EMPTY', 'WINDOW', []), + ( N_('Armature Sketch'), 'EMPTY', 'WINDOW', []), + ( N_('Particle'), 'EMPTY', 'WINDOW', []), - ('Object Non-modal', 'EMPTY', 'WINDOW', []), # mode change + ( N_('Object Non-modal'), 'EMPTY', 'WINDOW', []), # mode change - ('3D View Generic', 'VIEW_3D', 'WINDOW', []) # toolbar and properties + ( N_('3D View Generic'), 'VIEW_3D', 'WINDOW', []) # toolbar and properties ]), - ('Frames', 'EMPTY', 'WINDOW', []), # frame navigation (per region) - ('Markers', 'EMPTY', 'WINDOW', []), # markers (per region) - ('Animation', 'EMPTY', 'WINDOW', []), # frame change on click, preview range (per region) - ('Animation Channels', 'EMPTY', 'WINDOW', []), - ('Graph Editor', 'GRAPH_EDITOR', 'WINDOW', [ - ('Graph Editor Generic', 'GRAPH_EDITOR', 'WINDOW', []) + ( N_('Frames'), 'EMPTY', 'WINDOW', []), # frame navigation (per region) + ( N_('Markers'), 'EMPTY', 'WINDOW', []), # markers (per region) + ( N_('Animation'), 'EMPTY', 'WINDOW', []), # frame change on click, preview range (per region) + ( N_('Animation Channels'), 'EMPTY', 'WINDOW', []), + ( N_('Graph Editor'), 'GRAPH_EDITOR', 'WINDOW', [ + ( N_('Graph Editor Generic'), 'GRAPH_EDITOR', 'WINDOW', []) ]), - ('Dopesheet', 'DOPESHEET_EDITOR', 'WINDOW', []), - ('NLA Editor', 'NLA_EDITOR', 'WINDOW', [ - ('NLA Channels', 'NLA_EDITOR', 'WINDOW', []), - ('NLA Generic', 'NLA_EDITOR', 'WINDOW', []) + ( N_('Dopesheet'), 'DOPESHEET_EDITOR', 'WINDOW', []), + ( N_('NLA Editor'), 'NLA_EDITOR', 'WINDOW', [ + ( N_('NLA Channels'), 'NLA_EDITOR', 'WINDOW', []), + ( N_('NLA Generic'), 'NLA_EDITOR', 'WINDOW', []) ]), - ('Image', 'IMAGE_EDITOR', 'WINDOW', [ - ('UV Editor', 'EMPTY', 'WINDOW', []), # image (reverse order, UVEdit before Image - ('Image Paint', 'EMPTY', 'WINDOW', []), # image and view3d - ('Image Generic', 'IMAGE_EDITOR', 'WINDOW', []) + ( N_('Image'), 'IMAGE_EDITOR', 'WINDOW', [ + ( N_('UV Editor'), 'EMPTY', 'WINDOW', []), # image (reverse order, UVEdit before Image + ( N_('Image Paint'), 'EMPTY', 'WINDOW', []), # image and view3d + ( N_('Image Generic'), 'IMAGE_EDITOR', 'WINDOW', []) ]), - ('Timeline', 'TIMELINE', 'WINDOW', []), - ('Outliner', 'OUTLINER', 'WINDOW', []), + ( N_('Timeline'), 'TIMELINE', 'WINDOW', []), + ( N_('Outliner'), 'OUTLINER', 'WINDOW', []), - ('Node Editor', 'NODE_EDITOR', 'WINDOW', [ - ('Node Generic', 'NODE_EDITOR', 'WINDOW', []) + ( N_('Node Editor'), 'NODE_EDITOR', 'WINDOW', [ + ( N_('Node Generic'), 'NODE_EDITOR', 'WINDOW', []) ]), - ('Sequencer', 'SEQUENCE_EDITOR', 'WINDOW', []), - ('Logic Editor', 'LOGIC_EDITOR', 'WINDOW', []), + ( N_('Sequencer'), 'SEQUENCE_EDITOR', 'WINDOW', []), + ( N_('Logic Editor'), 'LOGIC_EDITOR', 'WINDOW', []), - ('File Browser', 'FILE_BROWSER', 'WINDOW', [ - ('File Browser Main', 'FILE_BROWSER', 'WINDOW', []), - ('File Browser Buttons', 'FILE_BROWSER', 'WINDOW', []) + ( N_('File Browser'), 'FILE_BROWSER', 'WINDOW', [ + ( N_('File Browser Main'), 'FILE_BROWSER', 'WINDOW', []), + ( N_('File Browser Buttons'), 'FILE_BROWSER', 'WINDOW', []) ]), - ('Property Editor', 'PROPERTIES', 'WINDOW', []), # align context menu + ( N_('Property Editor'), 'PROPERTIES', 'WINDOW', []), # align context menu - ('Script', 'SCRIPTS_WINDOW', 'WINDOW', []), - ('Text', 'TEXT_EDITOR', 'WINDOW', []), - ('Console', 'CONSOLE', 'WINDOW', []), + ( N_('Script'), 'SCRIPTS_WINDOW', 'WINDOW', []), + ( N_('Text'), 'TEXT_EDITOR', 'WINDOW', []), + ( N_('Console'), 'CONSOLE', 'WINDOW', []), - ('View3D Gesture Circle', 'EMPTY', 'WINDOW', []), - ('Gesture Border', 'EMPTY', 'WINDOW', []), - ('Standard Modal Map', 'EMPTY', 'WINDOW', []), - ('Transform Modal Map', 'EMPTY', 'WINDOW', []), - ('View3D Fly Modal', 'EMPTY', 'WINDOW', []), - ('View3D Rotate Modal', 'EMPTY', 'WINDOW', []), - ('View3D Move Modal', 'EMPTY', 'WINDOW', []), - ('View3D Zoom Modal', 'EMPTY', 'WINDOW', []), + ( N_('View3D Gesture Circle'), 'EMPTY', 'WINDOW', []), + ( N_('Gesture Border'), 'EMPTY', 'WINDOW', []), + ( N_('Standard Modal Map'), 'EMPTY', 'WINDOW', []), + ( N_('Transform Modal Map'), 'EMPTY', 'WINDOW', []), + ( N_('View3D Fly Modal'), 'EMPTY', 'WINDOW', []), + ( N_('View3D Rotate Modal'), 'EMPTY', 'WINDOW', []), + ( N_('View3D Move Modal'), 'EMPTY', 'WINDOW', []), + ( N_('View3D Zoom Modal'), 'EMPTY', 'WINDOW', []), ] @@ -130,7 +131,7 @@ class USERPREF_MT_keyconfigs(bpy.types.Menu): preset_operator = "wm.keyconfig_activate" def draw(self, context): - props = self.layout.operator("wm.context_set_value", text="Blender (default)") + props = self.layout.operator("wm.context_set_value", text=_("Blender (default)")) props.data_path = "window_manager.keyconfigs.active" props.value = "context.window_manager.keyconfigs.default" @@ -181,7 +182,7 @@ class InputKeyMapPanel: row = col.row() row.prop(km, "show_expanded_children", text="", emboss=False) - row.label(text=km.name) + row.label(text=_(km.name)) row.label() row.label() @@ -189,9 +190,9 @@ class InputKeyMapPanel: if km.is_modal: row.label(text="", icon='LINKED') if km.is_user_defined: - op = row.operator("wm.keymap_restore", text="Restore") + op = row.operator("wm.keymap_restore", text=_("Restore")) else: - op = row.operator("wm.keymap_edit", text="Edit") + op = row.operator("wm.keymap_edit", text=_("Edit")) if km.show_expanded_children: if children: @@ -351,9 +352,9 @@ class InputKeyMapPanel: row.label() if km.is_user_defined: - op = row.operator("wm.keymap_restore", text="Restore") + op = row.operator("wm.keymap_restore", text=_("Restore")) else: - op = row.operator("wm.keymap_edit", text="Edit") + op = row.operator("wm.keymap_edit", text=_("Edit")) for kmi in filtered_items: self.draw_kmi(display_keymaps, kc, km, kmi, col, 1) @@ -384,7 +385,7 @@ class InputKeyMapPanel: #row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config:") text = bpy.path.display_name(context.window_manager.keyconfigs.active.name) if not text: - text = "Blender (default)" + text = _("Blender (default)") row.menu("USERPREF_MT_keyconfigs", text=text) row.operator("wm.keyconfig_preset_add", text="", icon="ZOOMIN") row.operator("wm.keyconfig_preset_add", text="", icon="ZOOMOUT").remove_active = True @@ -534,14 +535,15 @@ def _string_value(value): class WM_OT_keyconfig_import(bpy.types.Operator): "Import key configuration from a python script" bl_idname = "wm.keyconfig_import" - bl_label = "Import Key Configuration..." + bl_label = _("Import Key Configuration...") + __doc__ = _("Import key configuration from a python script") filepath = StringProperty(name="File Path", description="Filepath to write file to", default="keymap.py") filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) filter_text = BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'}) filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'}) - keep_original = BoolProperty(name="Keep original", description="Keep original file after copying to configuration folder", default=True) + keep_original = BoolProperty(name=_("Keep original"), description=_("Keep original file after copying to configuration folder"), default=True) def execute(self, context): from os.path import basename @@ -579,7 +581,8 @@ class WM_OT_keyconfig_import(bpy.types.Operator): class WM_OT_keyconfig_export(bpy.types.Operator): "Export key configuration to a python script" bl_idname = "wm.keyconfig_export" - bl_label = "Export Key Configuration..." + bl_label = _("Export Key Configuration...") + __doc__ = _("Export key configuration to a python script") filepath = StringProperty(name="File Path", description="Filepath to write file to", default="keymap.py") filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index bda4bb899ac..76748e61640 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -120,62 +120,62 @@ class VIEW3D_HT_header(bpy.types.Header): class ShowHideMenu(): - bl_label = "Show/Hide" + bl_label = _("Show/Hide") _operator_name = "" def draw(self, context): layout = self.layout - layout.operator("%s.reveal" % self._operator_name, text="Show Hidden") - layout.operator("%s.hide" % self._operator_name, text="Hide Selected") - layout.operator("%s.hide" % self._operator_name, text="Hide Unselected").unselected = True + layout.operator("%s.reveal" % self._operator_name, text=_("Show Hidden")) + layout.operator("%s.hide" % self._operator_name, text=_("Hide Selected")) + layout.operator("%s.hide" % self._operator_name, text=_("Hide Unselected")).unselected = True class VIEW3D_MT_transform(bpy.types.Menu): - bl_label = "Transform" + bl_label = _("Transform") # TODO: get rid of the custom text strings? def draw(self, context): layout = self.layout - layout.operator("transform.translate", text="Grab/Move") + layout.operator("transform.translate", text=_("Grab/Move")) # TODO: sub-menu for grab per axis - layout.operator("transform.rotate", text="Rotate") + layout.operator("transform.rotate", text=_("Rotate")) # TODO: sub-menu for rot per axis - layout.operator("transform.resize", text="Scale") + layout.operator("transform.resize", text=_("Scale")) # TODO: sub-menu for scale per axis layout.separator() - layout.operator("transform.tosphere", text="To Sphere") - layout.operator("transform.shear", text="Shear") - layout.operator("transform.warp", text="Warp") - layout.operator("transform.push_pull", text="Push/Pull") + layout.operator("transform.tosphere", text=_("To Sphere")) + layout.operator("transform.shear", text=_("Shear")) + layout.operator("transform.warp", text=_("Warp")) + layout.operator("transform.push_pull", text=_("Push/Pull")) layout.separator() - layout.operator("transform.translate", text="Move Texture Space").texture_space = True - layout.operator("transform.resize", text="Scale Texture Space").texture_space = True + layout.operator("transform.translate", text=_("Move Texture Space")).texture_space = True + layout.operator("transform.resize", text=_("Scale Texture Space")).texture_space = True layout.separator() obj = context.object if obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and obj.data.draw_type in {'BBONE', 'ENVELOPE'}: - layout.operator("transform.transform", text="Scale Envelope/BBone").mode = 'BONE_SIZE' + layout.operator("transform.transform", text=_("Scale Envelope/BBone")).mode = 'BONE_SIZE' if context.edit_object and context.edit_object.type == 'ARMATURE': layout.operator("armature.align") else: layout.operator_context = 'EXEC_REGION_WIN' - layout.operator("transform.transform", text="Align to Transform Orientation").mode = 'ALIGN' # XXX see alignmenu() in edit.c of b2.4x to get this working + layout.operator("transform.transform", text=_("Align to Transform Orientation")).mode = 'ALIGN' # XXX see alignmenu() in edit.c of b2.4x to get this working layout.separator() layout.operator_context = 'EXEC_AREA' - layout.operator("object.origin_set", text="Geometry to Origin").type = 'GEOMETRY_ORIGIN' - layout.operator("object.origin_set", text="Origin to Geometry").type = 'ORIGIN_GEOMETRY' - layout.operator("object.origin_set", text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR' + layout.operator("object.origin_set", text=_("Geometry to Origin")).type = 'GEOMETRY_ORIGIN' + layout.operator("object.origin_set", text=_("Origin to Geometry")).type = 'ORIGIN_GEOMETRY' + layout.operator("object.origin_set", text=_("Origin to 3D Cursor")).type = 'ORIGIN_CURSOR' layout.separator() @@ -184,37 +184,37 @@ class VIEW3D_MT_transform(bpy.types.Menu): class VIEW3D_MT_mirror(bpy.types.Menu): - bl_label = "Mirror" + bl_label = _("Mirror") def draw(self, context): layout = self.layout - layout.operator("transform.mirror", text="Interactive Mirror") + layout.operator("transform.mirror", text=_("Interactive Mirror")) layout.separator() layout.operator_context = 'INVOKE_REGION_WIN' - props = layout.operator("transform.mirror", text="X Global") + props = layout.operator("transform.mirror", text=_("X Global")) props.constraint_axis = (True, False, False) props.constraint_orientation = 'GLOBAL' - props = layout.operator("transform.mirror", text="Y Global") + props = layout.operator("transform.mirror", text=_("Y Global")) props.constraint_axis = (False, True, False) props.constraint_orientation = 'GLOBAL' - props = layout.operator("transform.mirror", text="Z Global") + props = layout.operator("transform.mirror", text=_("Z Global")) props.constraint_axis = (False, False, True) props.constraint_orientation = 'GLOBAL' if context.edit_object: layout.separator() - props = layout.operator("transform.mirror", text="X Local") + props = layout.operator("transform.mirror", text=_("X Local")) props.constraint_axis = (True, False, False) props.constraint_orientation = 'LOCAL' - props = layout.operator("transform.mirror", text="Y Local") + props = layout.operator("transform.mirror", text=_("Y Local")) props.constraint_axis = (False, True, False) props.constraint_orientation = 'LOCAL' - props = layout.operator("transform.mirror", text="Z Local") + props = layout.operator("transform.mirror", text=_("Z Local")) props.constraint_axis = (False, False, True) props.constraint_orientation = 'LOCAL' @@ -222,20 +222,20 @@ class VIEW3D_MT_mirror(bpy.types.Menu): class VIEW3D_MT_snap(bpy.types.Menu): - bl_label = "Snap" + bl_label = _("Snap") def draw(self, context): layout = self.layout - layout.operator("view3d.snap_selected_to_grid", text="Selection to Grid") - layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor") + layout.operator("view3d.snap_selected_to_grid", text=_("Selection to Grid")) + layout.operator("view3d.snap_selected_to_cursor", text=_("Selection to Cursor")) layout.separator() - layout.operator("view3d.snap_cursor_to_selected", text="Cursor to Selected") - layout.operator("view3d.snap_cursor_to_center", text="Cursor to Center") - layout.operator("view3d.snap_cursor_to_grid", text="Cursor to Grid") - layout.operator("view3d.snap_cursor_to_active", text="Cursor to Active") + layout.operator("view3d.snap_cursor_to_selected", text=_("Cursor to Selected")) + layout.operator("view3d.snap_cursor_to_center", text=_("Cursor to Center")) + layout.operator("view3d.snap_cursor_to_grid", text=_("Cursor to Grid")) + layout.operator("view3d.snap_cursor_to_active", text=_("Cursor to Active")) class VIEW3D_MT_uv_map(bpy.types.Menu): @@ -735,26 +735,26 @@ class VIEW3D_MT_object(bpy.types.Menu): class VIEW3D_MT_object_animation(bpy.types.Menu): - bl_label = "Animation" + bl_label = _("Animation") def draw(self, context): layout = self.layout - layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...") - layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframe...") - layout.operator("anim.keying_set_active_set", text="Change Keying Set...") + layout.operator("anim.keyframe_insert_menu", text=_("Insert Keyframe...")) + layout.operator("anim.keyframe_delete_v3d", text=_("Delete Keyframe...")) + layout.operator("anim.keying_set_active_set", text=_("Change Keying Set...")) class VIEW3D_MT_object_clear(bpy.types.Menu): - bl_label = "Clear" + bl_label = _("Clear") def draw(self, context): layout = self.layout - layout.operator("object.location_clear", text="Location") - layout.operator("object.rotation_clear", text="Rotation") - layout.operator("object.scale_clear", text="Scale") - layout.operator("object.origin_clear", text="Origin") + layout.operator("object.location_clear", text=_("Location")) + layout.operator("object.rotation_clear", text=_("Rotation")) + layout.operator("object.scale_clear", text=_("Scale")) + layout.operator("object.origin_clear", text=_("Origin")) class VIEW3D_MT_object_specials(bpy.types.Menu): @@ -847,46 +847,46 @@ class VIEW3D_MT_object_specials(bpy.types.Menu): class VIEW3D_MT_object_apply(bpy.types.Menu): - bl_label = "Apply" + bl_label = _("Apply") def draw(self, context): layout = self.layout - layout.operator("object.transform_apply", text="Location").location = True - layout.operator("object.transform_apply", text="Rotation").rotation = True - layout.operator("object.transform_apply", text="Scale").scale = True - props = layout.operator("object.transform_apply", text="Rotation & Scale") + layout.operator("object.transform_apply", text=_("Location")).location = True + layout.operator("object.transform_apply", text=_("Rotation")).rotation = True + layout.operator("object.transform_apply", text=_("Scale")).scale = True + props = layout.operator("object.transform_apply", text=_("Rotation & Scale")) props.scale = True props.rotation = True layout.separator() - layout.operator("object.visual_transform_apply", text="Visual Transform") + layout.operator("object.visual_transform_apply", text=_("Visual Transform")) layout.operator("object.duplicates_make_real") class VIEW3D_MT_object_parent(bpy.types.Menu): - bl_label = "Parent" + bl_label = _("Parent") def draw(self, context): layout = self.layout - layout.operator("object.parent_set", text="Set") - layout.operator("object.parent_clear", text="Clear") + layout.operator("object.parent_set", text=_("Set")) + layout.operator("object.parent_clear", text=_("Clear")) class VIEW3D_MT_object_track(bpy.types.Menu): - bl_label = "Track" + bl_label = _("Track") def draw(self, context): layout = self.layout - layout.operator("object.track_set", text="Set") - layout.operator("object.track_clear", text="Clear") + layout.operator("object.track_set", text=_("Set")) + layout.operator("object.track_clear", text=_("Clear")) class VIEW3D_MT_object_group(bpy.types.Menu): - bl_label = "Group" + bl_label = _("Group") def draw(self, context): layout = self.layout @@ -901,7 +901,7 @@ class VIEW3D_MT_object_group(bpy.types.Menu): class VIEW3D_MT_object_constraints(bpy.types.Menu): - bl_label = "Constraints" + bl_label = _("Constraints") def draw(self, context): layout = self.layout @@ -912,68 +912,68 @@ class VIEW3D_MT_object_constraints(bpy.types.Menu): class VIEW3D_MT_object_showhide(bpy.types.Menu): - bl_label = "Show/Hide" + bl_label = _("Show/Hide") def draw(self, context): layout = self.layout - layout.operator("object.hide_view_clear", text="Show Hidden") - layout.operator("object.hide_view_set", text="Hide Selected") - layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True + layout.operator("object.hide_view_clear", text=_("Show Hidden")) + layout.operator("object.hide_view_set", text=_("Hide Selected")) + layout.operator("object.hide_view_set", text=_("Hide Unselected")).unselected = True class VIEW3D_MT_make_single_user(bpy.types.Menu): - bl_label = "Make Single User" + bl_label = _("Make Single User") def draw(self, context): layout = self.layout - props = layout.operator("object.make_single_user", text="Object") + props = layout.operator("object.make_single_user", text=_("Object")) props.object = True - props = layout.operator("object.make_single_user", text="Object & Data") + props = layout.operator("object.make_single_user", text=_("Object & Data")) props.object = props.obdata = True - props = layout.operator("object.make_single_user", text="Object & Data & Materials+Tex") + props = layout.operator("object.make_single_user", text=_("Object & Data & Materials+Tex")) props.object = props.obdata = props.material = props.texture = True - props = layout.operator("object.make_single_user", text="Materials+Tex") + props = layout.operator("object.make_single_user", text=_("Materials+Tex")) props.material = props.texture = True - props = layout.operator("object.make_single_user", text="Object Animation") + props = layout.operator("object.make_single_user", text=_("Object Animation")) props.animation = True class VIEW3D_MT_make_links(bpy.types.Menu): - bl_label = "Make Links" + bl_label = _("Make Links") def draw(self, context): layout = self.layout if(len(bpy.data.scenes) > 10): layout.operator_context = 'INVOKE_DEFAULT' - layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY') - layout.operator("object.make_links_scene", text="Markers to Scene...", icon='OUTLINER_OB_EMPTY') + layout.operator("object.make_links_scene", text=_("Objects to Scene..."), icon='OUTLINER_OB_EMPTY') + layout.operator("object.make_links_scene", text=_("Markers to Scene..."), icon='OUTLINER_OB_EMPTY') else: - layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene...") - layout.operator_menu_enum("marker.make_links_scene", "scene", text="Markers to Scene...") + layout.operator_menu_enum("object.make_links_scene", "scene", text=_("Objects to Scene...")) + layout.operator_menu_enum("marker.make_links_scene", "scene", text=_("Markers to Scene...")) layout.operator_enum("object.make_links_data", "type") # inline class VIEW3D_MT_object_game(bpy.types.Menu): - bl_label = "Game" + bl_label = _("Game") def draw(self, context): layout = self.layout - layout.operator("object.logic_bricks_copy", text="Copy Logic Bricks") + layout.operator("object.logic_bricks_copy", text=_("Copy Logic Bricks")) layout.separator() - layout.operator("object.game_property_copy", text="Replace Properties").operation = 'REPLACE' - layout.operator("object.game_property_copy", text="Merge Properties").operation = 'MERGE' - layout.operator_menu_enum("object.game_property_copy", "property", text="Copy Properties...") + layout.operator("object.game_property_copy", text=_("Replace Properties")).operation = 'REPLACE' + layout.operator("object.game_property_copy", text=_("Merge Properties")).operation = 'MERGE' + layout.operator_menu_enum("object.game_property_copy", "property", text=_("Copy Properties...")) layout.separator() @@ -1873,14 +1873,14 @@ class VIEW3D_MT_edit_meta(bpy.types.Menu): class VIEW3D_MT_edit_meta_showhide(bpy.types.Menu): - bl_label = "Show/Hide" + bl_label = _("Show/Hide") def draw(self, context): layout = self.layout - layout.operator("mball.reveal_metaelems", text="Show Hidden") - layout.operator("mball.hide_metaelems", text="Hide Selected") - layout.operator("mball.hide_metaelems", text="Hide Unselected").unselected = True + layout.operator("mball.reveal_metaelems", text=_("Show Hidden")) + layout.operator("mball.hide_metaelems", text=_("Hide Selected")) + layout.operator("mball.hide_metaelems", text=_("Hide Unselected")).unselected = True class VIEW3D_MT_edit_lattice(bpy.types.Menu): |