Class LanguageManager
java.lang.Object
fr.fuzeblocks.homeplugin.language.LanguageManager
The type Language manager.
-
Constructor Summary
ConstructorsConstructorDescriptionLanguageManager(Language type, HomePlugin plugin) Instantiates a new Language manager. -
Method Summary
Modifier and TypeMethodDescriptionGets language.@NotNull StringGets string.@NotNull StringGets string.@NotNull StringgetStringWithColor(String key) Gets string with color.@NotNull StringgetStringWithColor(String key, String defaultValue) Gets string with color.booleanRegenerates the language file from the internal resource and reloads it.static @NotNull StringtranslateAlternateColorCodes(@Nullable String s) Translate alternate color codes string.
-
Constructor Details
-
LanguageManager
Instantiates a new Language manager.- Parameters:
type- the typeplugin- the plugin
-
-
Method Details
-
getString
Gets string.- Parameters:
key- the key- Returns:
- the string
-
getString
Gets string.- Parameters:
key- the keydefaultValue- the default value- Returns:
- the string
-
getStringWithColor
Gets string with color.- Parameters:
key- the key- Returns:
- the string with color
-
getStringWithColor
Gets string with color.- Parameters:
key- the keydefaultValue- the default value- Returns:
- the string with color
-
translateAlternateColorCodes
Translate alternate color codes string.- Parameters:
s- the s- Returns:
- the string
-
regenerate
public boolean regenerate()Regenerates the language file from the internal resource and reloads it. Warning: this will overwrite the current file.- Returns:
- true if the operation succeeded, false otherwise.
-
getLanguage
Gets language.- Returns:
- the language
-