From 6394be7d1f5de27ab4829d40ab09a195429eb004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20Sch=C3=BClein?= Date: Fri, 25 Aug 2023 01:09:31 +0200 Subject: [PATCH 1/2] updated release notes in Java --- README.md | 2 ++ .../java/de/paginagmbh/epubchecker/PaginaEPUBChecker.java | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 14f2178..4501977 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,8 @@ Release the app Releasing a new version requires the Mac App to be codesigned and notarized. This can be done from the maven packaging process or via GitHub Actions CI on the `main` branch. The additional maven step will run a bash script (`src/build/mac-release.sh`) to codesign and notarize the Mac App with our private Apple Developer Certificate. Therefore, this step will only work on our systems or in GitHub Actions CI. +Before the release the version number and release notes should be adjusted in *src/main/java/de/paginagmbh/epubchecker/PaginaEPUBChecker.java*. + ### Release requirements * macOS 10.14+ diff --git a/src/main/java/de/paginagmbh/epubchecker/PaginaEPUBChecker.java b/src/main/java/de/paginagmbh/epubchecker/PaginaEPUBChecker.java index 28ed0de..80718a3 100644 --- a/src/main/java/de/paginagmbh/epubchecker/PaginaEPUBChecker.java +++ b/src/main/java/de/paginagmbh/epubchecker/PaginaEPUBChecker.java @@ -26,10 +26,10 @@ public class PaginaEPUBChecker { // +++++++++++++++++++++++++ DON'T FORGET TO UPDATE EVERYTIME ++++++++++++++++++ // - public static final String PROGRAMVERSION = "2.0.9"; - public static final String VERSIONDATE = "26.05.2023"; + public static final String PROGRAMVERSION = "2.0.10"; + public static final String VERSIONDATE = "2023-08-28"; public static final String PROGRAMRELEASE = ""; // "" or "Beta" - public static final String RELEASENOTES = "-upgrade EPUBCheck to v.5.0.1"; + public static final String RELEASENOTES = "• Upgrade EPUBCheck to v5.1.0\n• Restored compatibility with newer Java versions\n• Internal improvements to the release and code signing process"; // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // From 2d37c97702b484035f92d7b6050d936cf6b79cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20Sch=C3=BClein?= Date: Fri, 25 Aug 2023 01:30:30 +0200 Subject: [PATCH 2/2] fixed version number --- README.md | 256 ++++++------ pom.xml | 2 +- .../epubchecker/PaginaEPUBChecker.java | 372 +++++++++--------- 3 files changed, 315 insertions(+), 315 deletions(-) diff --git a/README.md b/README.md index 4501977..a256b2c 100644 --- a/README.md +++ b/README.md @@ -1,128 +1,128 @@ -pagina EPUB-Checker -=================== - -![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/paginagmbh/EPUB-Checker/maven-test-build.yml?label=Maven%20CI%20Tests) ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/paginagmbh/EPUB-Checker/release.yml?label=Release%20CI) - -Standalone “EPUBCheck” application for Windows, macOS and Linux. - -With the pagina EPUB-Checker one can easily validate eBooks in the EPUB format. The test mechanisms of the EPUB-Checker are based on the official open-source [EPUBCheck](https://github.com/w3c/epubcheck) EPUB validator. - - -Features --------- - -pagina EPUB-Checker wraps up this tool and offers some additional features like: - -* Graphical user interface -* Drag & drop EPUB to validate -* Ability to validate expanded (unzipped) EPUBs - * Expanded folders are automatically zipped up to an EPUB file upon validation - * The generated EPUB file will be saved if it is valid -* Localized GUI and errors and warnings: - * English - * German - * French - * Spanish - * Japanese - * Portuguese (Brazil) - * Russian (messages incomplete) - * Dutch (messages only, english GUI) - * Czech (GUI only, english messages) - * Traditional Chinese (Taiwan) (GUI only, english messages) - * Turkish (GUI only, english messages) - * Danish -* Accessibility options: The application is usable with screen readers, offers a high contrast mode, and allows users to increase (or decrease) the font size. - -pagina EPUB-Checker doesn't need to be installed and therefore works on portable USB devices as well as on computers with restricted rights. - - -Download --------- - -Please visit our website https://www.pagina.gmbh/produkte/epub-checker/ to download the Windows *.exe* file, the Mac *.app* or the Linux *.jar*. - -This is just the source code repository. You won’t find any pre-build binaries here... - - -License information -------------------- - -Our app and code and all the java sources in `de.paginagmbh.*` are licensed under the terms of the [GNU General Public License v2.0](http://choosealicense.com/licenses/gpl-2.0/) unless the code comments specify the contrary. - -We use the following Java libraries to build our GUI wrapper around *EPUBCheck*: -* [EPUBCheck](https://github.com/w3c/epubcheck) 4.2.6 (*3-Clause BSD License*) -* [JSON RPC](http://mvnrepository.com/artifact/com.metaparadigm/json-rpc/1.0) 1.0 (*Apache License 2.0*) -* [Apple Java Extensions](http://mvnrepository.com/artifact/com.apple/AppleJavaExtensions/1.4) 1.4 (*Apple License*) - -To build the EPUB-Checker app, we use the following tools and libraries (among other Maven tools): -* [Jarbundler](https://github.com/UltraMixer/JarBundler) (*Apache License v2.0*) -* [launch4j](http://launch4j.sourceforge.net/) (*BSD license / MIT License*) -* [universalJavaApplicationStub](https://github.com/tofi86/universalJavaApplicationStub) (*MIT License*) -* [electron-installer-dmg](https://github.com/electron-userland/electron-installer-dmg) (*Apache License v2.0*) -* [gon](https://github.com/mitchellh/gon) (*MIT License*) - - -Build the app -------------- - -In order to build the Linux JAR, the Mac App and the Windows EXE files you just have to run - -```sh -mvn clean package -``` - -from the root directory of this project. - -This will build the executables but skip the macOS specific codesigning process by default. - - -### Build requirements - -* Java/JDK 8+ -* Maven 3.5+ - - -Release the app ---------------- - -Releasing a new version requires the Mac App to be codesigned and notarized. This can be done from the maven packaging process or via GitHub Actions CI on the `main` branch. The additional maven step will run a bash script (`src/build/mac-release.sh`) to codesign and notarize the Mac App with our private Apple Developer Certificate. Therefore, this step will only work on our systems or in GitHub Actions CI. - -Before the release the version number and release notes should be adjusted in *src/main/java/de/paginagmbh/epubchecker/PaginaEPUBChecker.java*. - -### Release requirements - -* macOS 10.14+ -* Java/JDK 8 -* Maven 3.5+ -* NodeJS + npm -* Homebrew - -*App codesigning* - -Codesigning is done with the default macOS `codesign` utility - -*App notarization* - -App notarization is done with [gon](https://github.com/mitchellh/gon), an excellent utility for this job. It will be installed via HomeBrew if it’s missing. - -To be able to submit the App for notarization, you need to copy `src/build/gon-dmg-config.template.json` to `src/build/gon-dmg-config.json` and fill the `apple_id` credentials. - -*DiskImage creation* - -DiskImage creation is done with the NodeJS utility [electron-installer-dmg](https://github.com/electron-userland/electron-installer-dmg). It will be installed via NPM if it’s missing. - -### Build the release locally - -To build the *.jar*s, the Windows *.exe* and Mac *.app* and to run the Mac-App codesigning and notarization process for distribution _locally,_ you have to enable the *skipped-by-default* maven task with: - -```sh -mvn -Dmaven.skip.macSigning=false clean package -``` - -With changes to how the generated *.jar* file is structured internally, and how Apple handles the files for the notarization, at the moment some manual steps are required to arrive at a notarized version of the application. - -### Build & release with GitHub Actions - -To build and release with GitHub Actions CI, just merge a _snapshot version_ from `development` to `main`. No need to upgrade the Maven version first or to set a git tag. Just merge to `main` and CI is doing all the hard work (as defined in `.github/workflows/release.yml`). - -The release distributables are attached to the GitHub Actions build as build artifacts and can be used for distribution on our download server. +pagina EPUB-Checker +=================== + +![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/paginagmbh/EPUB-Checker/maven-test-build.yml?label=Maven%20CI%20Tests) ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/paginagmbh/EPUB-Checker/release.yml?label=Release%20CI) + +Standalone “EPUBCheck” application for Windows, macOS and Linux. + +With the pagina EPUB-Checker one can easily validate eBooks in the EPUB format. The test mechanisms of the EPUB-Checker are based on the official open-source [EPUBCheck](https://github.com/w3c/epubcheck) EPUB validator. + + +Features +-------- + +pagina EPUB-Checker wraps up this tool and offers some additional features like: + +* Graphical user interface +* Drag & drop EPUB to validate +* Ability to validate expanded (unzipped) EPUBs + * Expanded folders are automatically zipped up to an EPUB file upon validation + * The generated EPUB file will be saved if it is valid +* Localized GUI and errors and warnings: + * English + * German + * French + * Spanish + * Japanese + * Portuguese (Brazil) + * Russian (messages incomplete) + * Dutch (messages only, english GUI) + * Czech (GUI only, english messages) + * Traditional Chinese (Taiwan) (GUI only, english messages) + * Turkish (GUI only, english messages) + * Danish +* Accessibility options: The application is usable with screen readers, offers a high contrast mode, and allows users to increase (or decrease) the font size. + +pagina EPUB-Checker doesn't need to be installed and therefore works on portable USB devices as well as on computers with restricted rights. + + +Download +-------- + +Please visit our website https://www.pagina.gmbh/produkte/epub-checker/ to download the Windows *.exe* file, the Mac *.app* or the Linux *.jar*. + +This is just the source code repository. You won’t find any pre-build binaries here... + + +License information +------------------- + +Our app and code and all the java sources in `de.paginagmbh.*` are licensed under the terms of the [GNU General Public License v2.0](http://choosealicense.com/licenses/gpl-2.0/) unless the code comments specify the contrary. + +We use the following Java libraries to build our GUI wrapper around *EPUBCheck*: +* [EPUBCheck](https://github.com/w3c/epubcheck) 4.2.6 (*3-Clause BSD License*) +* [JSON RPC](http://mvnrepository.com/artifact/com.metaparadigm/json-rpc/1.0) 1.0 (*Apache License 2.0*) +* [Apple Java Extensions](http://mvnrepository.com/artifact/com.apple/AppleJavaExtensions/1.4) 1.4 (*Apple License*) + +To build the EPUB-Checker app, we use the following tools and libraries (among other Maven tools): +* [Jarbundler](https://github.com/UltraMixer/JarBundler) (*Apache License v2.0*) +* [launch4j](http://launch4j.sourceforge.net/) (*BSD license / MIT License*) +* [universalJavaApplicationStub](https://github.com/tofi86/universalJavaApplicationStub) (*MIT License*) +* [electron-installer-dmg](https://github.com/electron-userland/electron-installer-dmg) (*Apache License v2.0*) +* [gon](https://github.com/mitchellh/gon) (*MIT License*) + + +Build the app +------------- + +In order to build the Linux JAR, the Mac App and the Windows EXE files you just have to run + +```sh +mvn clean package +``` + +from the root directory of this project. + +This will build the executables but skip the macOS specific codesigning process by default. + + +### Build requirements + +* Java/JDK 8+ +* Maven 3.5+ + + +Release the app +--------------- + +Releasing a new version requires the Mac App to be codesigned and notarized. This can be done from the maven packaging process or via GitHub Actions CI on the `main` branch. The additional maven step will run a bash script (`src/build/mac-release.sh`) to codesign and notarize the Mac App with our private Apple Developer Certificate. Therefore, this step will only work on our systems or in GitHub Actions CI. + +Before the release the version number and release notes should be adjusted in *src/main/java/de/paginagmbh/epubchecker/PaginaEPUBChecker.java*. + +### Release requirements + +* macOS 10.14+ +* Java/JDK 8 +* Maven 3.5+ +* NodeJS + npm +* Homebrew + +*App codesigning* + +Codesigning is done with the default macOS `codesign` utility + +*App notarization* + +App notarization is done with [gon](https://github.com/mitchellh/gon), an excellent utility for this job. It will be installed via HomeBrew if it’s missing. + +To be able to submit the App for notarization, you need to copy `src/build/gon-dmg-config.template.json` to `src/build/gon-dmg-config.json` and fill the `apple_id` credentials. + +*DiskImage creation* + +DiskImage creation is done with the NodeJS utility [electron-installer-dmg](https://github.com/electron-userland/electron-installer-dmg). It will be installed via NPM if it’s missing. + +### Build the release locally + +To build the *.jar*s, the Windows *.exe* and Mac *.app* and to run the Mac-App codesigning and notarization process for distribution _locally,_ you have to enable the *skipped-by-default* maven task with: + +```sh +mvn -Dmaven.skip.macSigning=false clean package +``` + +With changes to how the generated *.jar* file is structured internally, and how Apple handles the files for the notarization, at the moment some manual steps are required to arrive at a notarized version of the application. + +### Build & release with GitHub Actions + +To build and release with GitHub Actions CI, just merge a _snapshot version_ from `development` to `main`. No need to upgrade the Maven version first or to set a git tag. Just merge to `main` and CI is doing all the hard work (as defined in `.github/workflows/release.yml`). + +The release distributables are attached to the GitHub Actions build as build artifacts and can be used for distribution on our download server. diff --git a/pom.xml b/pom.xml index fdb2ef9..f4f5047 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ de.paginagmbh EPUB-Checker - 2.0.10 + 2.0.10-SNAPSHOT jar diff --git a/src/main/java/de/paginagmbh/epubchecker/PaginaEPUBChecker.java b/src/main/java/de/paginagmbh/epubchecker/PaginaEPUBChecker.java index 80718a3..6a99c8c 100644 --- a/src/main/java/de/paginagmbh/epubchecker/PaginaEPUBChecker.java +++ b/src/main/java/de/paginagmbh/epubchecker/PaginaEPUBChecker.java @@ -1,186 +1,186 @@ -package de.paginagmbh.epubchecker; - -import java.awt.Dimension; -import java.awt.Point; -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.ResourceBundle; - -import javax.swing.JFrame; -import javax.swing.UIManager; - - - -/** - * Checks and validates EPUB eBooks in a nice graphical user interface - * - * @author Tobias Fischer - * @copyright pagina GmbH, Tübingen - * @version 2.0.6 - * @date 2021-07-07 - */ -public class PaginaEPUBChecker { - - // +++++++++++++++++++++++++ DON'T FORGET TO UPDATE EVERYTIME ++++++++++++++++++ // - - public static final String PROGRAMVERSION = "2.0.10"; - public static final String VERSIONDATE = "2023-08-28"; - public static final String PROGRAMRELEASE = ""; // "" or "Beta" - public static final String RELEASENOTES = "• Upgrade EPUBCheck to v5.1.0\n• Restored compatibility with newer Java versions\n• Internal improvements to the release and code signing process"; - - // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // - - private static GuiManager guiManager; - - - - - /* ********************************************************************************************************** */ - - public static void main(String[] args) { - new PaginaEPUBChecker(args); - } - - public PaginaEPUBChecker(String[] args) { - - // use system proxy - System.setProperty("java.net.useSystemProxies", "true"); - - - // create a GuiManager instance - guiManager = GuiManager.getInstance(); - - - // load and set system LookAndFeel - try { - JFrame.setDefaultLookAndFeelDecorated(true); - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (Exception e) { - e.printStackTrace(); - System.exit(1); - } - - - /* init FileManager && check operating system */ - FileManager.init(); - - - // load and init GUI and its dependencies (e.g. language object, regex object, etc.) - loadAndInitGuiAndDependencies(); - - - // perform update check - new UpdateCheck(true); - - - // init mac specific event listeners; after GUI is loaded - if(FileManager.os_name.equals("mac")) { - MacOsIntegration macOsIntegration = new MacOsIntegration(); - try { - macOsIntegration.addEventHandlers(); - // store current Application object in GuiManager - guiManager.setMacOsIntegration(macOsIntegration); - - } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) { - System.out.println("ERROR: Failed to load Mac OS integration: 'About' menu or Drag&Drop features may not work as expected! Please report to the developer!"); - e.printStackTrace(); - } - } - - - // init commandLine start for windows drag'n'drop on exe icon (issue #6) - List argFiles = new ArrayList<>(); - if(args != null && args.length > 0) { - for (int i = 0; i < args.length; i++) { - argFiles.add(new File(args[i])); - } - // validate EPUB files - new EpubValidator().validate(argFiles); - } - - - // show release notes only on first run - if( ! new File(FileManager.path_FirstRunFile).exists() ) { - MessageGUI msg = new MessageGUI(); - //msg.setTitle(""); - msg.showMessage(__("Thanks for updating!") - + "


" - + __("New version %NEW_VERSION% includes these features:").replaceAll("%NEW_VERSION%", PROGRAMVERSION) - + "

" - + RELEASENOTES - + "
"); - - // write current version to FirstRun File - StringHelper.writeStringToFile(FileManager.path_FirstRunFile, String.valueOf(PROGRAMVERSION)); - } - - - // ShutdownHook to save window size and position for next startup - Runtime.getRuntime().addShutdownHook(new Thread() { - @Override public void run() { - - Dimension MainGuiDimension = guiManager.getCurrentGUI().getSize(); - Point MainGuiPosition = guiManager.getCurrentGUI().getLocation(); - - // write window dimension and position to config file - StringHelper.writeStringToFile(FileManager.path_WindowFile, (int)MainGuiDimension.getWidth() + "x" + (int)MainGuiDimension.getHeight() + "@" + (int)MainGuiPosition.getX() + "," + (int)MainGuiPosition.getY()); - } - }); - } - - - - - /* ********************************************************************************************************** */ - - public void loadAndInitGuiAndDependencies() { - - // init language object - guiManager.createNewLocalizationObject(); - Locale currentLocale = guiManager.getCurrentLocale(); - - // set the defaultLocale for epubcheck resource bundles - if(guiManager.getCurrentLocalizationObject().getAvailableLanguages().containsKey(currentLocale)) { - Locale.setDefault(currentLocale); - } else { - /* don't fall back to en_US but use standard default locale instead - * this is to support official epubcheck localizations for which - * pagina EPUB-Checker doesn't offer translations - */ - //Locale.setDefault(new Locale("en", "US")); - } - - ResourceBundle.clearCache(); - System.out.println(Locale.getDefault()); - - // invalidate and dispose the old GUI (needed after switching the program's language in the gui menu) - if(guiManager.getCurrentGUI() != null) { - guiManager.getCurrentGUI().invalidate(); - guiManager.getCurrentGUI().dispose(); - } - - // show main GUI - MainGUI gui = new MainGUI(); - guiManager.setCurrentGUI(gui); - - // start validating immediately if a file has been set yet - // (e.g. when changing the language) - File file = guiManager.getCurrentFile(); - if(file != null && file.exists()) { - // validate EPUB file - new EpubValidator().validate(file); - } - } - - - - - /* ********************************************************************************************************** */ - - private String __(String s) { - return GuiManager.getInstance().getCurrentLocalizationObject().getString(s); - } -} +package de.paginagmbh.epubchecker; + +import java.awt.Dimension; +import java.awt.Point; +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.ResourceBundle; + +import javax.swing.JFrame; +import javax.swing.UIManager; + + + +/** + * Checks and validates EPUB eBooks in a nice graphical user interface + * + * @author Tobias Fischer + * @copyright pagina GmbH, Tübingen + * @version 2.0.6 + * @date 2021-07-07 + */ +public class PaginaEPUBChecker { + + // +++++++++++++++++++++++++ DON'T FORGET TO UPDATE EVERYTIME ++++++++++++++++++ // + + public static final String PROGRAMVERSION = "2.0.10"; + public static final String VERSIONDATE = "2023-08-28"; + public static final String PROGRAMRELEASE = ""; // "" or "Beta" + public static final String RELEASENOTES = "• Upgrade EPUBCheck to v5.1.0\n• Restored compatibility with newer Java versions\n• Internal improvements to the release and code signing process"; + + // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // + + private static GuiManager guiManager; + + + + + /* ********************************************************************************************************** */ + + public static void main(String[] args) { + new PaginaEPUBChecker(args); + } + + public PaginaEPUBChecker(String[] args) { + + // use system proxy + System.setProperty("java.net.useSystemProxies", "true"); + + + // create a GuiManager instance + guiManager = GuiManager.getInstance(); + + + // load and set system LookAndFeel + try { + JFrame.setDefaultLookAndFeelDecorated(true); + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + + + /* init FileManager && check operating system */ + FileManager.init(); + + + // load and init GUI and its dependencies (e.g. language object, regex object, etc.) + loadAndInitGuiAndDependencies(); + + + // perform update check + new UpdateCheck(true); + + + // init mac specific event listeners; after GUI is loaded + if(FileManager.os_name.equals("mac")) { + MacOsIntegration macOsIntegration = new MacOsIntegration(); + try { + macOsIntegration.addEventHandlers(); + // store current Application object in GuiManager + guiManager.setMacOsIntegration(macOsIntegration); + + } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) { + System.out.println("ERROR: Failed to load Mac OS integration: 'About' menu or Drag&Drop features may not work as expected! Please report to the developer!"); + e.printStackTrace(); + } + } + + + // init commandLine start for windows drag'n'drop on exe icon (issue #6) + List argFiles = new ArrayList<>(); + if(args != null && args.length > 0) { + for (int i = 0; i < args.length; i++) { + argFiles.add(new File(args[i])); + } + // validate EPUB files + new EpubValidator().validate(argFiles); + } + + + // show release notes only on first run + if( ! new File(FileManager.path_FirstRunFile).exists() ) { + MessageGUI msg = new MessageGUI(); + //msg.setTitle(""); + msg.showMessage(__("Thanks for updating!") + + "


" + + __("New version %NEW_VERSION% includes these features:").replaceAll("%NEW_VERSION%", PROGRAMVERSION) + + "

" + + RELEASENOTES + + "
"); + + // write current version to FirstRun File + StringHelper.writeStringToFile(FileManager.path_FirstRunFile, String.valueOf(PROGRAMVERSION)); + } + + + // ShutdownHook to save window size and position for next startup + Runtime.getRuntime().addShutdownHook(new Thread() { + @Override public void run() { + + Dimension MainGuiDimension = guiManager.getCurrentGUI().getSize(); + Point MainGuiPosition = guiManager.getCurrentGUI().getLocation(); + + // write window dimension and position to config file + StringHelper.writeStringToFile(FileManager.path_WindowFile, (int)MainGuiDimension.getWidth() + "x" + (int)MainGuiDimension.getHeight() + "@" + (int)MainGuiPosition.getX() + "," + (int)MainGuiPosition.getY()); + } + }); + } + + + + + /* ********************************************************************************************************** */ + + public void loadAndInitGuiAndDependencies() { + + // init language object + guiManager.createNewLocalizationObject(); + Locale currentLocale = guiManager.getCurrentLocale(); + + // set the defaultLocale for epubcheck resource bundles + if(guiManager.getCurrentLocalizationObject().getAvailableLanguages().containsKey(currentLocale)) { + Locale.setDefault(currentLocale); + } else { + /* don't fall back to en_US but use standard default locale instead + * this is to support official epubcheck localizations for which + * pagina EPUB-Checker doesn't offer translations + */ + //Locale.setDefault(new Locale("en", "US")); + } + + ResourceBundle.clearCache(); + System.out.println(Locale.getDefault()); + + // invalidate and dispose the old GUI (needed after switching the program's language in the gui menu) + if(guiManager.getCurrentGUI() != null) { + guiManager.getCurrentGUI().invalidate(); + guiManager.getCurrentGUI().dispose(); + } + + // show main GUI + MainGUI gui = new MainGUI(); + guiManager.setCurrentGUI(gui); + + // start validating immediately if a file has been set yet + // (e.g. when changing the language) + File file = guiManager.getCurrentFile(); + if(file != null && file.exists()) { + // validate EPUB file + new EpubValidator().validate(file); + } + } + + + + + /* ********************************************************************************************************** */ + + private String __(String s) { + return GuiManager.getInstance().getCurrentLocalizationObject().getString(s); + } +}