Class TranslationGroup
java.lang.Object
io.goobi.viewer.model.translations.admin.TranslationGroup
Translation group configuration item.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TranslationGroup
create
(int id, TranslationGroup.TranslationGroupType type, String name, String description, int numItems) Factory method.boolean
boolean
int
Returns the number of entries which finished (non-zzz) translations for all languages.double
int
getId()
getItems()
getName()
Returns the number of entries which finished (non-zzz) translations for at least one but less than all languages.double
int
getType()
double
int
hashCode()
boolean
boolean
boolean
static boolean
Check whether the application has write access to all local messages files as well as the containing folder if any languages have no local message file.boolean
boolean
void
Sets the nextMessageEntry
element in the list active.void
Sets the previousMessageEntry
element in the list active.void
Sets selectedEntry to null without prior saving.void
Resets the counts for fully translated and untranslated entries to update the translation processvoid
Persists the edited values ofselectedEntry
to all language messages.properties files.void
setFilterString
(String filterString) void
setLoadError
(boolean loadError) void
setNewEntryMode
(boolean newEntryMode) void
setSelectedEntry
(MessageEntry selectedEntry) void
setSelectedEntryIndex
(int selectedEntryIndex)
-
Method Details
-
create
public static TranslationGroup create(int id, TranslationGroup.TranslationGroupType type, String name, String description, int numItems) Factory method.- Parameters:
id
- unique ID numbertype
-name
-description
-numItems
-- Returns:
- Created
TranslationGroup
-
hashCode
public int hashCode() -
equals
-
findEntryByMessageKey
- Parameters:
key
- Message key to find- Returns:
- true if message entry was found or added; false if no matching group item could be found
-
getId
public int getId()- Returns:
- the id
-
getType
- Returns:
- the type
-
getName
- Returns:
- the name
-
getDescription
- Returns:
- the description
-
getItems
- Returns:
- the keys
-
getEntryCount
public int getEntryCount()- Returns:
- Number of unique message keys across all groups
-
getUntranslatedEntryCount
- Returns:
- Number of entries with no translations at all
-
getPartiallyTranslatedEntryCount
Returns the number of entries which finished (non-zzz) translations for at least one but less than all languages.- Returns:
- Number of partially translated entries
-
getFullyTranslatedEntryCount
Returns the number of entries which finished (non-zzz) translations for all languages.- Returns:
- Number of fully translated entries
-
getUntranslatedEntryCountPercentage
public double getUntranslatedEntryCountPercentage()- Returns:
- Percentage represented by untranslated entries
-
getPartiallyTranslatedEntryCountPercentage
public double getPartiallyTranslatedEntryCountPercentage()- Returns:
- Percentage represented by partially translated entries
-
getFullyTranslatedEntryCountPercentage
public double getFullyTranslatedEntryCountPercentage()- Returns:
- Percentage represented by fully translated entries
-
isFullyTranslated
public boolean isFullyTranslated()- Returns:
- true if all entries are fully translated; false otherwise
-
isAllFilteredEntriesFullyTranslated
public boolean isAllFilteredEntriesFullyTranslated()- Returns:
- true if all entries in the filtered list are fully translated; false otherwise
-
isHasEntries
public boolean isHasEntries()- Returns:
- true if the allEntries list for this group is not empty; false otherwise
-
getFilteredEntries
- Returns:
- List
-
getAllEntries
- Returns:
- Unique message keys across all groups
-
getSelectedEntry
- Returns:
- the selectedEntry
-
setSelectedEntry
- Parameters:
selectedEntry
- the selectedEntry to set
-
resetSelectedEntry
public void resetSelectedEntry()Sets selectedEntry to null without prior saving. -
getSelectedEntryIndex
public int getSelectedEntryIndex()- Returns:
- the selectedMessageEntryIndex
-
setSelectedEntryIndex
public void setSelectedEntryIndex(int selectedEntryIndex) - Parameters:
selectedEntryIndex
- the selectedEntryIndex to set
-
getFilterString
- Returns:
- the filterString
-
setFilterString
- Parameters:
filterString
- the filterString to set
-
isLoadError
public boolean isLoadError()- Returns:
- the loadError
-
setLoadError
public void setLoadError(boolean loadError) - Parameters:
loadError
- the loadError to set
-
isNewEntryMode
public boolean isNewEntryMode()- Returns:
- the newEntryMode
-
setNewEntryMode
public void setNewEntryMode(boolean newEntryMode) - Parameters:
newEntryMode
- the newEntryMode to set
-
prevEntry
public void prevEntry()Sets the previousMessageEntry
element in the list active. -
nextEntry
public void nextEntry()Sets the nextMessageEntry
element in the list active. -
saveSelectedEntry
public void saveSelectedEntry()Persists the edited values ofselectedEntry
to all language messages.properties files. -
isHasFileAccess
public static boolean isHasFileAccess()Check whether the application has write access to all local messages files as well as the containing folder if any languages have no local message file. The tested languages are taken fromViewerResourceBundle.getAllLocales()
- Returns:
- true if all required access rights to edit messages are present. false otherwise
-
resetStatusCount
public void resetStatusCount()Resets the counts for fully translated and untranslated entries to update the translation process
-