简体   繁体   English

API调用的字符串转换

[英]String Translation from API call

I have a found a free API to get some data I need for my app. 我找到了一个免费的API来获取我的应用所需的一些数据。 The thing is the values that I get are in English. 事情是我得到的价值是英语。

I wanted to know if there is some way to translate this strings in my language before showing them to the users. 我想知道在向用户展示之前是否有某种方法可以用我的语言翻译这些字符串。

You can translate text but it will require another API call. 您可以翻译文本,但需要另外的API调用。 Not only that, but you will have to create an appropriate request object and parse a response object from your chosen API. 不仅如此,您还必须创建一个适当的请求对象,并从您选择的API中解析响应对象。

You have various API providers to choose from, the top Google hits being: 您有各种API提供商可供选择,顶级Google点击量为:

  1. Google: https://cloud.google.com/translate/ Google: https//cloud.google.com/translate/
  2. Yandex: https://tech.yandex.com/translate/ Yandex: https//tech.yandex.com/translate/

But beware! 但要小心! Machine translation is patchy at best. 机器翻译充其量不完整。 The likelihood of getting odd sounding or outright wrong results, particularly for anything other than simple text, is very high. 获得奇怪的声音或完全错误的结果的可能性非常高,尤其是除了简单文本以外的任何其他结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM