Package org.geysermc.geyser.text
Class GeyserLocale
java.lang.Object
org.geysermc.geyser.text.GeyserLocale
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidfinalizeDefaultLocale(GeyserImpl geyser) Finalize the default locale, now that we know what the default locale should be.static StringformatLocale(String locale) Cleans up and formats a locale stringstatic Stringstatic StringgetLocaleStringLog(String key) Get a formatted language string with the default locale for Geyserstatic StringgetLocaleStringLog(String key, Object... values) Get a formatted language string with the default locale for Geyserstatic StringgetPlayerLocaleString(String key, String locale) Get a formatted language string with the given locale for Geyserstatic StringgetPlayerLocaleString(String key, String locale, Object... values) Get a formatted language string with the given locale for Geyserstatic voidinit(GeyserBootstrap bootstrap) Loads the initial locale(s) with the help of the bootstrap.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
-
init
Loads the initial locale(s) with the help of the bootstrap. -
finalizeDefaultLocale
Finalize the default locale, now that we know what the default locale should be. -
getDefaultLocale
-
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 translate- Returns:
- Translated string or the original message if it was not found in the given locale
-
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 to- 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
-