Skip to content

Commit

Permalink
Improved localization handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rmraya committed Jun 2, 2023
1 parent 7bd9257 commit 51e4198
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ An open source UI for [OpenXLIFF Filters](https://github.com/rmraya/OpenXLIFF).

Version | Comment | Release Date
:------:|---------|:-----------:
6.2.0 | Improved localization handling | June 2nd, 2023
6.1.0 | Updated OpenXLIFF Filters to version 3.7.0 | May 16th, 2023
6.0.0 | Added Spanish localization | April 1st, 2023
5.8.0 | Updated OpenXLIFF Filters to version 3.3.0 | February 22nd, 2023
5.7.0 | Updated OpenXLIFF Filters to version 3.1.0 | January 25th, 2023
Expand Down
Binary file modified jars/openxliff.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "xliffmanager",
"productName": "XLIFF Manager",
"version": "6.1.0",
"version": "6.2.0",
"description": "XLIFF Manager, a cross-platform open source graphical user interface for OpenXLIFF Filters",
"main": "js/app.js",
"scripts": {
Expand All @@ -25,6 +25,6 @@
"url": "https://github.com/rmraya/XLIFFManager.git"
},
"devDependencies": {
"electron": "^24.3.0"
"electron": "^25.0.1"
}
}
6 changes: 5 additions & 1 deletion src/com/maxprograms/server/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class Messages {
private static Properties props;

private Messages() {
// do not instantiate this class
}

public static String getString(String key) {
Expand All @@ -32,6 +33,9 @@ public static String getString(String key) {
Locale locale = Locale.getDefault();
String extension = "en".equals(locale.getLanguage()) ? ".properties"
: "_" + locale.getLanguage() + ".properties";
if (Messages.class.getResource("server" + extension) == null) {
extension = ".properties";
}
try (InputStream is = Messages.class.getResourceAsStream("server" + extension)) {
try (InputStreamReader reader = new InputStreamReader(is, StandardCharsets.UTF_8)) {
props = new Properties();
Expand All @@ -40,7 +44,7 @@ public static String getString(String key) {
}
}
return props.getProperty(key, '!' + key + '!');
} catch (IOException e) {
} catch (IOException | NullPointerException e) {
return '!' + key + '!';
}
}
Expand Down

0 comments on commit 51e4198

Please sign in to comment.