3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-24 23:30:22 +01:00

Fix: norwegian locale handling (#4716)

Dieser Commit ist enthalten in:
chris 2024-06-19 02:37:34 +02:00 committet von GitHub
Ursprung a9300fb1ab
Commit 6884a0f7db
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -259,6 +259,13 @@ public class GeyserLocale {
// Invalid locale
return locale;
}
// See https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes - covers the special case that is norwegian
String lowerCaseLocale = locale.toLowerCase(Locale.ROOT);
if (lowerCaseLocale.equals("nn_no") || lowerCaseLocale.equals("no_no")) {
locale = "nb_NO";
}
String language = locale.substring(0, 2);
String country = locale.substring(3);
return language.toLowerCase(Locale.ENGLISH) + "_" + country.toUpperCase(Locale.ENGLISH);