v0.14: Fix localization implementation

This commit is contained in:
Dmitry Isaenko 2019-04-15 01:45:31 +03:00
parent 4586f71f55
commit 215849fd2a
6 changed files with 10 additions and 18 deletions

View file

@ -8,7 +8,7 @@
<name>mplayer4anime</name> <name>mplayer4anime</name>
<artifactId>mplayer4anime</artifactId> <artifactId>mplayer4anime</artifactId>
<version>0.13-SNAPSHOT</version> <version>0.14-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>

View file

@ -23,11 +23,8 @@ public class AboutWindow {
FXMLLoader loaderAbout = new FXMLLoader(getClass().getResource("/About/AboutLayout.fxml")); FXMLLoader loaderAbout = new FXMLLoader(getClass().getResource("/About/AboutLayout.fxml"));
ResourceBundle resourceBundle; ResourceBundle resourceBundle;
if (Locale.getDefault().getISO3Language().equals("rus")) { Locale userLocale = new Locale(Locale.getDefault().getISO3Language()); // NOTE: user locale based on ISO3 Language codes
resourceBundle = ResourceBundle.getBundle("locale", new Locale("ru")); resourceBundle = ResourceBundle.getBundle("locale", userLocale);
} else {
resourceBundle = ResourceBundle.getBundle("locale", new Locale("en"));
}
loaderAbout.setResources(resourceBundle); loaderAbout.setResources(resourceBundle);
try { try {

View file

@ -32,11 +32,9 @@ public class MainFX extends Application {
public void start(Stage primaryStage) throws Exception{ public void start(Stage primaryStage) throws Exception{
FXMLLoader loader = new FXMLLoader(getClass().getResource("/landingPage.fxml")); FXMLLoader loader = new FXMLLoader(getClass().getResource("/landingPage.fxml"));
if (Locale.getDefault().getISO3Language().equals("rus")) { Locale userLocale = new Locale(Locale.getDefault().getISO3Language()); // NOTE: user locale based on ISO3 Language codes
loader.setResources(ResourceBundle.getBundle("locale", new Locale("ru"))); ResourceBundle rb = ResourceBundle.getBundle("locale", userLocale);
} else { loader.setResources(rb);
loader.setResources(ResourceBundle.getBundle("locale", new Locale("en")));
}
Parent root = loader.load(); Parent root = loader.load();

View file

@ -22,11 +22,8 @@ public class SettingsWindow {
FXMLLoader loaderSettings = new FXMLLoader(getClass().getResource("/Settings/SettingsLayout.fxml")); FXMLLoader loaderSettings = new FXMLLoader(getClass().getResource("/Settings/SettingsLayout.fxml"));
ResourceBundle resourceBundle; ResourceBundle resourceBundle;
if (Locale.getDefault().getISO3Language().equals("rus")) { Locale userLocale = new Locale(Locale.getDefault().getISO3Language()); // NOTE: user locale based on ISO3 Language codes
resourceBundle = ResourceBundle.getBundle("locale", new Locale("ru")); resourceBundle = ResourceBundle.getBundle("locale", userLocale);
} else {
resourceBundle = ResourceBundle.getBundle("locale", new Locale("en"));
}
loaderSettings.setResources(resourceBundle); loaderSettings.setResources(resourceBundle);

View file

@ -1,5 +1,5 @@
about_line1=mplayer4amine distributes under GNU GPLv3 license. about_line1=mplayer4amine distributes under GNU GPLv3 license.
about_line2=Release: v0.13 about_line2=Release: v0.14
about_line3=Development & maintenance by Dmitry Isaenko. about_line3=Development & maintenance by Dmitry Isaenko.
about_AboutName=About about_AboutName=About
main_tab_audio=Audio main_tab_audio=Audio

View file

@ -1,6 +1,6 @@
menu_File_Recent=\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 \u0444\u0430\u0439\u043B\u044B... menu_File_Recent=\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 \u0444\u0430\u0439\u043B\u044B...
about_line1=mplayer4amine \u0440\u0430\u0441\u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F \u043F\u043E \u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0438 GNU GPLv3. about_line1=mplayer4amine \u0440\u0430\u0441\u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F \u043F\u043E \u043B\u0438\u0446\u0435\u043D\u0437\u0438\u0438 GNU GPLv3.
about_line2=\u0420\u0435\u043B\u0438\u0437: v0.13 about_line2=\u0420\u0435\u043B\u0438\u0437: v0.14
about_line3=\u0420\u0430\u0437\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u043E \u0438 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0414\u043C\u0438\u0442\u0440\u0438\u0435\u043C \u0418\u0441\u0430\u0435\u043D\u043A\u043E. about_line3=\u0420\u0430\u0437\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u043E \u0438 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0414\u043C\u0438\u0442\u0440\u0438\u0435\u043C \u0418\u0441\u0430\u0435\u043D\u043A\u043E.
about_AboutName=\u041E \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0438 about_AboutName=\u041E \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0438
main_tab_audio=\u0410\u0443\u0434\u0438\u043E main_tab_audio=\u0410\u0443\u0434\u0438\u043E