Skip to content

Commit

Permalink
Merge pull request #610 from yermak/development
Browse files Browse the repository at this point in the history
Fixed missing locales error
  • Loading branch information
yermak authored Jun 21, 2024
2 parents 0d0efd5 + bda5c1e commit 435d677
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,16 @@ public static void checkNewVersion() {
}

private ResourceBundle getBundleWithFallback(Locale locale) {
ResourceBundle bundle = null;
ResourceBundle.Control control = ResourceBundle.Control.getControl(ResourceBundle.Control.FORMAT_DEFAULT);
return ResourceBundle.getBundle("locales/messages", locale, control);
try {
bundle = ResourceBundle.getBundle("locales/messages", locale, control);
} catch (MissingResourceException e) {
logger.error("Error getBundle", e);
}
return bundle != null ? bundle : ResourceBundle.getBundle("locales/messages", new Locale("en"), control);
}

@Override
public void start(Stage stage) {
Parent root;
Expand All @@ -88,7 +95,7 @@ public void start(Stage stage) {
root = FXMLLoader.load(resource, bundle);

Scene scene = new Scene(root);
stage.setTitle(Version.getVersionString());
stage.setTitle("AudioBookConverter-"+Version.getVersionString());
stage.setScene(scene);
Screen primary = Screen.getPrimary();
stage.setMinHeight(primary.getVisualBounds().getHeight() * 0.7);
Expand Down

0 comments on commit 435d677

Please sign in to comment.