Interface AutomaticTranslationService
-
public interface AutomaticTranslationService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddConnector(AutomaticTranslationComponentPlugin translationConnector)Add a translation connectorStringgetActiveConnector()Get current Active connectorAutomaticTranslationConfigurationgetConfiguration()Get the actual configurationMap<String,AutomaticTranslationComponentPlugin>getConnectors()Get available connectors listbooleanisFeatureActive()Return if the feature is activevoidsetActiveConnector(String name)Set the active connectorvoidsetApiKey(String connector, String apikey)Set the apiKey for the provided connectorStringtranslate(String message, Locale targetLang, String contentType, long spaceId)Translate a message in the provided locale, by using the active connector
-
-
-
Method Detail
-
addConnector
void addConnector(AutomaticTranslationComponentPlugin translationConnector)
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
void setActiveConnector(String name)
Set the active connector- Parameters:
name- The connector name to activate
-
setApiKey
void setApiKey(String connector, String apikey)
Set the apiKey for the provided connector- Parameters:
connector- The connector nameapikey- The apikey to set
-
translate
String translate(String message, Locale targetLang, String contentType, long spaceId)
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
-
-