make plugins translation work under windows.
This commit is contained in:
parent
6de00d1cc5
commit
2b11c7f8d9
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue