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 Summary
Modifier and TypeMethodDescriptionstatic Locale
static Locale
default Collection<Locale>
Get a list of all locales configured in the faces-configuration file.static Collection<Locale>
Get a list of all locales configured in the faces-configuration fileboolean
isComplete
(Locale locale) If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unlessisEmpty(Locale)
also returns truedefault boolean
boolean
If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' classdefault boolean
isSelected
(Locale locale) boolean
Only meaningfull for the default language for which all required fields must be filleddefault void
setSelectedLocale
(String language) Convenience method.void
setSelectedLocale
(Locale locale) Set the locale to use for display and editing
-
Method Details
-
isComplete
If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unlessisEmpty(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)
andisValid(Locale)
are identical. For implementations with only one field, both methods are also always identical
-
isValid
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
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
Set the locale to use for display and editing- Parameters:
locale
-
-
setSelectedLocale
Convenience method. CallssetSelectedLocale(Locale)
with theLocale
given by the passed argument- Parameters:
language
-
-
isDefaultLocaleSelected
default boolean isDefaultLocaleSelected()- Returns:
- true if the currently selected locale is also the default locale
-
isSelected
- Parameters:
locale
-- Returns:
- return true if the currently selected locale is the given locale
-
getLocales
Get a list of all locales configured in the faces-configuration file.- Returns:
- Collection
-
getLocalesStatic
Get a list of all locales configured in the faces-configuration file- Returns:
- Collection
-
getDefaultLocale
- Returns:
- the default locale configured in the faces-configuration file
-
getCurrentLocale
- Returns:
- the locale set in the current faces context
-