Skip to content

Commit

Permalink
Configures language LCID on jpass.properties file
Browse files Browse the repository at this point in the history
  • Loading branch information
edimoral committed Mar 4, 2024
1 parent 16dbcf8 commit 52bd004
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/main/config/jpass.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ date.format=yyyy-MM-dd
# Directory to be used for file chooser dialogs. (default: ./)
# Leave that property empty to use the system default directory.
file.chooser.directory=./

# Locale ID to set the program language
language.languageSetting=en-US
6 changes: 3 additions & 3 deletions src/main/java/jpass/ui/JPassFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
*/
public final class JPassFrame extends JFrame {

private static ResourceBundle localizedMessages = null;
private static ResourceBundle localizedMessages;
private static final Logger LOG = Logger.getLogger(JPassFrame.class.getName());

private static JPassFrame instance;
Expand Down Expand Up @@ -232,8 +232,8 @@ public static JPassFrame getInstance() {

public static synchronized JPassFrame getInstance(String fileName) {
if (instance == null) {
Locale locale = new Locale("es", "MX");
instance = new JPassFrame(fileName, locale);
String languageTag = Configuration.getInstance().get("language.languageSetting", "en-US");
instance = new JPassFrame(fileName, Locale.forLanguageTag(languageTag));
}
return instance;
}
Expand Down

0 comments on commit 52bd004

Please sign in to comment.