@Test public void test() throws IOException { GoogleTranslateApi service = new GoogleTranslateApi(); String result = service.translate("Hi there", "ja"); assertThat(result, is("こんにちは")); }
public String translate(String text, String lang) { Translation translationResult = translateApi.translate(text, TranslateOption.targetLanguage(lang)); return translationResult.getTranslatedText(); }
GoogleTranslateApi { public String translate(String text, String lang) { Translation translationResult = translateApi.translate(text, TranslateOption.targetLanguage(lang)); return translationResult.getTranslatedText(); } }
GoogleTranslateApi { public String translate(String text, String lang) { Translation translationResult = translateApi.translate(text, TranslateOption.targetLanguage(lang)); return translationResult.getTranslatedText(); } GoogleTranslateApi(); }
GoogleTranslateApi { public String translate(String text, String lang) { Translation translationResult = translateApi.translate(text, TranslateOption.targetLanguage(lang)); return translationResult.getTranslatedText(); } GoogleTranslateApi(); String translate(String text, String lang); }
GoogleTranslateApi { public String translate(String text, String lang) { Translation translationResult = translateApi.translate(text, TranslateOption.targetLanguage(lang)); return translationResult.getTranslatedText(); } GoogleTranslateApi(); String translate(String text, String lang);  }