谷歌翻译API
我正在使用 Google Translator API 将英语资源文件翻译为西班牙语。我的资源文件中有大约 6000 个键。现在我正在一一传递密钥并得到结果。在对 Google 网站进行一些频繁点击(大约 1000 个按键后)后,我收到 403 服务条款滥用错误。
有没有其他方法可以将所有 6000 个关键值翻译成西班牙语?
我正在使用 GoogleTranslateAPI_0.4_alpha API,下面是代码。
ResXResourceReader rsxr = new ResXResourceReader (filename);
rsxr.UseResXDataNodes=true;
ResXDataNode node;
AssemblyName[] assemblies;
string value=string.Empty;
string comment=string.Empty;
foreach (DictionaryEntry d in rsxr)
{
node = (ResXDataNode)d.Value;
assemblies = Assembly.GetExecutingAssembly ().GetReferencedAssemblies ();
value=node.GetValue (assemblies).ToString ();
try
{
if (!string.IsNullOrEmpty (value))
{
TranslateClient client = new TranslateClient ("my proxy address");
value=client.Translate (value.ToString () ,"en" ,"es");
}
}
catch (Exception ex)
{
value="dummy";
}
}
rsxr.Close ();
I am using Google Translator API to translate English resource file to Spanish. I have around 6000 keys in my resource file. Right now I am passing keys one by one and getting the result. After some frequent hits(after some 1000 keys) to Google site I get 403 Terms of service abuse error.
Is there any other way I could translate all 6000 key values to Spanish?
I am using GoogleTranslateAPI_0.4_alpha API and below is the code.
ResXResourceReader rsxr = new ResXResourceReader (filename);
rsxr.UseResXDataNodes=true;
ResXDataNode node;
AssemblyName[] assemblies;
string value=string.Empty;
string comment=string.Empty;
foreach (DictionaryEntry d in rsxr)
{
node = (ResXDataNode)d.Value;
assemblies = Assembly.GetExecutingAssembly ().GetReferencedAssemblies ();
value=node.GetValue (assemblies).ToString ();
try
{
if (!string.IsNullOrEmpty (value))
{
TranslateClient client = new TranslateClient ("my proxy address");
value=client.Translate (value.ToString () ,"en" ,"es");
}
}
catch (Exception ex)
{
value="dummy";
}
}
rsxr.Close ();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们无法帮助您违反 Google 服务条款,因此您只能请人来做这件事。
有一些商业程序可以进行翻译,但我还没有找到任何我喜欢的或什至觉得足以胜任这项工作的程序(Google 搜索会找到其中的一些程序,您可以选择一个)。
不管怎样,机器翻译通常在用户界面上表现不佳,因为它们是针对一般对话进行调整的,而不是针对您通常在程序中找到的较短的文本块(而不是句子)(我认识的一个为该公司工作的人如此说道)谷歌)。
We can't help you violate the Google terms of service, so your bet bet is to get a human to do it.
There are commercial programs that do translation, but I have not found any I like or even feel adequately do the job (a Google search will turn up a number of them and you can pick one).
Anyway, machine translations generally don't do so well with user interfaces because they are tuned for general conversation and not for the shorter blobs of text (not sentences) that you generally find in a program (so says a guy I know who works for Google).
支付费用:
http://code.google.com/apis/language/translate/v2 /pricing.html
另请参阅 Microsoft 翻译:
https://datamarket.azure.com/dataset/1899a118-d202-492c -aa16-ba21c33c06cb
Pay for it:
http://code.google.com/apis/language/translate/v2/pricing.html
See also Microsoft Translator:
https://datamarket.azure.com/dataset/1899a118-d202-492c-aa16-ba21c33c06cb