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 serverabstract String
getOrDefault
(String key) Translates a translation key to this languagegetOrDefault
(Translatable key) Translates a translation key to this languageabstract boolean
Checks if a certain translation key is translatable with this languageboolean
has
(Translatable key) Checks if a certain translation key is translatable with this languagestatic void
setLanguage
(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
-