Class LanguageManager

java.lang.Object
fr.fuzeblocks.homeplugin.language.LanguageManager

public class LanguageManager extends Object
The type Language manager.
  • Constructor Details

    • LanguageManager

      public LanguageManager(Language type, HomePlugin plugin)
      Instantiates a new Language manager.
      Parameters:
      type - the type
      plugin - the plugin
  • Method Details

    • getString

      @NotNull public @NotNull String getString(String key)
      Gets string.
      Parameters:
      key - the key
      Returns:
      the string
    • getString

      @NotNull public @NotNull String getString(String key, String defaultValue)
      Gets string.
      Parameters:
      key - the key
      defaultValue - the default value
      Returns:
      the string
    • getStringWithColor

      @NotNull public @NotNull String getStringWithColor(String key)
      Gets string with color.
      Parameters:
      key - the key
      Returns:
      the string with color
    • getStringWithColor

      @NotNull public @NotNull String getStringWithColor(String key, String defaultValue)
      Gets string with color.
      Parameters:
      key - the key
      defaultValue - the default value
      Returns:
      the string with color
    • translateAlternateColorCodes

      @NotNull public static @NotNull String translateAlternateColorCodes(@Nullable @Nullable String s)
      Translate alternate color codes string.
      Parameters:
      s - the s
      Returns:
      the string
    • regenerate

      public boolean regenerate()
      Regenerates the language file from the internal resource and reloads it. Warning: this will overwrite the current file.
      Returns:
      true if the operation succeeded, false otherwise.
    • getLanguage

      public Language getLanguage()
      Gets language.
      Returns:
      the language