make plugins translation work under windows.

This commit is contained in:
Yann Leboulanger 2011-09-02 19:41:09 +02:00
parent 6de00d1cc5
commit 2b11c7f8d9
2 changed files with 11 additions and 4 deletions

View File

@ -156,6 +156,11 @@ common.configpaths.gajimpaths.init_profile(profile)
del profile
if os.name == 'nt':
plugins_locale_dir = str(os.path.join(common.configpaths.gajimpaths[
'PLUGINS_USER'], 'locale'))
libintl.bindtextdomain('gajim_plugins', plugins_locale_dir)
libintl.bind_textdomain_codeset('gajim_plugins', 'UTF-8')
class MyStderr(object):
_file = None
_error = None

View File

@ -27,10 +27,12 @@ from common import gajim
APP = 'gajim_plugins'
plugins_locale_dir = os_path.join(gajim.PLUGINS_DIRS[1], 'locale')
locale.setlocale(locale.LC_ALL, '')
locale.bindtextdomain(APP, plugins_locale_dir)
gettext.bindtextdomain(APP, plugins_locale_dir)
gettext.textdomain(APP)
if os.name != 'nt':
locale.setlocale(locale.LC_ALL, '')
locale.bindtextdomain(APP, plugins_locale_dir)
gettext.bindtextdomain(APP, plugins_locale_dir)
gettext.textdomain(APP)
try:
t = gettext.translation(APP, plugins_locale_dir)
_ = t.gettext