Class MultiLanguageValue
java.lang.Object
io.goobi.viewer.model.translations.MultiLanguageValue
- All Implemented Interfaces:
IPolyglott
- Author:
- Florian Alpers
-
Constructor Summary
ConstructorsConstructorDescriptionMultiLanguageValue(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) booleanbooleanisComplete(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 true.booleanIf this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class.booleanOnly meaningful for the default language for which all required fields must be filled.map()voidsetSelectedLocale(Locale locale) Sets the locale to use for display and editing.voidvoidsetValueForLocale(Locale locale, String value) stream()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.goobi.viewer.model.translations.IPolyglott
isDefaultLocaleSelected, isSelected, setSelectedLocale
-
Constructor Details
-
MultiLanguageValue
-
-
Method Details
-
isComplete
Description copied from interface:IPolyglottIf 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:
isCompletein interfaceIPolyglott- Parameters:
locale- the locale to check translation completeness for- 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:IPolyglottOnly meaningful for the default language for which all required fields must be filled.- Specified by:
isValidin interfaceIPolyglott- Parameters:
locale- the locale to validate required fields for- Returns:
- true if all required fields contain a value in the given locale
-
getSelectedLocale
- Specified by:
getSelectedLocalein interfaceIPolyglott- Returns:
- the locale currently set by
IPolyglott.setSelectedLocale(Locale)
-
setSelectedLocale
Description copied from interface:IPolyglottSets the locale to use for display and editing.- Specified by:
setSelectedLocalein interfaceIPolyglott- Parameters:
locale- the locale to select
-
getSelectedTranslation
- Returns:
- the translation for the selected locale. Create a new translation if none exists
-
getTranslation
- Parameters:
locale- locale to retrieve the translation for- Returns:
- the translation for the given language if one exists
-
getLocales
Description copied from interface:IPolyglottGet a list of all locales configured in the faces-configuration file.- Specified by:
getLocalesin interfaceIPolyglott- Returns:
- Collection
-
setValue
-
getValue
-
setValueForLocale
-
getValueForLocale
-
stream
-
map
-
hasLocale
- Parameters:
locale- the locale to check- Returns:
- true if this list has an entry for the given locale
-
isEmpty
Description copied from interface:IPolyglottIf this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class.- Specified by:
isEmptyin interfaceIPolyglott- Parameters:
locale- the locale to check for empty fields- Returns:
- true if no fields are filled for the given locale
-