diff --git a/src/org/dclermonte/siba/Siba.java b/src/org/dclermonte/siba/Siba.java index 5d68980..7d2ffa4 100644 --- a/src/org/dclermonte/siba/Siba.java +++ b/src/org/dclermonte/siba/Siba.java @@ -32,7 +32,6 @@ import org.slf4j.LoggerFactory; * This class Siba stands for Simple Backup. This is the main class. * * - * @param args */ public class Siba { diff --git a/src/org/dclermonte/siba/cli/SibaCLI.java b/src/org/dclermonte/siba/cli/SibaCLI.java index 102f986..91f9efb 100644 --- a/src/org/dclermonte/siba/cli/SibaCLI.java +++ b/src/org/dclermonte/siba/cli/SibaCLI.java @@ -182,6 +182,9 @@ public class SibaCLI } } + /** + * + */ public static void sibaCLIException() { // Set default CLI catch. diff --git a/src/org/dclermonte/siba/gui/AboutDialog.java b/src/org/dclermonte/siba/gui/AboutDialog.java index a23239e..c4a4c51 100644 --- a/src/org/dclermonte/siba/gui/AboutDialog.java +++ b/src/org/dclermonte/siba/gui/AboutDialog.java @@ -29,7 +29,6 @@ import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; -import java.net.URL; import java.util.Locale; import javax.swing.Box; @@ -120,8 +119,7 @@ public class AboutDialog extends JDialog { resource = "/org/dclermonte/siba/gui/about_en.html"; } - URL url = AboutDialog.class.getResource(resource); - txtpnSimpleBackupDveloppeur.setText(SibaUtils.readResource(resource, url)); + txtpnSimpleBackupDveloppeur.setText(SibaUtils.readResource(resource)); panel.add(txtpnSimpleBackupDveloppeur); { JLabel lblNewLabel = new JLabel(""); diff --git a/src/org/dclermonte/siba/gui/SibaGUI.java b/src/org/dclermonte/siba/gui/SibaGUI.java index cfaa5df..7f73296 100644 --- a/src/org/dclermonte/siba/gui/SibaGUI.java +++ b/src/org/dclermonte/siba/gui/SibaGUI.java @@ -70,7 +70,7 @@ public class SibaGUI /** * Launch the application. */ - private Locale locale; + private BackupPanel backupPanel; private CheckPanel checkPanel; @@ -85,6 +85,7 @@ public class SibaGUI public SibaGUI() throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException, SibaException { + final Locale locale; // Set default GUI catch. Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { @@ -143,9 +144,9 @@ public class SibaGUI logger.debug("Activated lookAndFeel: {} ", UIManager.getLookAndFeel().getName()); // Set default locale. - this.locale = Locale.getDefault(); - updateLanguage(this.locale); - logger.debug(this.locale.getDisplayLanguage()); + locale = Locale.getDefault(); + updateLanguage(locale); + logger.debug(locale.getDisplayLanguage()); initialize(); } @@ -287,24 +288,6 @@ public class SibaGUI mnNewMenu.add(mntmMenuItemAbout); } - /** - * This method set the local language. - */ - public final void updateLanguage(final Locale source) - { - // Change JVM default locale. - java.util.Locale.setDefault(source); - - // Change LookAndFeel default locale. - javax.swing.UIManager.getDefaults().setDefaultLocale(source); - - // Change new component default locale. - javax.swing.JComponent.setDefaultLocale(source); - - // - ResourceBundle.clearCache(); - } - /** * This method launch the GUI. */ @@ -335,4 +318,22 @@ public class SibaGUI }); } + /** + * This method set the local language. + */ + public static void updateLanguage(final Locale source) + { + // Change JVM default locale. + java.util.Locale.setDefault(source); + + // Change LookAndFeel default locale. + javax.swing.UIManager.getDefaults().setDefaultLocale(source); + + // Change new component default locale. + javax.swing.JComponent.setDefaultLocale(source); + + // + ResourceBundle.clearCache(); + } + } diff --git a/src/org/dclermonte/siba/model/SibaUtils.java b/src/org/dclermonte/siba/model/SibaUtils.java index 017c7bc..13c422e 100644 --- a/src/org/dclermonte/siba/model/SibaUtils.java +++ b/src/org/dclermonte/siba/model/SibaUtils.java @@ -228,11 +228,13 @@ public class SibaUtils * @return * @throws IOException */ - public static String readResource(final String resource, final URL url) throws IOException + public static String readResource(final String resource) throws IOException { String result; - result = IOUtils.toString(url, (String) null); + final String DEFAULT_CHARSET = "UTF-8"; + URL url = SibaUtils.class.getResource(resource); + result = IOUtils.toString(url, DEFAULT_CHARSET); return result; }