mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 18:08:39 +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():
|
if deluge.common.windows_check():
|
||||||
import ctypes
|
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.bindtextdomain(domain, translations_path.encode(sys.getfilesystemencoding()))
|
||||||
libintl.textdomain(domain)
|
libintl.textdomain(domain)
|
||||||
libintl.bind_textdomain_codeset(domain, 'UTF-8')
|
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.bindtextdomain(domain, translations_path)
|
||||||
gtk.glade.textdomain(domain)
|
gtk.glade.textdomain(domain)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
log.error('Unable to initialize glade translation!')
|
log.error('Unable to initialize glade translation: %s', ex)
|
||||||
log.exception(ex)
|
|
||||||
if setup_gettext:
|
if setup_gettext:
|
||||||
try:
|
try:
|
||||||
if hasattr(locale, 'bindtextdomain'):
|
if hasattr(locale, 'bindtextdomain'):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue