Interface AutomaticTranslationService
public interface AutomaticTranslationService
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnector(AutomaticTranslationComponentPlugin translationConnector) Add a translation connectorGet current Active connectorGet the actual configurationGet available connectors listbooleanReturn if the feature is activevoidsetActiveConnector(String name) Set the active connectorvoidSet the apiKey for the provided connectorTranslate 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
-
isFeatureActive
boolean isFeatureActive()Return if the feature is active- Returns:
- true if the feature is active
-