From d28c870a0a32d90ab95f08c51ba0df2fbe54a918 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Sat, 12 Feb 2022 10:52:52 +0100 Subject: [PATCH] use pythons locale package to determine the system locale --- src/i18n.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i18n.py b/src/i18n.py index 06acb25..422d58f 100644 --- a/src/i18n.py +++ b/src/i18n.py @@ -4,9 +4,10 @@ from pathlib import Path from src.pluginregistry import PluginRegistry from src.settings.settingsstore import SettingsStore +from locale import getlocale settings = SettingsStore.load() -locale = os.environ['LANG'] if 'LANG' in os.environ and os.environ['LANG'] else "en" +locale = getlocale()[0] locale = settings.session.get('general', 'lang', fallback=locale) _ = False @@ -24,4 +25,3 @@ if not _: _ = gettext.gettext ngettext = gettext.ngettext PluginRegistry.execute("set_locale", '') - print('No translation found')