Interface IPolyglott

All Known Subinterfaces:
TranslatableCMSContent
All Known Implementing Classes:
Campaign, CMSCollection, CMSCollectionTreeTab, CMSMediumTextContent, CMSPage, CMSPageTemplate, CmsRecordNoteEditBean, CMSShortTextContent, CustomSidebarWidget, FacetFieldSidebarWidget, GeoMapBean, Highlight, HtmlSidebarWidget, MultiLanguageValue, PageListSidebarWidget, PersistentCMSComponent, RssFeedSidebarWidget, TermsOfUseEditBean, TranslatedText, WidgetDisplayElement

public interface IPolyglott
Interface for objects containing translations for a set of languages. Used to construct tab panels to switch beween languages
Author:
florian
  • Method Details

    • isComplete

      boolean isComplete(Locale locale)
      If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unless isEmpty(Locale) also returns true
      Parameters:
      locale -
      Returns:
      true if isValid(Locale) returns true for the given locale and all fields contain a value which have a value in the default locale. For the default locale, isComplete(Locale) and isValid(Locale) are identical. For implementations with only one field, both methods are also always identical
    • isValid

      boolean isValid(Locale locale)
      Only meaningfull for the default language for which all required fields must be filled
      Parameters:
      locale -
      Returns:
      true if all required fields contain a value in the given locale
    • isEmpty

      boolean isEmpty(Locale locale)
      If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class
      Parameters:
      locale -
      Returns:
      true if no fields are filled for the given locale
    • getSelectedLocale

      Locale getSelectedLocale()
      Returns:
      the locale currently set by setSelectedLocale(Locale)
    • setSelectedLocale

      void setSelectedLocale(Locale locale)
      Set the locale to use for display and editing
      Parameters:
      locale -
    • setSelectedLocale

      default void setSelectedLocale(String language)
      Convenience method. Calls setSelectedLocale(Locale) with the Locale given by the passed argument
      Parameters:
      language -
    • isDefaultLocaleSelected

      default boolean isDefaultLocaleSelected()
      Returns:
      true if the currently selected locale is also the default locale
    • isSelected

      default boolean isSelected(Locale locale)
      Parameters:
      locale -
      Returns:
      return true if the currently selected locale is the given locale
    • getLocales

      default Collection<Locale> getLocales()
      Get a list of all locales configured in the faces-configuration file.
      Returns:
      Collection
    • getLocalesStatic

      static Collection<Locale> getLocalesStatic()
      Get a list of all locales configured in the faces-configuration file
      Returns:
      Collection
    • getDefaultLocale

      static Locale getDefaultLocale()
      Returns:
      the default locale configured in the faces-configuration file
    • getCurrentLocale

      static Locale getCurrentLocale()
      Returns:
      the locale set in the current faces context