diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/space_topbar.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 31ecd67eb08..3320e1e24a7 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -2,6 +2,11 @@ import bpy from bpy.types import Header, Menu, Panel +from bpy.app.translations import ( + pgettext_iface as iface_, + contexts as i18n_contexts, +) + class TOPBAR_HT_upper_bar(Header): bl_space_type = 'TOPBAR' @@ -267,7 +272,7 @@ class TOPBAR_MT_file(Menu): layout = self.layout layout.operator_context = 'INVOKE_AREA' - layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW') + layout.menu("TOPBAR_MT_file_new", text="New", text_ctxt=i18n_contexts.id_windowmanager, icon='FILE_NEW') layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER') layout.menu("TOPBAR_MT_file_open_recent") layout.operator("wm.revert_mainfile") @@ -363,7 +368,7 @@ class TOPBAR_MT_file_new(Menu): for d in paths: props = layout.operator( "wm.read_homefile", - text=bpy.path.display_name(d), + text=bpy.path.display_name(iface_(d)), icon=icon, ) props.app_template = d @@ -406,9 +411,16 @@ class TOPBAR_MT_file_defaults(Menu): app_template, has_ext=False)) layout.operator("wm.save_homefile") - props = layout.operator("wm.read_factory_settings") if app_template: + display_name = bpy.path.display_name(iface_(app_template)) + props = layout.operator("wm.read_factory_settings", text="Load Factory Blender Settings") props.app_template = app_template + props = layout.operator("wm.read_factory_settings", text="Load Factory %s Settings" % display_name) + props.app_template = app_template + props.use_factory_startup_app_template_only = True + del display_name + else: + layout.operator("wm.read_factory_settings") # Include technical operators here which would otherwise have no way for users to access. @@ -722,7 +734,7 @@ class TOPBAR_MT_file_context_menu(Menu): layout = self.layout layout.operator_context = 'INVOKE_AREA' - layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW') + layout.menu("TOPBAR_MT_file_new", text="New", text_ctxt=i18n_contexts.id_windowmanager, icon='FILE_NEW') layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER') layout.separator() |