Adding commandline argument to force language.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ad5001 2022-01-20 18:51:57 +01:00
parent 74ea50d19f
commit 5384dbfc89
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
3 changed files with 6 additions and 2 deletions

1
.gitignore vendored
View file

@ -11,6 +11,7 @@ linux/flatpak/.flatpak-builder
**/**.qmlc
**/**.jsc
**/**.pyc
**/**.qm
*.jsc
*.qmlc
.DS_Store

View file

@ -17,7 +17,7 @@
"""
from shutil import which
__VERSION__ = "0.1.3"
__VERSION__ = "0.1.4"
is_release = False

View file

@ -176,7 +176,10 @@ def run():
# Installing translators
translator = QTranslator()
if (translator.load(QLocale(), "lp", "_", path.realpath(path.join(getcwd(), "i18n")))):
# Check if lang is forced.
forcedlang = [p for p in argv if p[:7]=="--lang="]
locale = QLocale(forcedlang[0][7:]) if len(forcedlang) > 0 else QLocale()
if (translator.load(locale, "lp", "_", path.realpath(path.join(getcwd(), "i18n")))):
app.installTranslator(translator);
# Installing macOS file handler.