use pythons locale package to determine the system locale
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user