use pythons locale package to determine the system locale

This commit is contained in:
2022-02-12 10:52:52 +01:00
parent 4f6899eac5
commit d28c870a0a

View File

@@ -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')