From a66ae845f1f62ab6106c02663d2b191a35c9361f Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:56:38 +0100 Subject: Print-pdf: simplify path detection (#3282) * print-pdf: simplify path detection * i18n: more cleaning up * Version, License paths --- lib/i18n.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'lib/i18n.py') 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): -- cgit v1.2.3