trad: Add some message window traduction.

compare_results
Pierre-Antoine Rouby 2024-09-23 14:30:56 +02:00
parent 6a3bb38dbc
commit e7c93602a1
4 changed files with 77 additions and 9 deletions

View File

@ -496,6 +496,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
self.update()
def close_model(self):
if not self.dialog_close(cancel=True):
return
self._study = None
self.update_enable_action()
self.conf.set_close_correctly()
@ -745,15 +748,16 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
##################
def msg_select_reach(self):
self.message_box("Please select a reach",
"Geometry edition need a reach selected "
"into river network window to work on it")
self.message_box(
self._trad["mb_select_reach_title"],
self._trad["mb_select_reach_msg"]
)
def dialog_reopen_study(self):
dlg = QMessageBox(self)
dlg.setWindowTitle("Last open study")
dlg.setText("Do you want to open again the last open study?")
dlg.setWindowTitle(self._trad["mb_last_open_title"])
dlg.setText(self._trad["mb_last_open_msg"])
opt = QMessageBox.Cancel | QMessageBox.Ok # | QMessageBox.Open
dlg.setStandardButtons(opt)
@ -793,9 +797,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
def dialog_close(self, cancel=True):
dlg = QMessageBox(self)
dlg.setWindowTitle("Close PAMHYR without saving study")
dlg.setText("Do you want to save current study before PAMHYR close ?")
opt = QMessageBox.Save | QMessageBox.Ignore
dlg.setWindowTitle(self._trad["mb_close_title"])
dlg.setText(self._trad["mb_close_msg"])
opt = QMessageBox.Save | QMessageBox.Close
if cancel:
opt |= QMessageBox.Cancel
@ -807,7 +811,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
if res == QMessageBox.Save:
self.save_study()
return True
elif res == QMessageBox.Ignore:
elif res == QMessageBox.Close:
return True
elif res == QMessageBox.Cancel:
return False

View File

@ -149,6 +149,9 @@ class WindowToolKit(object):
msg.setInformativeText(informative_text)
msg.setWindowTitle(window_title)
msg.findChild(QLabel, "qt_msgbox_label")\
.setFixedWidth(384)
msg.exec_()

View File

@ -102,3 +102,29 @@ class MainTranslate(UnitTranslate):
self._dict["active_window"] = _translate(
"MainWindow", "Enable this window"
)
# Message box
self._dict["mb_select_reach_title"] = _translate(
"MainWindow", "Please select a reach"
)
self._dict["mb_select_reach_msg"] = _translate(
"MainWindow",
"This edition window need a reach selected "
"into the river network to work on it"
)
self._dict["mb_last_open_title"] = _translate(
"MainWindow", "Last open study"
)
self._dict["mb_last_open_msg"] = _translate(
"MainWindow",
"Do you want to open again the last open study?"
)
self._dict["mb_close_title"] = _translate(
"MainWindow", "Close without saving study"
)
self._dict["mb_close_msg"] = _translate(
"MainWindow",
"Do you want to save current study before closing it?"
)

View File

@ -2481,6 +2481,41 @@
<source>Data</source>
<translation>Données</translation>
</message>
<message>
<location filename="../View/Translate.py" line="107"/>
<source>Please select a reach</source>
<translation>Veuillez sélectionner un bief</translation>
</message>
<message>
<location filename="../View/Translate.py" line="110"/>
<source>Geometry edition need a reach selected into the river network to work on it</source>
<translation type="obsolete">L&apos;édition de la géométrie nécessite un bief sélectionné dans le réseau fluvial pour pouvoir travailler dessus</translation>
</message>
<message>
<location filename="../View/Translate.py" line="116"/>
<source>Last open study</source>
<translation>Dernière étude ouverte</translation>
</message>
<message>
<location filename="../View/Translate.py" line="119"/>
<source>Do you want to open again the last open study?</source>
<translation>Voulez-vous rouvrir la dernière étude ?</translation>
</message>
<message>
<location filename="../View/Translate.py" line="110"/>
<source>This edition window need a reach selected into the river network to work on it</source>
<translation>Cette fenêtre d&apos;édition a besoin d&apos;un bief sélectionné dans le réseau pour travailler dessus</translation>
</message>
<message>
<location filename="../View/Translate.py" line="124"/>
<source>Close without saving study</source>
<translation>Fermer sans sauvegarder l&apos;étude</translation>
</message>
<message>
<location filename="../View/Translate.py" line="127"/>
<source>Do you want to save current study before closing it?</source>
<translation>Souhaitez-vous sauvegarder l&apos;étude en cours avant de la fermer ?</translation>
</message>
</context>
<context>
<name>MainWindow_reach</name>