我想知道是否有办法将谷歌翻译整合到我正在制作的Java程序中。我用Eclipse。我做了一些事情,但现在我完全迷失了(在编程时我只是一个新手)。
到目前为止我的进展: - 我有一个谷歌翻译API密钥。 - 我获得了eclipse的“google tab”并安装了Translate API。
我也下载了“Google CLoud SDK shell”,但现在我不确定该怎么做。
帮助我完成这些步骤,我们将不胜感激!
谢谢!
答案 0 :(得分:2)
我建议您在此处查看google-api-services-translate-v2: https://developers.google.com/api-client-library/java/apis/translate/v2
基本上,如果您使用maven,则必须添加此依赖项:
Column not found: 1054 Unknown column 'country.name' in 'where clause' (SQL: select count(*) as aggregate from `posts` where `country`.`name` = Albania)
然后你可以使用它:
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-translate</artifactId>
<version>v2-rev48-1.22.0</version>
</dependency>
您可以在此处找到示例:https://developers.google.com/api-client-library/java/google-api-java-client/samples