Class DelegateTranslationPackage

    • Constructor Detail

      • DelegateTranslationPackage

        public DelegateTranslationPackage()
    • Method Detail

      • getKeyHashRule

        public KeyHashRule getKeyHashRule()
        Description copied from interface: TranslationPackage
        The key hash rule dictates how term equivalency is calculated. Though this field should not be used to look up terms, it's important that derived translation packages use the same rule.
        Specified by:
        getKeyHashRule in interface TranslationPackage
      • removeTranslation

        public void removeTranslation​(java.lang.String key,
                                      java.util.Locale locale)
        Description copied from interface: MutableTranslationPackage
        Removes a translation for a specified key and locale. Used when someone had a translation and blanks it out.
        Specified by:
        removeTranslation in interface MutableTranslationPackage
      • getBaseLocale

        public java.util.Locale getBaseLocale()
        Specified by:
        getBaseLocale in interface TranslationPackage
        Returns:
        the "base" locale, the language in which the terms are defined.
      • getAvailableLocales

        public java.util.Collection<java.util.Locale> getAvailableLocales()
        Specified by:
        getAvailableLocales in interface TranslationPackage
        Returns:
        the locales for which translations are available. This will include the base locale.
      • isDefined

        public boolean isDefined​(java.lang.String key)
        Description copied from interface: TranslationPackage
        Returns whether the key is defined in the package. A key can be defined without any particular translations.
        Specified by:
        isDefined in interface TranslationPackage
      • isDefined

        public boolean isDefined​(java.lang.String key,
                                 java.util.Locale l)
        Description copied from interface: TranslationPackage
        Returns whether there is a translation defined for the given key in the given locale.
        Specified by:
        isDefined in interface TranslationPackage
      • get

        public java.lang.String get​(java.util.Locale locale,
                                    java.lang.String key)
        Specified by:
        get in interface TranslationPackage
        key - the key to find a match for, or return value if no value found
        Returns:
        the translation of the key for the requested locale, or the key, if the translation is not available.
      • getStrict

        public java.lang.String getStrict​(java.util.Locale locale,
                                          java.lang.String key)
        Specified by:
        getStrict in interface TranslationPackage
        Parameters:
        locale - the locale to find a value for
        key - the key to find a match for
        Returns:
        the translation, or null if the translation doesn't exist.
      • getAvailableKeys

        public java.util.Collection<java.lang.String> getAvailableKeys()
        Specified by:
        getAvailableKeys in interface TranslationPackage
        Returns:
        all of the defined keys.
      • getAllTranslations

        public java.util.Iterator<Translation> getAllTranslations()
        Specified by:
        getAllTranslations in interface TranslationPackage
        Returns:
        an iterator that goes through all of the translations. Does not include defined keys that have no translations.