Interface I18N

  • All Known Implementing Classes:
    DefaultI18N

    public interface I18N
    • Method Detail

      • getMessage

        String getMessage​(String key)
        Get the specified message in the default language (according to getDefaultLanguage()
        Parameters:
        key - Key value
        Returns:
        Message for the given key, or null if none is found/available
      • getMessage

        String getMessage​(String langCode,
                          String key)
        Get the specified message for the specified language
        Parameters:
        langCode - ISO 639-1 language code: "en", "ja", etc
        key - Key value for the message to retrieve
        Returns:
        Message for the given key/language pair, or null if none is found
      • getDefaultLanguage

        String getDefaultLanguage()
        Get the currently set default language as an ISO 639-1 code
        Returns:
        The current default language
      • setDefaultLanguage

        void setDefaultLanguage​(String langCode)
        Set the default language
        Parameters:
        langCode - Language code, as an ISO 639-1 code
      • getMessages

        Map<String,​String> getMessages​(String langCode)
        Get all internationalization messages for the specified language code
        Parameters:
        langCode - Language code
        Returns:
        Messages