// http://code.google.com/p/google-api-translate-java/
import com.google.api.translate.Language;
import com.google.api.translate.Translate;
public class Main {
public static void main(String[] args) throws Exception {
// Set the HTTP referrer to your website address.
Translate.setHttpReferrer(/* Enter the URL of your site here */);
String translatedText = Translate.execute("Bonjour le monde", Language.FRENCH, Language.ENGLISH);
System.out.println(translatedText);
}
}
google-api-translate-java
最新推荐文章于 2025-04-14 13:58:04 发布
本文介绍了一种利用Google翻译API实现文本从一种语言到另一种语言转换的方法。通过一个Java示例程序展示了如何将法语文本Bonjour le monde翻译成英文。
957

被折叠的 条评论
为什么被折叠?



