Package org.geysermc.geyser.text
Class GeyserLocale
java.lang.Object
org.geysermc.geyser.text.GeyserLocale
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatLocale(String locale)
Cleans up and formats a locale stringstatic String
Get the default locale that Geyser should usestatic String
getLocaleStringLog(String key, Object... values)
Get a formatted language string with the default locale for Geyserstatic String
getPlayerLocaleString(String key, String locale, Object... values)
Get a formatted language string with the given locale for Geyserstatic void
init()
static void
loadGeyserLocale(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()
-