Interface AutomaticTranslationService
public interface AutomaticTranslationService
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnector(AutomaticTranslationComponentPlugin translationConnector) Add a translation connectorGet current Active connectorGet the actual configurationGet available connectors listGet features options for automatic translationsbooleanReturn if the feature is activevoidsetActiveConnector(String name) Set the active connectorvoidSet the apiKey for the provided connectorvoidsetFeaturesOptions(AutomaticTranslationFeaturesOptions featuresOptions) Set the features options for automatic translationsTranslate a message in the provided locale, by using the active connector
-
Method Details
-
addConnector
Add a translation connector- Parameters:
translationConnector- The connector to add
-
getConnectors
Map<String,AutomaticTranslationComponentPlugin> getConnectors()Get available connectors list- Returns:
- The connector list
-
getConfiguration
AutomaticTranslationConfiguration getConfiguration()Get the actual configuration- Returns:
- The configuration
-
getActiveConnector
String getActiveConnector()Get current Active connector- Returns:
- The connector name
-
setActiveConnector
Set the active connector- Parameters:
name- The connector name to activate
-
setApiKey
Set the apiKey for the provided connector- Parameters:
connector- The connector nameapikey- The apikey to set
-
translate
Translate a message in the provided locale, by using the active connector- Parameters:
message- The message to translatetargetLang- The locale in which we want to translatecontentType- The type of the content translated (activity, comment, news ...)spaceId- The space in which the content is present- Returns:
- The translated message
-
getFeaturesOptions
AutomaticTranslationFeaturesOptions getFeaturesOptions()Get features options for automatic translations- Returns:
- The AutomaticTranslationFeaturesOptions object
-
setFeaturesOptions
Set the features options for automatic translations- Parameters:
featuresOptions- The features Options
-
isFeatureActive
boolean isFeatureActive()Return if the feature is active- Returns:
- true if the feature is active
-