From cee8e76215c8d3b8f3938949e64e22d2cf402ea3 Mon Sep 17 00:00:00 2001 From: nawfe Date: Thu, 14 May 2020 13:20:32 +0200 Subject: [PATCH] Traduction dans les controller --- src/ihm/controller/MenuJoueurController.java | 2 +- .../controller/PiocherVisionController.java | 2 +- src/ihm/controller/PlateauController.java | 24 +++++++++---------- src/ihm/controller/PlateauControllerTest.java | 4 ++-- src/ihm/controller/PlayersController.java | 4 ++-- src/ihm/controller/ReglesControlleur.java | 2 +- .../ScrollPaneJoueurController.java | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/ihm/controller/MenuJoueurController.java b/src/ihm/controller/MenuJoueurController.java index d8fd90d..9a6527a 100644 --- a/src/ihm/controller/MenuJoueurController.java +++ b/src/ihm/controller/MenuJoueurController.java @@ -26,7 +26,7 @@ public class MenuJoueurController implements Initializable{ public void changeZoneToScrollPaneJoueur(MouseEvent me) throws IOException { final URL fxmlURL = getClass().getResource("/ihm/ressources/ScrollPaneJoueur.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); AnchorPane bp = fxmlLoader.load(); ImageView iv = ((ImageView)me.getSource()); diff --git a/src/ihm/controller/PiocherVisionController.java b/src/ihm/controller/PiocherVisionController.java index ab90dc9..56905cf 100644 --- a/src/ihm/controller/PiocherVisionController.java +++ b/src/ihm/controller/PiocherVisionController.java @@ -22,7 +22,7 @@ public class PiocherVisionController implements Initializable{ public void voirCarte(MouseEvent mouseEvent) throws IOException{ final URL fxmlURL = getClass().getResource("/ihm/ressources/jouer_Son_Tour_donner_vision.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane pane = fxmlLoader.load(); diff --git a/src/ihm/controller/PlateauController.java b/src/ihm/controller/PlateauController.java index d80c1af..d136d6e 100644 --- a/src/ihm/controller/PlateauController.java +++ b/src/ihm/controller/PlateauController.java @@ -204,7 +204,7 @@ public class PlateauController implements Initializable { public void seReveler(int numJoueur) throws IOException { System.out.println(listJoueur.get(numJoueur).getNom() + " se revele"); final URL fxmlURL = getClass().getResource("/ihm/ressources/Reveler_son_identite.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Parent root = fxmlLoader.load(); @@ -232,7 +232,7 @@ public class PlateauController implements Initializable { public void consulterSaCarte(int numJoueur) throws IOException { System.out.println(listJoueur.get(numJoueur).getNom() + " consulte sa carte"); final URL fxmlURL = getClass().getResource("/ihm/ressources/afficher_carte_perso.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Parent root = fxmlLoader.load(); @@ -267,7 +267,7 @@ public class PlateauController implements Initializable { public void afficherChoisir(Joueur j, Contexte contexte) throws IOException { final URL fxmlURL = getClass().getResource("/ihm/ressources/choisirBoolean.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane root = (Pane) fxmlLoader.load(); this.cb = fxmlLoader.getController(); @@ -292,7 +292,7 @@ public class PlateauController implements Initializable { public void afficherChoisirEquipementVole(Joueur j, List lce) throws IOException { final URL fxmlURL = getClass().getResource("/ihm/ressources/Jouer_tour(2a)voler_equipement.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane root = (Pane) fxmlLoader.load(); this.ce = fxmlLoader.getController(); @@ -307,7 +307,7 @@ public class PlateauController implements Initializable { public void afficherAlterationVie(Joueur j, int valeur) throws IOException, InterruptedException { final URL fxmlURL = getClass().getResource("/ihm/ressources/AlterationVieZJ.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane root = (Pane) fxmlLoader.load(); AlterationVieZJ avzj = fxmlLoader.getController(); @@ -336,7 +336,7 @@ public class PlateauController implements Initializable { public void afficherLieu(Joueur j) throws IOException { final URL fxmlURL = getClass().getResource("/ihm/ressources/LieuZJ.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane root = (Pane) fxmlLoader.load(); LieuZJ lzj = fxmlLoader.getController(); @@ -361,7 +361,7 @@ public class PlateauController implements Initializable { public void afficherChoisirJoueur(Joueur j, List joueurs, Contexte contexte) throws IOException { final URL fxmlURL = getClass().getResource("/ihm/ressources/choixJoueurAttq.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane root = (Pane) fxmlLoader.load(); @@ -391,7 +391,7 @@ public class PlateauController implements Initializable { public void afficherPiocher(Joueur j) throws IOException { final URL fxmlURL = getClass().getResource("/ihm/ressources/Jouer_tour(2b)piocher_carte.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane root = (Pane)fxmlLoader.load(); @@ -402,7 +402,7 @@ public class PlateauController implements Initializable { public void afficherEffet(Joueur j) throws IOException { final URL fxmlURL = getClass().getResource("/ihm/ressources/Jouer_tour(2b)piocher_carte.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane root = (Pane)fxmlLoader.load(); @@ -461,7 +461,7 @@ public class PlateauController implements Initializable { System.out.println("Jeu en pause ..."); final URL fxmlURL = getClass().getResource("/ihm/ressources/Pause.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane root = (Pane) fxmlLoader.load(); @@ -491,7 +491,7 @@ public class PlateauController implements Initializable { public void close() throws IOException { final URL fxmlURL = PlateauController.class.getResource("/ihm/ressources/Menu.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane pane = fxmlLoader.load(); rootPane.getChildren().setAll(pane); @@ -522,7 +522,7 @@ public class PlateauController implements Initializable { public void afficherVision(Joueur j, CartePiochable cartePiochable) throws IOException { final URL fxmlURL = getClass().getResource("/ihm/ressources/RecevoirCarte.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane root = (Pane) fxmlLoader.load(); RecevoirCarte lzj = fxmlLoader.getController(); diff --git a/src/ihm/controller/PlateauControllerTest.java b/src/ihm/controller/PlateauControllerTest.java index 910ebe6..9348500 100644 --- a/src/ihm/controller/PlateauControllerTest.java +++ b/src/ihm/controller/PlateauControllerTest.java @@ -40,7 +40,7 @@ public class PlateauControllerTest implements Initializable { Pane p; try { final URL fxmlURL = getClass().getResource("/ihm/ressources/MenuJoueur.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); p = fxmlLoader.load(); @@ -165,7 +165,7 @@ public class PlateauControllerTest implements Initializable { public boolean choisir(Joueur j) throws IOException { final URL fxmlURL = getClass().getResource("/ihm/ressources/choisirBoolean.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Parent root = fxmlLoader.load(); diff --git a/src/ihm/controller/PlayersController.java b/src/ihm/controller/PlayersController.java index c70d944..cbf75ab 100644 --- a/src/ihm/controller/PlayersController.java +++ b/src/ihm/controller/PlayersController.java @@ -189,7 +189,7 @@ public class PlayersController implements Initializable{ gj.setConfiguration(new Configuration(this.joueurs)); final URL fxmlURL = getClass().getResource("/ihm/ressources/PlateauTest2.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRENCH); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); AnchorPane root = fxmlLoader.load(); PlateauController pc = fxmlLoader.getController(); @@ -324,7 +324,7 @@ public class PlayersController implements Initializable{ EffetSonore.playSoundEffect(fileSound1); final URL fxmlURL = getClass().getResource("/ihm/ressources/Menu.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane pane = fxmlLoader.load(); diff --git a/src/ihm/controller/ReglesControlleur.java b/src/ihm/controller/ReglesControlleur.java index 0559d08..bd96fec 100644 --- a/src/ihm/controller/ReglesControlleur.java +++ b/src/ihm/controller/ReglesControlleur.java @@ -100,7 +100,7 @@ public class ReglesControlleur implements Initializable { EffetSonore.playSoundEffect(fileSound1); System.out.println("Retour au Menu"); final URL fxmlURL = getClass().getResource("/ihm/ressources/Menu.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); AnchorPane pane = fxmlLoader.load(); Scene scene = new Scene(pane); diff --git a/src/ihm/controller/ScrollPaneJoueurController.java b/src/ihm/controller/ScrollPaneJoueurController.java index 1762715..676792e 100644 --- a/src/ihm/controller/ScrollPaneJoueurController.java +++ b/src/ihm/controller/ScrollPaneJoueurController.java @@ -29,7 +29,7 @@ public class ScrollPaneJoueurController implements Initializable{ public void changeZoneJoueurToMenuJoueur(MouseEvent me) throws IOException { final URL fxmlURL = getClass().getResource("/ihm/ressources/MenuJoueur.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRENCH); + final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); BorderPane bp = fxmlLoader.load(); ImageView iv = ((ImageView)me.getSource());