Class Bundle

java.lang.Object
jmri.Bundle
jmri.jmrit.Bundle
jmri.jmrit.consisttool.Bundle

Provides standard access for resource bundles in a package. Convention is to provide a subclass of this name in each package, working off the local resource bundle name.
Since:
3.3.1
  • Constructor Details

  • Method Details

    • getMessage

      static String getMessage(String key)
      Provides a translated string for a given key from the package resource bundle or parent.

      Note that this is intentionally package-local access.

      Parameters:
      key - Bundle key to be translated
      Returns:
      Internationalized text
    • getMessage

      static String getMessage(Locale locale, String key)
      Provides a translated string for a given key in a given locale from the package resource bundle or parent.

      Note that this is intentionally package-local access.

      Parameters:
      locale - The locale to be used
      key - Bundle key to be translated
      Returns:
      Internationalized text
    • getMessage

      static String getMessage(String key, Object... subs)
      Merges user data with a translated string for a given key from the package resource bundle or parent.

      Uses the transformation conventions of the Java MessageFormat utility.

      Note that this is intentionally package-local access.

      Parameters:
      key - Bundle key to be translated
      subs - One or more objects to be inserted into the message
      Returns:
      Internationalized text
      See Also:
    • getMessage

      static String getMessage(Locale locale, String key, Object... subs)
      Merges user data with a translated string for a given key in a given locale from the package resource bundle or parent.

      Uses the transformation conventions of the Java MessageFormat utility.

      Note that this is intentionally package-local access.

      Parameters:
      locale - The locale to be used
      key - Bundle key to be translated
      subs - One or more objects to be inserted into the message
      Returns:
      Internationalized text
      See Also:
    • bundleName

      Overrides:
      bundleName in class Bundle
    • getBundle

      protected static Bundle getBundle()
    • retry

      protected String retry(Locale locale, String key)
      Overrides:
      retry in class Bundle