Class DisplayI18NHelper


  • public class DisplayI18NHelper
    extends Object
    This class permits to handle the different languages that a user can choose to display the labels of the application.
    Be careful, this class handles possible user languages and not possible content languages.
    The different content languages are managed by org.silverpeas.util.i18n.I18NHelper.
    • Method Detail

      • getDefaultLanguage

        public static String getDefaultLanguage()
        Returns the default language used to display user interface (UI)
        Returns:
        a String (ie : 'fr', 'en' or another two-letters code)
      • getDefaultZoneId

        public static ZoneId getDefaultZoneId()
        Returns the default zone id used dor user interface (UI)
        Returns:
        an instance of ZoneId.
      • getLanguages

        public static List<String> getLanguages()
        Returns all languages available to display user interface
        Returns:
        a List of String (ie : 'fr', 'en' or another two-letters code)
      • getZoneIds

        public static List<String> getZoneIds()
        Returns all zone identifiers available for user interface
        Returns:
        a List of String.
      • verifyLanguage

        public static String verifyLanguage​(String language)
        Verifies if the given user language is handled by the server.
        Parameters:
        language - the language to verify
        Returns:
        the given user language if it is handled by the server, the default user language otherwise.
      • verifyZoneId

        public static ZoneId verifyZoneId​(String zoneId)
        Verifies if the given user zone id is handled by the server.
        Returns:
        the given user zone id if it is handled by the server, the default user zone id otherwise.