Package org.geysermc.floodgate.core.util
Class LanguageManager
java.lang.Object
org.geysermc.floodgate.core.util.LanguageManager
Manages translations for strings in Floodgate
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe locale used in console and as a fallbackgetLogString(String key, Object... values) Get a formatted language string with the default locale for FloodgateGet a formatted language string with the given locale for Floodgatevoidinit(FloodgateConfig config) Tries to load the log's locale file once a string has been requestedbooleanloadLocale(String locale) Loads a Floodgate locale from resources; if the file doesn't exist it just logs a warning
-
Constructor Details
-
LanguageManager
public LanguageManager()
-
-
Method Details
-
init
Tries to load the log's locale file once a string has been requested -
loadLocale
Loads a Floodgate locale from resources; if the file doesn't exist it just logs a warning- Parameters:
locale- locale to load- Returns:
- true if the locale has been found
-
getLogString
Get a formatted language string with the default locale for Floodgate- Parameters:
key- language string to translatevalues- values to put into the string- Returns:
- translated string or "key arg1, arg2 (etc.)" if it was not found in the given locale
-
getString
Get a formatted language string with the given locale for Floodgate- Parameters:
key- language string to translatelocale- locale to translate tovalues- values to put into the string- Returns:
- translated string or "key arg1, arg2 (etc.)" if it was not found in the given locale
-
getDefaultLocale
The locale used in console and as a fallback
-