[i18n] Try loading intl.dll on Windows

This commit is contained in:
Calum Lind 2019-06-11 11:30:55 +01:00
parent bdadd2b515
commit dff778ceeb
1 changed files with 12 additions and 1 deletions

View File

@ -119,7 +119,18 @@ def setup_translation():
libintl = None
if deluge.common.windows_check():
libintl = ctypes.cdll.LoadLibrary('libintl-8.dll')
for intl in ('libintl-8.dll', 'intl.dll'):
try:
libintl = ctypes.cdll.LoadLibrary(intl)
except OSError as ex:
exception = ex
else:
break
finally:
if not libintl:
log.error('Unable to initialize gettext/locale!')
log.error(exception)
setup_mock_translation()
elif deluge.common.osx_check():
libintl = ctypes.cdll.LoadLibrary('libintl.dylib')