Class I18n

java.lang.Object
com.earth2me.essentials.I18n
All Implemented Interfaces:
II18n, II18n

public class I18n extends Object implements II18n
  • Constructor Details

  • Method Details

    • tlLiteral

      public static String tlLiteral(String tlKey, Object... objects)
      Translates a message using the server's configured locale.
      Parameters:
      tlKey - The translation key.
      objects - Translation parameters, if applicable. Note: by default, these will not be parsed for MiniMessage.
      Returns:
      The translated message.
      See Also:
    • tlLocale

      public static String tlLocale(Locale locale, String tlKey, Object... objects)
      Translates a message using the provided locale.
      Parameters:
      locale - The locale to translate the key to.
      tlKey - The translation key.
      objects - Translation parameters, if applicable. Note: by default, these will not be parsed for MiniMessage.
      Returns:
      The translated message.
      See Also:
    • capitalCase

      public static String capitalCase(String input)
    • onEnable

      public void onEnable()
    • onDisable

      public void onDisable()
    • getCurrentLocale

      public Locale getCurrentLocale()
      Description copied from interface: II18n
      Gets the current locale setting
      Specified by:
      getCurrentLocale in interface II18n
      Returns:
      the current locale, if not set it will return the default locale
    • mutateArgs

      public static Object[] mutateArgs(Object[] objects, Function<Object,String> mutator)
    • updateLocale

      public void updateLocale(String loc)
    • getLocale

      public static Locale getLocale(String loc)