Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2013-02-10 14:29:38 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-02-10 14:29:38 +0400
commitd0f4a2396b38c122b7e56de83532515ae8fa4381 (patch)
treec10f9983e987090f73ce8a39e368f5d265d670ac /release/scripts/startup/bl_ui/space_text.py
parent3b8a0f3d674a0da3bb17cbda30f0a2dc19a40e4f (diff)
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!.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_text.py')
-rw-r--r--release/scripts/startup/bl_ui/space_text.py7
1 files changed, 3 insertions, 4 deletions
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 @@
# <pep8-80 compliant>
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"