Add translation capability, offer English and French as options

This commit is contained in:
Miguel Jacq 2025-11-12 13:58:58 +11:00
parent 54a6be835f
commit f578d562e6
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
17 changed files with 490 additions and 138 deletions

View file

@ -9,13 +9,15 @@ from PySide6.QtWidgets import (
QDialogButtonBox,
)
from . import strings
class KeyPrompt(QDialog):
def __init__(
self,
parent=None,
title: str = "Enter key",
message: str = "Enter key",
title: str = strings._("key_prompt_enter_key"),
message: str = strings._("key_prompt_enter_key"),
):
"""
Prompt the user for the key required to decrypt the database.
@ -30,7 +32,7 @@ class KeyPrompt(QDialog):
self.edit = QLineEdit()
self.edit.setEchoMode(QLineEdit.Password)
v.addWidget(self.edit)
toggle = QPushButton("Show")
toggle = QPushButton(strings._("show"))
toggle.setCheckable(True)
toggle.toggled.connect(
lambda c: self.edit.setEchoMode(