Remove code we won't reach in strings.py because we always pass a default locale
This commit is contained in:
parent
e9f1f97934
commit
ab5ec2bfae
1 changed files with 1 additions and 10 deletions
|
|
@ -8,7 +8,7 @@ strings = {}
|
||||||
translations = {}
|
translations = {}
|
||||||
|
|
||||||
|
|
||||||
def load_strings(current_locale: str | None = None) -> None:
|
def load_strings(current_locale: str) -> None:
|
||||||
global strings, translations
|
global strings, translations
|
||||||
translations = {}
|
translations = {}
|
||||||
|
|
||||||
|
|
@ -18,15 +18,6 @@ def load_strings(current_locale: str | None = None) -> None:
|
||||||
data = (root / f"{loc}.json").read_text(encoding="utf-8")
|
data = (root / f"{loc}.json").read_text(encoding="utf-8")
|
||||||
translations[loc] = json.loads(data)
|
translations[loc] = json.loads(data)
|
||||||
|
|
||||||
# Load in the system's locale if not passed in somehow from settings
|
|
||||||
if not current_locale:
|
|
||||||
try:
|
|
||||||
from PySide6.QtCore import QLocale
|
|
||||||
|
|
||||||
current_locale = QLocale.system().name().split("_")[0]
|
|
||||||
except Exception:
|
|
||||||
current_locale = _DEFAULT
|
|
||||||
|
|
||||||
if current_locale not in translations:
|
if current_locale not in translations:
|
||||||
current_locale = _DEFAULT
|
current_locale = _DEFAULT
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue