From dff778ceebcbc4cc648c543183ff72295beb2f32 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Tue, 11 Jun 2019 11:30:55 +0100 Subject: [PATCH] [i18n] Try loading intl.dll on Windows --- deluge/i18n/util.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/deluge/i18n/util.py b/deluge/i18n/util.py index eddd003aa..bd002f7a2 100644 --- a/deluge/i18n/util.py +++ b/deluge/i18n/util.py @@ -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')