Language selection doesn't work on some OSs

This commit is contained in:
Bane Stojkovic
2025-04-15 18:21:37 +02:00
parent 11242dcb10
commit 7a7e3982f3
3 changed files with 10 additions and 3 deletions
@@ -89,8 +89,11 @@ public class LangUtil {
LOG.info("Loading translation for " + language);
dict = new HashMap<String, String>();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
(LangUtil.class.getResourceAsStream("/" + LANG_DIR + File.separator + language + ".txt"))));
InputStream inputStream = LangUtil.class.getResourceAsStream('/' + LANG_DIR + '/' + language + ".txt");
if (inputStream == null) {
throw new RuntimeException("Could not load language file: " + language);
}
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
while(reader.ready()) {
String s = reader.readLine();
if (s.contains("|")) {
@@ -273,6 +273,10 @@
<changeType>IMPROVEMENT</changeType>
<description>Output current subscription statistics at the end of the chat for transparency</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>Language selection doesn't work on some OSs</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>'Connect to Patreon' option doesn't work if the user name contains a space or another non-alphanumerical character</description>