Interface TranslationService
- All Known Implementing Classes:
TranslationServiceImpl
public interface TranslationService
- Author:
- Filip Hrisafov
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new translation for the given scoped object.voidcreateTranslations(List<TranslationCreateRequest> requests) Batch-create new translations.voiddeleteByScopeIdAndScopeType(String scopeId, String scopeType) Delete translation values for the given scope id and scope type.voiddeleteByScopeIdsAndScopeType(Collection<String> scopeIds, String scopeType) Delete translation values for the given scope ids and scope type.findByScopeIdAndScopeType(String scopeId, String scopeType) Find all translations for the given scope id and scope type.Create or update a translation for the given scoped object.updateValue(String translationId, String value) Update the translation with the given value
-
Method Details
-
createTranslationQuery
TranslationQuery createTranslationQuery() -
save
Create or update a translation for the given scoped object.- Parameters:
scopeId- the id of the scoped object for the translationscopeType- the type of the scoped object for the translationkey- the key of the translationlocale- the locale of the translationvalue- the translation value- Returns:
- the created or updated translation
-
updateValue
Update the translation with the given value- Parameters:
translationId- the id of the translation that should be updatedvalue- the new value of the translation- Returns:
- The updated translation
-
findByScopeIdAndScopeType
Find all translations for the given scope id and scope type.- Parameters:
scopeId- the scope id for which to find translationsscopeType- the scope type for which to find translations- Returns:
- the translations for the given scope
-
deleteByScopeIdAndScopeType
-
deleteByScopeIdsAndScopeType
Delete translation values for the given scope ids and scope type.- Parameters:
scopeIds- the scope ids for which to delete translationsscopeType- the scope type for which to delete translations
-
createTranslation
Translation createTranslation(String scopeId, String scopeType, String key, String locale, String value) Create a new translation for the given scoped object. Unlikesave(String, String, String, String, String), this method does not check for existing translations and always creates a new entry. Use this when you know the translation does not exist yet.- Parameters:
scopeId- the id of the scoped object for the translationscopeType- the type of the scoped object for the translationkey- the key of the translationlocale- the locale of the translationvalue- the translation value- Returns:
- the created translation
-
createTranslations
Batch-create new translations. Unlikesave(String, String, String, String, String), this method does not check for existing translations and always creates new entries. All translations are processed in a single command for optimal performance.- Parameters:
requests- the list of translations to create
-