Changement de langue
This commit is contained in:
parent
892dd6da73
commit
05c2b496a2
@ -42,7 +42,7 @@ public class MenuController implements Initializable{
|
|||||||
|
|
||||||
System.out.println("Passage à l'écran de choix des joueurs");
|
System.out.println("Passage à l'écran de choix des joueurs");
|
||||||
final URL fxmlURL = getClass().getResource("/ihm/ressources/Choix_joueur.fxml");
|
final URL fxmlURL = getClass().getResource("/ihm/ressources/Choix_joueur.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);
|
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||||
AnchorPane pane = fxmlLoader.load();
|
AnchorPane pane = fxmlLoader.load();
|
||||||
Scene scene = new Scene(pane);
|
Scene scene = new Scene(pane);
|
||||||
@ -60,7 +60,7 @@ public class MenuController implements Initializable{
|
|||||||
|
|
||||||
System.out.println("Passage à l'écran des paramètres");
|
System.out.println("Passage à l'écran des paramètres");
|
||||||
final URL fxmlURL = getClass().getResource("/ihm/ressources/parametre.fxml");
|
final URL fxmlURL = getClass().getResource("/ihm/ressources/parametre.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);
|
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||||
Pane pane = fxmlLoader.load();
|
Pane pane = fxmlLoader.load();
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ public class MenuController implements Initializable{
|
|||||||
EffetSonore.playSoundEffect(fileSound1);
|
EffetSonore.playSoundEffect(fileSound1);
|
||||||
System.out.println("Passage à l'écran des règles");
|
System.out.println("Passage à l'écran des règles");
|
||||||
final URL fxmlURL = getClass().getResource("/ihm/ressources/Regles.fxml");
|
final URL fxmlURL = getClass().getResource("/ihm/ressources/Regles.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);
|
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||||
AnchorPane pane = fxmlLoader.load();
|
AnchorPane pane = fxmlLoader.load();
|
||||||
Scene scene = new Scene(pane);
|
Scene scene = new Scene(pane);
|
||||||
|
@ -26,7 +26,7 @@ public class MenuJoueurController implements Initializable{
|
|||||||
public void changeZoneToScrollPaneJoueur(MouseEvent me) throws IOException {
|
public void changeZoneToScrollPaneJoueur(MouseEvent me) throws IOException {
|
||||||
|
|
||||||
final URL fxmlURL = getClass().getResource("/ihm/ressources/ScrollPaneJoueur.fxml");
|
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);
|
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||||
AnchorPane bp = fxmlLoader.load();
|
AnchorPane bp = fxmlLoader.load();
|
||||||
ImageView iv = ((ImageView)me.getSource());
|
ImageView iv = ((ImageView)me.getSource());
|
||||||
|
@ -28,6 +28,7 @@ public class ParametreController implements Initializable {
|
|||||||
private CheckBox clair;
|
private CheckBox clair;
|
||||||
@FXML
|
@FXML
|
||||||
private ComboBox<String> langues;
|
private ComboBox<String> langues;
|
||||||
|
public static Locale LaLangue = Locale.FRANCE;
|
||||||
public static boolean cbMusiqueCoche = false; // verifi si la checbox musical est coche
|
public static boolean cbMusiqueCoche = false; // verifi si la checbox musical est coche
|
||||||
public static boolean cbSonCoche = false;
|
public static boolean cbSonCoche = false;
|
||||||
public static boolean cbClair = false;
|
public static boolean cbClair = false;
|
||||||
@ -63,6 +64,12 @@ public class ParametreController implements Initializable {
|
|||||||
|
|
||||||
InputStream fileSound1 = getClass().getResourceAsStream("/ihm/ressources/musique/BEEP1.wav");
|
InputStream fileSound1 = getClass().getResourceAsStream("/ihm/ressources/musique/BEEP1.wav");
|
||||||
|
|
||||||
|
if(langues.getValue()=="Anglais") {
|
||||||
|
LaLangue=Locale.ENGLISH;
|
||||||
|
}
|
||||||
|
else if(langues.getValue()=="Français") {
|
||||||
|
LaLangue=Locale.FRANCE;
|
||||||
|
}
|
||||||
//Pour la musique
|
//Pour la musique
|
||||||
if (fileMusique!=null) {
|
if (fileMusique!=null) {
|
||||||
|
|
||||||
@ -138,7 +145,7 @@ public class ParametreController implements Initializable {
|
|||||||
|
|
||||||
// Quitter les paramètres
|
// Quitter les paramètres
|
||||||
final URL fxmlURL = getClass().getResource("/ihm/ressources/Menu.fxml");
|
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);
|
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||||
Pane pane = fxmlLoader.load();
|
Pane pane = fxmlLoader.load();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user