Interface TranslationBundle

    • Field Detail

      • DEFAULTPRIORITY

        static final int DEFAULTPRIORITY
        The default priority of a Bundle.
        See Also:
        Constant Field Values
    • Method Detail

      • getId

        String getId()
        Returns:
        the unique identifier of the bundle
      • getPriority

        int getPriority()
        When searching for a translation, the bundles are searched in order until one of these bundles contains a value for the searched key. The bundle priority defines this order. Lower is better, meaning that a bundle with a smaller priority value will be searched before a bundle with a higher value.
        Returns:
        the priority
        See Also:
        Comparable.compareTo(Object)
      • getTranslation

        Translation getTranslation​(String key,
                                   Locale locale)
        Return the translation for the given key, in the specified Locale. If not translation for the exact Locale can be found it fallback on the language and then on the default translation if any.
        Parameters:
        key - the key to translate.
        locale - the locale to translate into.
        Returns:
        the Translation or null if none can be found.