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

LC: Add windows title translate.

Showing with 13 additions and 6 deletions
+13 -6
...@@ -54,15 +54,14 @@ class EditLateralContributionWindow(PamhyrWindow): ...@@ -54,15 +54,14 @@ class EditLateralContributionWindow(PamhyrWindow):
study=None, config=None, study=None, config=None,
parent=None): parent=None):
self._data = data self._data = data
trad = LCETranslate()
name = self._pamhyr_name trad = LCETranslate()
name = trad[self._pamhyr_name]
if self._data is not None: if self._data is not None:
edge_name = (self._data.edge.name if self._data.edge is not None edge_name = (self._data.edge.name if self._data.edge is not None
else _translate("LateralContribution", else _translate("LateralContribution",
"Not associate")) "Not associate"))
name = ( name += (
_translate("Edit lateral contribution", self._pamhyr_name) +
f" - {study.name} " + f" - {study.name} " +
f" - {self._data.name} ({self._data.id}) " + f" - {self._data.name} ({self._data.id}) " +
f"({trad.get_dict('long_types')[self._data.lctype]} - " + f"({trad.get_dict('long_types')[self._data.lctype]} - " +
......
...@@ -27,6 +27,9 @@ _translate = QCoreApplication.translate ...@@ -27,6 +27,9 @@ _translate = QCoreApplication.translate
class LCETranslate(LCTranslate): class LCETranslate(LCTranslate):
def __init__(self): def __init__(self):
super(LCETranslate, self).__init__() super(LCETranslate, self).__init__()
self._dict["Edit lateral contribution"] = _translate(
"LateralContribution", "Edit lateral contribution"
)
self._sub_dict["table_headers"] = { self._sub_dict["table_headers"] = {
"x": _translate("LateralContribution", "X"), "x": _translate("LateralContribution", "X"),
......
...@@ -68,12 +68,13 @@ class LateralContributionWindow(PamhyrWindow): ...@@ -68,12 +68,13 @@ class LateralContributionWindow(PamhyrWindow):
_pamhyr_name = "Lateral contribution" _pamhyr_name = "Lateral contribution"
def __init__(self, study=None, config=None, parent=None): def __init__(self, study=None, config=None, parent=None):
name = self._pamhyr_name + " - " + study.name trad = LCTranslate()
name = trad[self._pamhyr_name] + " - " + study.name
super(LateralContributionWindow, self).__init__( super(LateralContributionWindow, self).__init__(
title=name, title=name,
study=study, study=study,
trad=LCTranslate(), trad=trad,
config=config, config=config,
parent=parent parent=parent
) )
......
...@@ -38,6 +38,10 @@ class LCTranslate(PamhyrTranslate): ...@@ -38,6 +38,10 @@ class LCTranslate(PamhyrTranslate):
def __init__(self): def __init__(self):
super(LCTranslate, self).__init__() super(LCTranslate, self).__init__()
self._dict["Lateral contribution"] = _translate(
"LateralContribution", "Lateral contribution"
)
self._sub_dict["long_types"] = { self._sub_dict["long_types"] = {
"ND": _translate("LateralContribution", "Not defined"), "ND": _translate("LateralContribution", "Not defined"),
"LC": _translate("LateralContribution", "Lateral contribution"), "LC": _translate("LateralContribution", "Lateral contribution"),
......
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