Commit 8895d0d5 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Config: Add windows title translate.

Showing with 24 additions and 4 deletions
+24 -4
...@@ -20,6 +20,8 @@ from View.Tools.PamhyrWindow import PamhyrDialog ...@@ -20,6 +20,8 @@ from View.Tools.PamhyrWindow import PamhyrDialog
from Solver.Solvers import solver_type_list from Solver.Solvers import solver_type_list
from Solver.GenericSolver import GenericSolver from Solver.GenericSolver import GenericSolver
from View.Configure.Translate import ConfigureTranslate
from PyQt5.QtWidgets import ( from PyQt5.QtWidgets import (
QPushButton, QPushButton,
) )
...@@ -30,15 +32,19 @@ class ConfigureSolverWindow(PamhyrDialog): ...@@ -30,15 +32,19 @@ class ConfigureSolverWindow(PamhyrDialog):
_pamhyr_name = "Add/Edit Solver" _pamhyr_name = "Add/Edit Solver"
def __init__(self, data=None, config=None, parent=None): def __init__(self, data=None, config=None, parent=None):
trad = ConfigureTranslate()
if data is not None: if data is not None:
name = f"Edit Solver - {data.name}" name = trad["edit_solver"]
name += f" - {data.name}"
else: else:
name = "Add a new Solver" name = trad["add_solver"]
super(ConfigureSolverWindow, self).__init__( super(ConfigureSolverWindow, self).__init__(
title=name, title=name,
config=config, config=config,
options=[], options=[],
trad=trad,
parent=parent parent=parent
) )
......
...@@ -27,8 +27,20 @@ class ConfigureTranslate(PamhyrTranslate): ...@@ -27,8 +27,20 @@ class ConfigureTranslate(PamhyrTranslate):
def __init__(self): def __init__(self):
super(ConfigureTranslate, self).__init__() super(ConfigureTranslate, self).__init__()
self._dict["Configure"] = _translate(
"Configure", "Configure"
)
self._sub_dict["table_headers"] = { self._sub_dict["table_headers"] = {
"name": _translate("Configure", "Name"), "name": _translate("Configure", "Name"),
"type": _translate("Configure", "Type"), "type": _translate("Configure", "Type"),
"description": _translate("Configure", "Description"), "description": _translate("Configure", "Description"),
} }
# Solvers
self._dict["edit_solver"] = _translate(
"Configure", "Edit solver"
)
self._dict["add_solver"] = _translate(
"Configure", "Add a new solver"
)
...@@ -83,10 +83,12 @@ class ConfigureWindow(PamhyrDialog): ...@@ -83,10 +83,12 @@ class ConfigureWindow(PamhyrDialog):
if config is None: if config is None:
config = Config() config = Config()
trad = ConfigureTranslate()
super(ConfigureWindow, self).__init__( super(ConfigureWindow, self).__init__(
title=self._pamhyr_name, title=trad[self._pamhyr_name],
config=config, config=config,
trad=ConfigureTranslate(), trad=trad,
options=[], options=[],
parent=parent parent=parent
) )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment