google-api-translate-java 是 Java 语言对Google翻译引擎的封装类库,使用方法如下:
import com.google.api.translate.Language; import com.google.api.translate.Translate; public class Main { public static void main(String[] args) { try { String translatedText = Translate.translate("Salut le monde", Language.FRENCH, Language.ENGLISH); System.out.println(translatedText); } catch (Exception ex) { ex.printStackTrace(); } } }
更多的例子:http://code.google.com/p/google-api-translate-java/wiki/ExampleUsage