Package com.e1c.langtool.storage
Interface IProjectTranslationReader
- All Known Implementing Classes:
ProjectTranslationReader
public interface IProjectTranslationReader
The reader allows to get single translation from the storage according to the order of project settings.
This instance may register listeners to all storage segments listed in the read settings to get change notifications.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddValueChangedListener(@NonNull IStorageValueChangedListener listener) Adds a listener for post value changes in all storages of the project.@Nullable StringgetStoredTranslation(@NonNull TranslationKey key, @NonNull TranslateLanguage language, ITranslationStorageProvider.Storage.Type... storageTypes) Gets the stored translation with the project storage settings read order.voidremoveValueChangedListener(@NonNull IStorageValueChangedListener listener) Removes the given listener for post value changes from all storages of the project.
-
Method Details
-
getStoredTranslation
@Nullable String getStoredTranslation(@NonNull TranslationKey key, @NonNull TranslateLanguage language, ITranslationStorageProvider.Storage.Type... storageTypes) Gets the stored translation with the project storage settings read order.- Parameters:
key- the key, cannot benull.language- the language, cannot benull.storageTypes- the storage types, can benullor empty array to get from all types of storages.- Returns:
- the stored translation, can return
nullif not exist.
-
addValueChangedListener
Adds a listener for post value changes in all storages of the project. Has no effect if an identical listener is already registered.- Parameters:
listener- the listener
-
removeValueChangedListener
Removes the given listener for post value changes from all storages of the project. Has no effect if an identical listener is not registered.- Parameters:
listener- the listener
-