summaryrefslogtreecommitdiff
path: root/lib/i18n.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/i18n.py')
-rw-r--r--lib/i18n.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/i18n.py b/lib/i18n.py
index 0a35ae25..2a901a0e 100644
--- a/lib/i18n.py
+++ b/lib/i18n.py
@@ -5,10 +5,8 @@
import gettext
import os
-import sys
-from os.path import dirname, realpath
-from .utils import cache
+from .utils import cache, get_resource_dir
_ = translation = None
locale_dir = None
@@ -23,17 +21,7 @@ def N_(message): return message
def _set_locale_dir():
global locale_dir
-
- if getattr(sys, 'frozen', False):
- # we are in a pyinstaller installation
- locale_dir = sys._MEIPASS
- else:
- locale_dir = dirname(dirname(realpath(__file__)))
-
- if sys.platform == "darwin" and getattr(sys, 'frozen', False):
- locale_dir = os.path.join(locale_dir, "..", 'Resources', 'locales')
- else:
- locale_dir = os.path.join(locale_dir, 'locales')
+ locale_dir = get_resource_dir('locales')
def localize(languages=None):