Interface AutoTranslateMergeService
-
- All Known Implementing Classes:
AutoTranslateMergeServiceImpl
public interface AutoTranslateMergeService
Service for handling merge operations related to auto-translation. Provides methods to retrieve properties for resources in the context of translations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AutoTranslateMergeService.AutoTranslateProperty
Represents a translated property associated with a resource.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<AutoTranslateMergeService.AutoTranslateProperty>
getProperties(org.apache.sling.api.resource.Resource resource)
Recursively finds all properties from the given resource and its children that have names starting withAITranslatePropertyWrapper.AI_NEW_TRANSLATED_SUFFIX
and creates the AI Translate Property Wrapper for each.String
intelligentMerge(String language, org.apache.sling.api.resource.Resource resource, String originalSource, String newSource, String newTranslation, String currentText)
void
saveTranslation(org.apache.sling.api.resource.Resource resource, String propertyName, String content, boolean markAsMerged)
Saves the new content to a property.
-
-
-
Method Detail
-
getProperties
List<AutoTranslateMergeService.AutoTranslateProperty> getProperties(org.apache.sling.api.resource.Resource resource)
Recursively finds all properties from the given resource and its children that have names starting withAITranslatePropertyWrapper.AI_NEW_TRANSLATED_SUFFIX
and creates the AI Translate Property Wrapper for each.- Parameters:
resource
- the root resource to start property extraction from.- Returns:
- a list of AutoTranslateProperty instances with translation details.
-
saveTranslation
void saveTranslation(@Nonnull org.apache.sling.api.resource.Resource resource, @Nonnull String propertyName, @Nonnull String content, @Nonnull boolean markAsMerged) throws com.day.cq.wcm.api.WCMException
Saves the new content to a property.- Parameters:
resource
- the resource to save the translation to.propertyName
- the name of the property to save the translation to.content
- the new content to save.markAsMerged
- whether to mark the property as merged- Throws:
com.day.cq.wcm.api.WCMException
-
-