Class Language
java.lang.Object
me.remigio07.chatplugin.api.server.language.Language
Represents a language handled by the
LanguageManager
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGets the messages configuration associated with this language.Gets this language's list of ISO 3166-2 country codes.Gets this language's display name.getID()
Gets this language's ID.static Language
Gets the plugin's main and default language.getMessage
(String path, Object... args) Gets a message from this language'sgetConfiguration()
and translates its placeholders usingUtils.numericPlaceholders(String, Object...)
.Gets a list containing all online players with this language set as their current language.
-
Method Details
-
getID
Gets this language's ID.- Returns:
- Language's ID
-
getDisplayName
Gets this language's display name. May include format codes ("§x").- Returns:
- Language's display name
-
getCountryCodes
Gets this language's list of ISO 3166-2 country codes.A player's language may be determined using
LanguageDetectionMethod.GEOLOCALIZATION
if this list contains theirIPLookup.getCountryCode()
.- Returns:
- Language's country codes
-
getConfiguration
Gets the messages configuration associated with this language.- Returns:
- Associated configuration
-
getMessage
Gets a message from this language'sgetConfiguration()
and translates its placeholders usingUtils.numericPlaceholders(String, Object...)
.The "{pfx}" placeholder will be translated with the message found at "misc.prefix". Returned text will also be translated using
ChatColor.translate(String)
.- Parameters:
path
- Message's pathargs
- Optional arguments (translated usingUtils.numericPlaceholders(String, Object...)
)- Returns:
- Translated message
-
getOnlinePlayers
Gets a list containing all online players with this language set as their current language.- Returns:
- Language's online players
-
getMainLanguage
Gets the plugin's main and default language.This method calls
LanguageManager.getMainLanguage()
.- Returns:
- Main language
-