From d0f4a2396b38c122b7e56de83532515ae8fa4381 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 10 Feb 2013 10:29:38 +0000 Subject: Actually, UI scripts should not use directly pgettext, but rather the iface or tooltip variants. Added those to bpy.app.translations, and used pgettext_iface. (Did not add those when I created that module, because I did not thought we would actually need them in usual UI code, but turned out I was wrong). Also made some optimizations in those py gettext funcs, when i18n is disabled at build time, no need to do pyobject -> cstring -> pyobject conversions!. --- release/scripts/startup/bl_ui/space_text.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'release/scripts/startup/bl_ui/space_text.py') diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py index 089bffd7e75..4264fc95cea 100644 --- a/release/scripts/startup/bl_ui/space_text.py +++ b/release/scripts/startup/bl_ui/space_text.py @@ -19,8 +19,7 @@ # import bpy from bpy.types import Header, Menu, Panel - -from bpy.app.translations import pgettext as _ +from bpy.app.translations import pgettext_iface as iface_ class TEXT_HT_header(Header): @@ -74,10 +73,10 @@ class TEXT_HT_header(Header): row = layout.row() if text.filepath: if text.is_dirty: - row.label(text=_("File: *%r (unsaved)") % + row.label(text=iface_("File: *%r (unsaved)") % text.filepath, translate=False) else: - row.label(text=pgettext("File: %r") % + row.label(text=iface_("File: %r") % text.filepath, translate=False) else: row.label(text="Text: External" -- cgit v1.2.3