如何在iOS 6.0中使用谷歌翻译API?我试着在谷歌上搜索文档,并试图研究它,但我找不到任何更新的东西,因为谷歌使api不再免费。
我唯一能找到的就是这个,但它并没有多大帮助,因为我需要使用我拥有的api密钥,但我不知道如何使用。
http://www.raywenderlich.com/1448/how-to-translate-text-with-google-translate-and-json-on-the-iphone
发布于 2012-12-08 01:22:12
这似乎是最新的:https://developers.google.com/translate/v2/getting_started
(完全是meta:哦!无法提交您的答案,因为:正文必须至少包含30个字符;您输入了23个字符)
发布于 2014-08-22 02:35:30
是的,是这样的。一旦你拿到你的Google key,只需将它插入FGTranslator。请注意,生成一个“服务器”密钥,因为Google Translate API目前不支持iOS密钥。
在此之后,只需一行调用转换函数即可。
FGTranslator *translator = [[FGTranslator alloc] initWithGoogleAPIKey:@"your_google_key"];
[translator translateText:@"Bonjour!"
completion:^(NSError *error, NSString *translated, NSString *sourceLanguage)
{
NSLog(@"translated from %@: %@", sourceLanguage, translated);
}]; https://stackoverflow.com/questions/13754368
复制相似问题