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://yuncode.net