3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-19 22:40:18 +01:00

Constant for 'system' locale

Dieser Commit ist enthalten in:
Camotoy 2024-09-26 13:28:39 -04:00
Ursprung 0a625627c9
Commit c4bed6509c
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
2 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -32,6 +32,7 @@ import org.geysermc.geyser.api.network.BedrockListener;
import org.geysermc.geyser.api.network.RemoteServer; import org.geysermc.geyser.api.network.RemoteServer;
import org.geysermc.geyser.network.GameProtocol; import org.geysermc.geyser.network.GameProtocol;
import org.geysermc.geyser.text.AsteriskSerializer; import org.geysermc.geyser.text.AsteriskSerializer;
import org.geysermc.geyser.text.GeyserLocale;
import org.geysermc.geyser.util.CooldownUtils; import org.geysermc.geyser.util.CooldownUtils;
import org.spongepowered.configurate.interfaces.meta.Exclude; import org.spongepowered.configurate.interfaces.meta.Exclude;
import org.spongepowered.configurate.interfaces.meta.Field; 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.") @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 @NonNull
@DefaultString("system") @DefaultString(GeyserLocale.SYSTEM_LOCALE)
String defaultLocale(); String defaultLocale();
@Comment("Allows custom skulls to be displayed. Keeping them enabled may cause a performance decrease on older/weaker devices.") @Comment("Allows custom skulls to be displayed. Keeping them enabled may cause a performance decrease on older/weaker devices.")

Datei anzeigen

@ -41,6 +41,7 @@ import java.util.Map;
import java.util.Properties; import java.util.Properties;
public class GeyserLocale { 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 * 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) { public static void finalizeDefaultLocale(GeyserImpl geyser) {
String newDefaultLocale = geyser.config().defaultLocale(); 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 // We want to use the system locale which is already loaded
return; return;
} }