2011-05-18 60 views

回答

1

谷歌翻译的url方案是 googletranslate://

+0

它运作良好。谢谢! :d – Joey 2013-09-05 08:36:24

2

我不知道用什么谷歌URL方案支持的翻译应用,但你可以使用这个打开iTranslate应用程序 -

要启动应用程序:

NSString *stringURL = @"itranslate://"; 
NSURL *url = [NSURL URLWithString:stringURL]; 
[[UIApplication sharedApplication] openURL:url]; 

要翻译的文字:

NSString *textToTranslate = @"Hello world"; // Text must be URL-encoded...! 
textToTranslate = [textToTranslate stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 
NSString *test = [NSString stringWithFormat:@"itranslate://translate?from=en&to=de&text=%@",textToTranslate]; 
NSURL *url = [[NSURL alloc] initWithString:test]; 
[[UIApplication sharedApplication] openURL:url]; 

也对这个一看 - http://wiki.akosma.com/IPhone_URL_Schemes

+0

谢谢。所以我需要首先知道谷歌翻译的网址方案。 – Joey 2011-05-20 09:04:33