Class LanguageManager
java.lang.Object
uk.radialbog9.spigot.manhunt.language.LanguageManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetProperty
(String key) Gets the property from the language map.getProperty
(String key, String defaultValue) Gets the property from the language map.void
loadLanguage
(Map<String, String> languageProperties) void
loadLanguage
(Properties languageProperties) Loads the language properties into the language map.void
setProperty
(String key, String value) Sets a property in the language map.
-
Constructor Details
-
LanguageManager
public LanguageManager()
-
-
Method Details
-
getProperty
Gets the property from the language map. If the property does not exist, the default value is returned.- Parameters:
key
- The key to getdefaultValue
- The default value to return if the key does not exist- Returns:
- The value of the key or the default value if the key does not exist
-
getProperty
Gets the property from the language map.- Parameters:
key
- The key to get- Returns:
- The value of the key or null if the key does not exist
-
loadLanguage
Loads the language properties into the language map. This will replace any existing properties.- Parameters:
languageProperties
- The language properties to load
-
loadLanguage
-
setProperty
Sets a property in the language map. This will replace any existing property with the same key.- Parameters:
key
- the key to setvalue
- the value to set
-