Package org.purpurmc.purpur.language
Class Language
java.lang.Object
org.purpurmc.purpur.language.Language
Represents a language that can translate translation keys
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the default language of the servergetOrDefault
(@NotNull String key) Translates a translation key to this languageTranslates a translation key to this languageabstract boolean
Checks if a certain translation key is translatable with this languageboolean
has
(@NotNull Translatable key) Checks if a certain translation key is translatable with this languagestatic void
setLanguage
(@NotNull Language language)
-
Constructor Details
-
Language
public Language()
-
-
Method Details
-
getLanguage
Returns the default language of the server -
setLanguage
-
has
Checks if a certain translation key is translatable with this language- Parameters:
key
- The translation key- Returns:
- Whether this language can translate the key
-
has
Checks if a certain translation key is translatable with this language- Parameters:
key
- The translation key- Returns:
- Whether this language can translate the key
-
getOrDefault
Translates a translation key to this language- Parameters:
key
- The translation key- Returns:
- The translated key, or the translation key if it couldn't be translated
-
getOrDefault
Translates a translation key to this language- Parameters:
key
- The translation key- Returns:
- The translated key, or the translation key if it couldn't be translated
-