Class StargateLanguageManager
java.lang.Object
org.sgrewritten.stargate.formatting.StargateLanguageManager
- All Implemented Interfaces:
LanguageManager
The language manager is responsible for translating various messages
-
Constructor Summary
ConstructorDescriptionStargateLanguageManager
(File languageFolder) Instantiates a new language manager -
Method Summary
Modifier and TypeMethodDescriptiongetErrorMessage
(TranslatableMessage translatableMessage) Gets a formatted error messagegetMessage
(TranslatableMessage translatableMessage) Gets a formatted messagegetString
(TranslatableMessage translatableMessage) Gets a translated stringgetWarningMessage
(TranslatableMessage translatableMessage) Gets a formatted warning messagevoid
setLanguage
(String languageSpecification) Sets the currently used language
-
Constructor Details
-
StargateLanguageManager
Instantiates a new language manager- Parameters:
languageFolder
-The folder containing all language files
-
-
Method Details
-
getErrorMessage
Description copied from interface:LanguageManager
Gets a formatted error message- Specified by:
getErrorMessage
in interfaceLanguageManager
- Parameters:
translatableMessage
-The translatable message to display as an error
- Returns:
The formatted error message
-
getWarningMessage
Description copied from interface:LanguageManager
Gets a formatted warning message- Specified by:
getWarningMessage
in interfaceLanguageManager
- Parameters:
translatableMessage
-The translatable message to display as an error
- Returns:
The formatted warning message
-
getMessage
Description copied from interface:LanguageManager
Gets a formatted message- Specified by:
getMessage
in interfaceLanguageManager
- Parameters:
translatableMessage
-The translatable message to display
- Returns:
The formatted message
-
getString
Description copied from interface:LanguageManager
Gets a translated string- Specified by:
getString
in interfaceLanguageManager
- Parameters:
translatableMessage
-The translatable message to translate
- Returns:
The corresponding translated message
-
setLanguage
Description copied from interface:LanguageManager
Sets the currently used languageSets the language and loads everything from the language file
- Specified by:
setLanguage
in interfaceLanguageManager
- Parameters:
languageSpecification
-The language to change to
-