Class MultiLanguageValue
java.lang.Object
io.goobi.viewer.model.translations.MultiLanguageValue
- All Implemented Interfaces:
IPolyglott
- Author:
- florian
-
Constructor Summary
ConstructorDescriptionMultiLanguageValue
(String label, Locale initialLocale, Collection<Locale> locales) -
Method Summary
Modifier and TypeMethodDescriptionGet a list of all locales configured in the faces-configuration file.getTranslation
(Locale locale) getValue()
getValueForLocale
(Locale locale) boolean
boolean
isComplete
(Locale locale) If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unlessIPolyglott.isEmpty(Locale)
also returns trueboolean
If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' classboolean
Only meaningfull for the default language for which all required fields must be filledmap()
void
setSelectedLocale
(Locale locale) Set the locale to use for display and editingvoid
void
setValueForLocale
(Locale locale, String value) stream()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.goobi.viewer.model.translations.IPolyglott
isDefaultLocaleSelected, isSelected, setSelectedLocale
-
Constructor Details
-
MultiLanguageValue
-
-
Method Details
-
isComplete
Description copied from interface:IPolyglott
If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unlessIPolyglott.isEmpty(Locale)
also returns true- Specified by:
isComplete
in interfaceIPolyglott
- Returns:
- true if
IPolyglott.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,IPolyglott.isComplete(Locale)
andIPolyglott.isValid(Locale)
are identical. For implementations with only one field, both methods are also always identical
-
isValid
Description copied from interface:IPolyglott
Only meaningfull for the default language for which all required fields must be filled- Specified by:
isValid
in interfaceIPolyglott
- Returns:
- true if all required fields contain a value in the given locale
-
getSelectedLocale
- Specified by:
getSelectedLocale
in interfaceIPolyglott
- Returns:
- the locale currently set by
IPolyglott.setSelectedLocale(Locale)
-
setSelectedLocale
Description copied from interface:IPolyglott
Set the locale to use for display and editing- Specified by:
setSelectedLocale
in interfaceIPolyglott
-
getSelectedTranslation
- Returns:
- the translation for the selected locale. Create a new translation if none exists
-
getTranslation
- Parameters:
locale
-- Returns:
- the translation for the given language if one exists
-
getLocales
Description copied from interface:IPolyglott
Get a list of all locales configured in the faces-configuration file.- Specified by:
getLocales
in interfaceIPolyglott
- Returns:
- Collection
-
setValue
-
getValue
-
setValueForLocale
-
getValueForLocale
-
stream
-
map
-
hasLocale
- Parameters:
locale
-- Returns:
- true if this list has an entry for the given locale
-
isEmpty
Description copied from interface:IPolyglott
If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class- Specified by:
isEmpty
in interfaceIPolyglott
- Returns:
- true if no fields are filled for the given locale
-