Class StargateLanguageManager

java.lang.Object
org.sgrewritten.stargate.formatting.StargateLanguageManager
All Implemented Interfaces:
LanguageManager

public class StargateLanguageManager extends Object implements LanguageManager
The language manager is responsible for translating various messages
  • Constructor Details

    • StargateLanguageManager

      public StargateLanguageManager(File languageFolder)
      Instantiates a new language manager
      Parameters:
      languageFolder -

      The folder containing all language files

  • Method Details

    • getErrorMessage

      public String getErrorMessage(TranslatableMessage translatableMessage)
      Description copied from interface: LanguageManager
      Gets a formatted error message
      Specified by:
      getErrorMessage in interface LanguageManager
      Parameters:
      translatableMessage -

      The translatable message to display as an error

      Returns:

      The formatted error message

    • getWarningMessage

      public String getWarningMessage(TranslatableMessage translatableMessage)
      Description copied from interface: LanguageManager
      Gets a formatted warning message
      Specified by:
      getWarningMessage in interface LanguageManager
      Parameters:
      translatableMessage -

      The translatable message to display as an error

      Returns:

      The formatted warning message

    • getMessage

      public String getMessage(TranslatableMessage translatableMessage)
      Description copied from interface: LanguageManager
      Gets a formatted message
      Specified by:
      getMessage in interface LanguageManager
      Parameters:
      translatableMessage -

      The translatable message to display

      Returns:

      The formatted message

    • getString

      public String getString(TranslatableMessage translatableMessage)
      Description copied from interface: LanguageManager
      Gets a translated string
      Specified by:
      getString in interface LanguageManager
      Parameters:
      translatableMessage -

      The translatable message to translate

      Returns:

      The corresponding translated message

    • setLanguage

      public void setLanguage(String languageSpecification)
      Description copied from interface: LanguageManager
      Sets the currently used language

      Sets the language and loads everything from the language file

      Specified by:
      setLanguage in interface LanguageManager
      Parameters:
      languageSpecification -

      The language to change to