Class Messages


  • public class Messages
    extends Object
    Utility class for localising string resources. The standard place for storing message bundle resources is in the i18n folder.
    Any method that requires a bundle name will automatically prepend /i18n to acquire the full class loader resource to search for.
    • Method Detail

      • getString

        public static String getString​(String bundle,
                                       String key,
                                       Object... arguments)
        Returns message
        Parameters:
        bundle - bundle name
        key - key
        arguments - message replacement arguments
        Returns:
        localised text
      • getString

        public static String getString​(String bundle,
                                       Locale locale,
                                       String key,
                                       Object... arguments)
        Returns message
        Parameters:
        bundle - bundle name
        key - key
        arguments - message replacement arguments
        Returns:
        localised text
      • getString

        public static String getString​(ClassLoader classLoader,
                                       String bundle,
                                       String key,
                                       Object... arguments)
        Returns message
        Parameters:
        bundle - bundle name
        key - key
        arguments - message replacement arguments
        Returns:
        localised text
      • getString

        public static String getString​(ClassLoader classLoader,
                                       Locale locale,
                                       String bundle,
                                       String key,
                                       Object... arguments)
        Returns message
        Parameters:
        locale - local (default is used if null)
        bundle - bundle name
        key - key
        arguments - message replacement arguments
        Returns:
        localised text