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!.
This commit is contained in:
Bastien Montagne
2013-02-10 10:29:38 +00:00
parent 3b8a0f3d67
commit d0f4a2396b
11 changed files with 106 additions and 57 deletions

View File

@@ -19,8 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Panel
from bpy.app.translations import pgettext as _
from bpy.app.translations import pgettext_iface as iface_
class ModifierButtonsPanel():
@@ -267,7 +266,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
layout.prop(md, "angle_limit")
layout.prop(md, "use_dissolve_boundaries")
layout.label(text=_("Face Count: %d") % md.face_count, translate=False)
layout.label(text=iface_("Face Count: %d") % md.face_count, translate=False)
def DISPLACE(self, layout, ob, md):
has_texture = (md.texture is not None)