mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 19:44:52 +00:00
[Lang] Add fallback dll for Windows libintl
This commit is contained in:
parent
bde13515e6
commit
4313974f07
1 changed files with 7 additions and 3 deletions
|
@ -93,7 +93,12 @@ def setup_translations(setup_gettext=True, setup_pygtk=False):
|
|||
|
||||
if deluge.common.windows_check():
|
||||
import ctypes
|
||||
libintl = ctypes.cdll.intl
|
||||
try:
|
||||
libintl = ctypes.cdll.intl
|
||||
except WindowsError:
|
||||
# Fallback to named dll.
|
||||
libintl = ctypes.cdll.LoadLibrary('libintl-8.dll')
|
||||
|
||||
libintl.bindtextdomain(domain, translations_path.encode(sys.getfilesystemencoding()))
|
||||
libintl.textdomain(domain)
|
||||
libintl.bind_textdomain_codeset(domain, 'UTF-8')
|
||||
|
@ -105,8 +110,7 @@ def setup_translations(setup_gettext=True, setup_pygtk=False):
|
|||
gtk.glade.bindtextdomain(domain, translations_path)
|
||||
gtk.glade.textdomain(domain)
|
||||
except Exception as ex:
|
||||
log.error('Unable to initialize glade translation!')
|
||||
log.exception(ex)
|
||||
log.error('Unable to initialize glade translation: %s', ex)
|
||||
if setup_gettext:
|
||||
try:
|
||||
if hasattr(locale, 'bindtextdomain'):
|
||||
|
|
Loading…
Add table
Reference in a new issue