Package org.geysermc.geyser.text
Class GeyserLocale
java.lang.Object
org.geysermc.geyser.text.GeyserLocale
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatLocale(String locale)Cleans up and formats a locale stringstatic StringGet the default locale that Geyser should usestatic StringgetLocaleStringLog(String key, Object... values)Get a formatted language string with the default locale for Geyserstatic StringgetPlayerLocaleString(String key, String locale, Object... values)Get a formatted language string with the given locale for Geyserstatic voidinit()static voidloadGeyserLocale(String locale)Loads a Geyser locale from resources, if the file doesn't exist it just logs a warning
-
Constructor Details
-
GeyserLocale
public GeyserLocale()
-
-
Method Details
-
loadGeyserLocale
Loads a Geyser locale from resources, if the file doesn't exist it just logs a warning- Parameters:
locale- Locale to load
-
getLocaleStringLog
Get a formatted language string with the default locale for Geyser- Parameters:
key- Language string to translatevalues- Values to put into the string- Returns:
- Translated string or the original message if it was not found in the given locale
-
getPlayerLocaleString
Get a formatted language string with the given locale for Geyser- Parameters:
key- Language string to translatelocale- Locale to translate tovalues- Values to put into the string- Returns:
- Translated string or the original message if it was not found in the given locale
-
formatLocale
Cleans up and formats a locale string- Parameters:
locale- The locale to format- Returns:
- The formatted locale
-
getDefaultLocale
Get the default locale that Geyser should use- Returns:
- the current default locale
-
init
public static void init()
-