removed call to Locale#setDefault within LocaleLoader#initialize; added static locale-parameter to all instances of a Formatter (#5141)

This commit is contained in:
Philip Hell
2025-01-25 23:24:02 +01:00
committed by GitHub
parent dab4e777ce
commit b36848bd47
8 changed files with 22 additions and 16 deletions

View File

@@ -109,7 +109,7 @@ public final class LocaleLoader {
public static String formatString(String string, Object... messageArguments) {
if (messageArguments != null) {
MessageFormat formatter = new MessageFormat("");
MessageFormat formatter = new MessageFormat("", Locale.US);
formatter.applyPattern(string.replace("'", "''"));
string = formatter.format(messageArguments);
}
@@ -121,7 +121,7 @@ public final class LocaleLoader {
public static @NotNull TextComponent formatComponent(@NotNull String string, Object... messageArguments) {
if (messageArguments != null) {
MessageFormat formatter = new MessageFormat("");
MessageFormat formatter = new MessageFormat("", Locale.US);
formatter.applyPattern(string.replace("'", "''"));
string = formatter.format(messageArguments);
}
@@ -138,7 +138,6 @@ public final class LocaleLoader {
private static void initialize() {
if (bundle == null) {
Locale.setDefault(new Locale("en", "US"));
Locale locale = null;
String[] myLocale = mcMMO.p.getGeneralConfig().getLocale().split("[-_ ]");