java.lang.Object
me.github.simonplays15.betterbansystem.api.files.BaseConfig
me.github.simonplays15.betterbansystem.api.files.LanguageFile

public class LanguageFile extends BaseConfig
This class represents a language file. It extends the BaseConfig class.
  • Constructor Details

    • LanguageFile

      public LanguageFile (String languagePath)
      Constructs a LanguageFile object by loading the language file from the specified path.
      Parameters:
      languagePath - The path of the language file to load.
  • Method Details

    • getMessage

      public String getMessage (String key)
      Retrieves a message by its key.
      Parameters:
      key - the key of the message
      Returns:
      the message corresponding to the key, or a default error message if the key is not found
      Throws:
      NullPointerException - if the key is null
    • getMessage

      public String getMessage (String key, @NotNull @NotNull Map<String,String> placeholders)
      Retrieves the message with the given key and placeholders.
      Parameters:
      key - the key of the message to retrieve
      placeholders - the placeholders to replace in the message
      Returns:
      the formatted message with translated colors