Class TranslationGroup

java.lang.Object
io.goobi.viewer.model.translations.admin.TranslationGroup

public final class TranslationGroup extends Object
Translation group configuration item.
  • Method Details

    • create

      public static TranslationGroup create(int id, TranslationGroup.TranslationGroupType type, String name, String description, int numItems)
      Factory method.
      Parameters:
      id - unique ID number
      type -
      name -
      description -
      numItems -
      Returns:
      Created TranslationGroup
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • findEntryByMessageKey

      public boolean findEntryByMessageKey(String key)
      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

      public String getName()
      Returns:
      the name
    • getDescription

      public String getDescription()
      Returns:
      the description
    • getItems

      public List<TranslationGroupItem> getItems()
      Returns:
      the keys
    • getEntryCount

      public int getEntryCount()
      Returns:
      Number of unique message keys across all groups
    • getUntranslatedEntryCount

      public Integer getUntranslatedEntryCount()
      Returns:
      Number of entries with no translations at all
    • getPartiallyTranslatedEntryCount

      public Integer 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

      public Integer 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

      public List<MessageEntry> getFilteredEntries()
      Returns:
      List
    • getAllEntries

      public List<MessageEntry> getAllEntries()
      Returns:
      Unique message keys across all groups
    • getSelectedEntry

      public MessageEntry getSelectedEntry()
      Returns:
      the selectedEntry
    • setSelectedEntry

      public void setSelectedEntry(MessageEntry selectedEntry)
      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

      public String getFilterString()
      Returns:
      the filterString
    • setFilterString

      public void setFilterString(String filterString)
      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 previous MessageEntry element in the list active.
    • nextEntry

      public void nextEntry()
      Sets the next MessageEntry element in the list active.
    • saveSelectedEntry

      public void saveSelectedEntry()
      Persists the edited values of selectedEntry 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 from ViewerResourceBundle.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