public class GoogleTranslateService extends Object implements ITranslator
ERROR_PREFIX| Constructor and Description |
|---|
GoogleTranslateService() |
| Modifier and Type | Method and Description |
|---|---|
static ITranslator |
getTranslator() |
String |
translate(ContentContext ctx,
String text,
String sourceLang,
String targetLang) |
static String |
translate(String sourceText,
String sourceLang,
String targetLang,
String apiKey)
Translate the source text from source to target language.
|
public static String translate(String sourceText, String sourceLang, String targetLang, String apiKey) throws Exception
sourceText - source text to be translatedsourceLang - source language of the texttargetLang - target language of translated textExceptionpublic static final ITranslator getTranslator()
public String translate(ContentContext ctx, String text, String sourceLang, String targetLang)
translate in interface ITranslatorCopyright © 2012-2018. All Rights Reserved.