Interface ITranslationStorageProvider.DictionaryStorage

All Superinterfaces:
ITranslationStorageProvider.Storage
All Known Implementing Classes:
ContextDefStorage, DbViewTermsStorage, DictionaryFileStorage
Enclosing interface:
ITranslationStorageProvider

public static interface ITranslationStorageProvider.DictionaryStorage extends ITranslationStorageProvider.Storage
The Interface for dictionary storage of translation strings. Storage should have type common this means storage provides translation common for every resource in the project.
  • Method Details

    • getType

      Description copied from interface: ITranslationStorageProvider.Storage
      Returns the type of translation storage.
      Specified by:
      getType in interface ITranslationStorageProvider.Storage
      Returns:
      the type of storage
      See Also:
    • getTranslation

      default String getTranslation(FeatureValue source, TranslateLanguage language)
      Description copied from interface: ITranslationStorageProvider.Storage
      Gets the translation from storage.
      Specified by:
      getTranslation in interface ITranslationStorageProvider.Storage
      Parameters:
      source - the source feature value
      language - the language
      Returns:
      the translation
    • setTranslation

      default void setTranslation(FeatureValue source, TranslateLanguage language, String translation, boolean autoSave)
      Description copied from interface: ITranslationStorageProvider.Storage
      Sets the translation.
      Specified by:
      setTranslation in interface ITranslationStorageProvider.Storage
      Parameters:
      source - the source feature value
      language - the language
      translation - the translation
    • removeTranslation

      default void removeTranslation(FeatureValue source, TranslateLanguage language, boolean autoSave)
      Description copied from interface: ITranslationStorageProvider.Storage
      Removes the translation from storage.
      Specified by:
      removeTranslation in interface ITranslationStorageProvider.Storage
      Parameters:
      source - the source feature value
      language - the language
    • moveTranslation

      default void moveTranslation(FeatureValue fromSource, FeatureValue toSource, TranslateLanguage language, boolean autoSave)
      Description copied from interface: ITranslationStorageProvider.Storage
      Move translation inside the storage from one key to enother.
      Specified by:
      moveTranslation in interface ITranslationStorageProvider.Storage
      Parameters:
      fromSource - the source feature value to move from
      toSource - the source feature value to move to
      language - the language
    • getTranslation

      String getTranslation(TranslationKey key, TranslateLanguage language)
      Gets the translation from the dictionary storage.
      Parameters:
      key - the translation key, cannot be null.
      language - the language, cannot be null.
      Returns:
      the translation, can return null.
    • setTranslation

      void setTranslation(TranslationKey key, TranslateLanguage language, String translation, boolean autoSave)
      Sets the translation of dictionary storage.
      Parameters:
      key - the translation key, cannot be null.
      language - the language, cannot be null.
      translation - the translation, can be null.
      Throws:
      ModelValueAlreadyInUseException - if translation for model feature is already set for another key
    • saveFiles

      Map<org.eclipse.core.resources.IFile,byte[]> saveFiles(TranslateLanguage language, com.google.common.hash.HashFunction hashFunction)
      TODO JavaDoc
      Parameters:
      language -
      hashFunction -
      Returns:
    • removeTranslation

      void removeTranslation(TranslationKey key, TranslateLanguage language, boolean autoSave)
      Removes the translation.
      Parameters:
      key - the translation key, cannot be null.
      language - the language, cannot be null.
    • moveTranslation

      void moveTranslation(TranslationKey fromKey, TranslationKey toKey, TranslateLanguage language, boolean autoSave)
      Move translation from one key to another inside this single storage. Attantion! Implementation should move the comment of source translation key to new one.
      Parameters:
      fromKey - the from translation key, cannot be null.
      toKey - the to translation key, cannot be null.
      language - the language, cannot be null.
    • getComment

      default String getComment(TranslationKey key, TranslateLanguage language)
      Gets the comment by the translation key.
      Parameters:
      key - the key, cannot be null.
      language - the language, cannot be null.
      Returns:
      the comment, can return null.
    • setComment

      default void setComment(TranslationKey key, TranslateLanguage language, String comment, boolean autoSave)
      Sets the comment for some translation key.
      Parameters:
      key - the translation key, cannot be null.
      language - the language, cannot be null.
      comment - the comment, can be null.
    • removeComment

      default void removeComment(TranslationKey key, TranslateLanguage language, boolean autoSave)
      Removes the comment of the translation key.
      Parameters:
      key - the translation key, cannot be null.
      language - the language, cannot be null.
    • moveComment

      default void moveComment(TranslationKey fromKey, TranslationKey toKey, TranslateLanguage language, boolean autoSave)
      Move only comment from one translation key to another. Note! The translation value of the source key will not move with it's comment.
      Parameters:
      fromKey - the from translation key, cannot be null.
      toKey - the to translation key, cannot be null.
      language - the language, cannot be null.
    • hasKeyForValue

      boolean hasKeyForValue(String value, TranslateLanguage language, TranslationKey skipKey)
      Checks that dictionary has key for the value except the given skip key.
      Parameters:
      value - the value, cannot be null.
      language - the translate language, cannot be null.
      skipKey - the key which need to skip in the check, can be null.
      Returns:
      true, if storage has key for the value