Add French manual and add local manual detection in Config

This commit is contained in:
Veronica Berglyd Olsen
2025-02-02 17:26:57 +01:00
parent 7adc36eecb
commit 1c6625ec2b
2 changed files with 9 additions and 2 deletions
Binary file not shown.
+9 -2
View File
@@ -105,8 +105,11 @@ class Config:
self._qtTrans = {}
# PDF Manual
pdfDocs = self._appPath / "assets" / "manual.pdf"
self.pdfDocs = pdfDocs if pdfDocs.is_file() else None
self._manuals: dict[str, Path] = {}
if (assets := self._appPath / "assets").is_dir():
for item in assets.iterdir():
if item.is_file() and item.stem.startswith("manual") and item.suffix == ".pdf":
self._manuals[item.stem] = item
# User Settings
# =============
@@ -262,6 +265,10 @@ class Config:
def hasError(self) -> bool:
return self._hasError
@property
def pdfDocs(self) -> Path | None:
return self._manuals.get(f"manual_{self.locale.name()}", self._manuals.get("manual"))
@property
def locale(self) -> QLocale:
return self._dLocale