Class LanguageProvider

  • Direct Known Subclasses:
    FrenchEnglishLanguageProvider

    public class LanguageProvider
    extends Object
    Provide a translation contained in a properties for a given language. Mutable class.
    Author:
    Grégory Van den Borre specfield languages:Map of LanguageValue, Properties:Provide the property data for a given language.
    • Constructor Detail

      • LanguageProvider

        public LanguageProvider()
        Build a new language provider, it will hold the property files for EN and FR.
    • Method Detail

      • registerLanguage

        public final void registerLanguage​(be.yildizgames.common.util.language.Language l)
        Add a supported language.
        Parameters:
        l - Language to support.
      • add

        public final void add​(String key,
                              be.yildizgames.common.util.language.Language language,
                              String value)
      • add

        public final void add​(TranslatedValue value)
        Add a translation text.
        Parameters:
        value - Translation to add.
      • add

        public final void add​(TranslatedValuesProvider provider)
        Add several translation texts.
        Parameters:
        provider - Provide the translations.
      • get

        public final Properties get​(be.yildizgames.common.util.language.Language language)
        Provide a properties containing the language translation.
        Parameters:
        language - LanguageValue to retrieve.
        Returns:
        The properties matching the language.