Remove code we won't reach in strings.py because we always pass a default locale

This commit is contained in:
Miguel Jacq 2025-11-12 16:45:07 +11:00
parent e9f1f97934
commit ab5ec2bfae
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9

View file

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