java.lang.Object
i2p.susi.webmail.Messages

public class Messagesextends Object
Provides internationalization and string translation for the webmail package.
  • Field Details

    • BUNDLE_NAME

      private static final String BUNDLE_NAME
      The bundle holding the webmail strings.
      See Also:
    • _context

      private final I2PAppContext _context
      Supplies the locale the translated strings are looked up in.
  • Constructor Details

    • Messages

      public Messages()
      Default constructor, uses global context.
  • Method Details

    • _t

      public String _t(String key)
      Translate a key to the current locale.
      Parameters:
      key - the message key
      Returns:
      the translated string
    • getString

      public static String getString(String s)
      Get a translated string for the given key.
      Parameters:
      s - the message key
      Returns:
      the translated string
    • getString

      public static String getString(String s, Object o)
      Get a translated string with a parameter.
      Parameters:
      s - the message key
      o - substituted for {0} in the message key
      Returns:
      the translated string
    • getString

      public static String getString(String s, Object o, Object o2)
      Get a translated string with two parameters.
      Parameters:
      s - the message key
      o - substituted for {0} in the message key
      o2 - substituted for {1} in the message key
      Returns:
      the translated string
    • getString

      public static String getString(int n, String s, String p)
      Get a translated pluralized string based on a count.
      Parameters:
      n - how many, selecting the form; also substituted for {0}
      s - singular message key, used when n is 1
      p - plural message key, used when n is not 1
      Returns:
      the translated string