我想从iPhone上使用Google翻译API。
我找到的是:http://code.google.com/p/gdata-objectivec-client/
但在列表中我找不到翻译API。
我该在哪里找到这个库呢?
谢谢。
我想从iPhone上使用Google翻译API。
我找到的是:http://code.google.com/p/gdata-objectivec-client/
但在列表中我找不到翻译API。
我该在哪里找到这个库呢?
谢谢。
我为Google Translator服务编写了一个名为PLTranslator的Objective-C封装器。 请访问http://github.com/xhan/PLTranslator查看。
一旦您获得了Google密钥,只需将其插入FGTranslator即可。
FGTranslator *translator = [[FGTranslator alloc] initWithGoogleAPIKey:@"your_google_key"];
[translator translateText:@"Bonjour!"
completion:^(NSError *error, NSString *translated, NSString *sourceLanguage)
{
if (error)
NSLog(@"translation failed with error: %@", error);
else
NSLog(@"translated from %@: %@", sourceLanguage, translated);
}];