Module ilusr.core

Class LanguageManager


  • public class LanguageManager
    extends Object
    Author:
    Jeff Riggle
    • Constructor Detail

      • LanguageManager

        public LanguageManager()
    • Method Detail

      • getInstance

        public static LanguageManager getInstance()
        Returns:
        A @see LanguageManager instance
      • addLanguagePack

        public void addLanguagePack​(File languageFile)
                             throws IOException
        Adds a language file to the current language manager. Language files must have a language code. LanguageCode;=;en-US Language files must also have values delimited by ;=;
        Parameters:
        languageFile - The file to load and parse.
        Throws:
        IOException
      • addLanguagePack

        public void addLanguagePack​(String content)
        Adds a language file to the current language manager. Language files must have a language code. LanguageCode;=;en-US Language files must also have values delimited by ;=;
        Parameters:
        content - The file content to load and parse.
      • removeLanguagePack

        public void removeLanguagePack​(String languageCode)
        Parameters:
        languageCode - The language to remove.
      • setLanguage

        public void setLanguage​(String language)
        Parameters:
        language - Sets the current language code.
      • currentLanguage

        public String currentLanguage()
        Returns:
        Gets the current language code.
      • addLanguageChangeListener

        public void addLanguageChangeListener​(Runnable listener)
        Parameters:
        listener - A @see Runnable to call when the language code is changed.
      • removeLanguageChangeListener

        public void removeLanguageChangeListener​(Runnable listener)
        Parameters:
        listener - A @see Runnable to call when the language code is changed.
      • getValue

        public String getValue​(String key)
        Parameters:
        key - The key to look for.
        Returns:
        The language specific value.