diff --git a/src/lang/constant_string.py b/src/lang/constant_string.py new file mode 100644 index 0000000000000000000000000000000000000000..b599389a274977e08988bc12b31ced977b4422e2 --- /dev/null +++ b/src/lang/constant_string.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- + +from PyQt5.QtCore import QCoreApplication + +_translate = QCoreApplication.translate + + +# -------------------- A -------------------- + + +# -------------------- B -------------------- + + +# -------------------- C -------------------- + + +# -------------------- D -------------------- + + +# -------------------- E -------------------- + + +# -------------------- F -------------------- + + +# -------------------- G -------------------- + + +# -------------------- H -------------------- + + +# -------------------- I -------------------- + + +# -------------------- J -------------------- + + +# -------------------- K -------------------- + + +# -------------------- L -------------------- + + +# -------------------- M -------------------- + + +# -------------------- N -------------------- + + +# -------------------- O -------------------- + + +# -------------------- P -------------------- + + +# -------------------- Q -------------------- + + +# -------------------- R -------------------- + + +# -------------------- S -------------------- + + +# -------------------- T -------------------- + + +# -------------------- U -------------------- + + +# -------------------- V -------------------- + + +# -------------------- W -------------------- + + +# -------------------- X -------------------- + + +# -------------------- Y -------------------- + + +# -------------------- Z -------------------- diff --git a/src/lang/create_ts.sh b/src/lang/create_ts.sh new file mode 100755 index 0000000000000000000000000000000000000000..c617d22a5f1692101dc0046790defa7756aa7f0d --- /dev/null +++ b/src/lang/create_ts.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +SOURCES=$(find ../ -name "*.py") +FROM=$(find ../ -name "*.ui") + +LANG="fr de" + +for l in $LANG +do + pylupdate5 $SOURCES $FROM -ts $l.ts +done + +for l in $LANG +do + lrelease $l.ts $l.qm +done diff --git a/src/pamhyr.py b/src/pamhyr.py index 53a99404b5baec6a7c5bc8368ca3a1a73ccca231..439872a828ac36ffc135a11765590bd056317059 100755 --- a/src/pamhyr.py +++ b/src/pamhyr.py @@ -1,8 +1,9 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import sys +import sys, os +from PyQt5.QtCore import QTranslator from PyQt5.QtWidgets import QApplication from config import Config @@ -12,6 +13,11 @@ from model.Study import Study def main(): conf = Config.load() app = QApplication(sys.argv) + + translator = QTranslator() + translator.load(os.path.dirname(__file__) + "/lang/fr.qm") + app.installTranslator(translator) + application = ApplicationWindow(conf=conf) application.show() sys.exit(app.exec_()) diff --git a/src/view/MainWindow.py b/src/view/MainWindow.py index 3f1337ed0b5597c0f650c6d7c817e298a463924b..24a70235910af9886ae981cd4ce523845c3e2bd0 100644 --- a/src/view/MainWindow.py +++ b/src/view/MainWindow.py @@ -61,6 +61,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow): self.init_callback() self.default_style() + #self.ui.retranslateUi() def enable_actions(self, action:str, enable:bool): """Enable of disable an action componant diff --git a/src/view/ui/MainWindow.ui b/src/view/ui/MainWindow.ui index e9f8b691282687bc5487b4fd4631d26d5a0660e0..8ccb78f6ae455c310dfde4995c83cf068dd34aa9 100644 --- a/src/view/ui/MainWindow.ui +++ b/src/view/ui/MainWindow.ui @@ -615,63 +615,6 @@ </font> </property> </action> - <action name="action_plot_water_line"> - <property name="text"> - <string>Ligne d'eau</string> - </property> - </action> - <action name="actionLigne_d_eau_finale"> - <property name="text"> - <string>Ligne d'eau finale</string> - </property> - </action> - <action name="actionLigne_d_eau_enveloppe"> - <property name="text"> - <string>Ligne d'eau enveloppe</string> - </property> - </action> - <action name="actionVitesse_Pk_t_fix"> - <property name="text"> - <string>Vitesse(Pk) à t fixé</string> - </property> - </action> - <action name="actionVitesse_t_Pk_fix"> - <property name="text"> - <string>Vitesse(t) à Pk fixé</string> - </property> - </action> - <action name="actionCharge_hydraulique_Pk_t_fix"> - <property name="text"> - <string>Charge hydraulique(Pk) à t fixé</string> - </property> - </action> - <action name="actionCharge_hydraulique_t_Pk_fix"> - <property name="text"> - <string>Charge hydraulique(t) à Pk fixé</string> - </property> - <property name="font"> - <font> - <weight>75</weight> - <bold>true</bold> - </font> - </property> - </action> - <action name="actionVoir_l_animation_MAGE"> - <property name="text"> - <string>Voir l'animation (MAGE)</string> - </property> - </action> - <action name="actionAutres_r_sulats_MAGE"> - <property name="text"> - <string>Autres résulats MAGE</string> - </property> - <property name="font"> - <font> - <weight>75</weight> - <bold>true</bold> - </font> - </property> - </action> <action name="action_map_current_reach"> <property name="text"> <string>Map current reach</string> @@ -758,7 +701,7 @@ <string>Run solver</string> </property> <property name="toolTip"> - <string>Lancer le solveur pour réaliser une simulation</string> + <string>Run solver on current study</string> </property> <property name="shortcut"> <string>Ctrl+X</string> @@ -791,7 +734,7 @@ <string>Run external meshing tool</string> </property> <property name="toolTip"> - <string>Lancer le mailleur externe sur la géométrie du bief courant</string> + <string>Run meshing tool on current reach geometry</string> </property> </action> <action name="action_toolBar_listing"> @@ -806,7 +749,7 @@ <string>Display simulation listing</string> </property> <property name="toolTip"> - <string>Aficher les listings de la simulation courante</string> + <string>Display current simulation listing</string> </property> </action> <action name="action_toolBar_network"> @@ -818,7 +761,7 @@ <string>River network</string> </property> <property name="toolTip"> - <string>Open river network edition</string> + <string>Edit river network</string> </property> </action> <action name="action_toolBar_geometry"> @@ -830,7 +773,7 @@ <string>Geometry</string> </property> <property name="toolTip"> - <string>Open geometry edition</string> + <string>Edit reach geometry</string> </property> </action> <action name="action_toolBar_mesh"> @@ -861,7 +804,7 @@ <string>Lateral contribution</string> </property> <property name="toolTip"> - <string>Ouvrir l'éditeur des Apports Latéraux Distribués</string> + <string>Edit lateral contribution</string> </property> </action> <action name="action_toolBar_spills"> @@ -869,7 +812,7 @@ <string>Spills</string> </property> <property name="toolTip"> - <string>Ouvrir l'éditeur des Déversements Latéraux</string> + <string>Edit lateral spills</string> </property> </action> <action name="action_toolBar_sections"> @@ -877,7 +820,7 @@ <string>Sections</string> </property> <property name="toolTip"> - <string>Ouvrir l'éditeur des tronçons pour les frottements et Apports Latéraux</string> + <string>Edit section frictions and lateral contributions</string> </property> </action> <action name="action_toolBar_frictions"> @@ -885,7 +828,7 @@ <string>Frictions</string> </property> <property name="toolTip"> - <string>Ouvrir l'éditeur des frottements au fond</string> + <string>Edit friction at the bottom</string> </property> </action> <action name="action_toolBar_building"> @@ -893,7 +836,7 @@ <string>Building</string> </property> <property name="toolTip"> - <string>Ouvrir l'éditeur des ouvrages (seuils, vannes, etc.), singularités et pompes</string> + <string>Edit building (valve, ...), singularity and pump</string> </property> </action> <action name="action_menu_edit">