From c4bed6509c081d8b5e07fb969fb7feabc57abec9 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:28:39 -0400 Subject: [PATCH] Constant for 'system' locale --- .../java/org/geysermc/geyser/configuration/GeyserConfig.java | 3 ++- core/src/main/java/org/geysermc/geyser/text/GeyserLocale.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java b/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java index 5dadce9cd..bba928f3e 100644 --- a/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java +++ b/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java @@ -32,6 +32,7 @@ import org.geysermc.geyser.api.network.BedrockListener; import org.geysermc.geyser.api.network.RemoteServer; import org.geysermc.geyser.network.GameProtocol; import org.geysermc.geyser.text.AsteriskSerializer; +import org.geysermc.geyser.text.GeyserLocale; import org.geysermc.geyser.util.CooldownUtils; import org.spongepowered.configurate.interfaces.meta.Exclude; import org.spongepowered.configurate.interfaces.meta.Field; @@ -128,7 +129,7 @@ public interface GeyserConfig { @Comment("The default locale if we don't have the one the client requested. If set to \"system\", the system's language will be used.") @NonNull - @DefaultString("system") + @DefaultString(GeyserLocale.SYSTEM_LOCALE) String defaultLocale(); @Comment("Allows custom skulls to be displayed. Keeping them enabled may cause a performance decrease on older/weaker devices.") diff --git a/core/src/main/java/org/geysermc/geyser/text/GeyserLocale.java b/core/src/main/java/org/geysermc/geyser/text/GeyserLocale.java index ad9e05342..acef5cc98 100644 --- a/core/src/main/java/org/geysermc/geyser/text/GeyserLocale.java +++ b/core/src/main/java/org/geysermc/geyser/text/GeyserLocale.java @@ -41,6 +41,7 @@ import java.util.Map; import java.util.Properties; public class GeyserLocale { + public static final String SYSTEM_LOCALE = "system"; /** * If we determine the default locale that the user wishes to use, use that locale @@ -81,7 +82,7 @@ public class GeyserLocale { */ public static void finalizeDefaultLocale(GeyserImpl geyser) { String newDefaultLocale = geyser.config().defaultLocale(); - if ("system".equals(newDefaultLocale)) { + if (SYSTEM_LOCALE.equals(newDefaultLocale)) { // We want to use the system locale which is already loaded return; }