简体   繁体   English

如何将数据更改为来自服务器的不同语言?

[英]how to change the data in to different language which is coming from server?

I want to provide option to the user for select or choose language, actually data stored on server is in English language .我想为用户提供选择或选择语言的选项,实际上存储在服务器上的数据是英文的。

when user choose any other language ,the whole application or app data will be change in to that selected language.当用户选择任何其他语言时,整个应用程序或应用程序数据将更改为所选语言。

I have already visited so many links for do this task .they provide solution to make individual string for all type of data and put it in to values folder .我已经访问了很多用于执行此任务的链接。它们提供了为所有类型的数据制作单个字符串并将其放入值文件夹的解决方案。

the main thing is that I want to display data in to different language which is coming throw parsing from the server!最主要的是我想用不同的语言显示数据,这些语言来自服务器的解析!

so any one has idea or logic about how to convert that data run time programmatically in android ,then plz comment it...所以任何人都有关于如何在 android 中以编程方式转换该数据运行时的想法或逻辑,然后请评论它...

any suggestion will be acceptable !!任何建议都是可以接受的!! thanx in advance...提前谢谢...

我想说最好的办法是寻找可以在请求数据时调用的翻译 API。

Feed the response data to the Translation API by Google or the Microsoft equivalent Bing Translator .将响应数据提供给 Google 或 Microsoft 等效的Bing TranslatorTranslation API For both you will need a unique API key.对于两者,您都需要一个唯一的 API 密钥。

Simple, you have to just store all languages data into backend server with some language id.很简单,您只需将所有语言数据存储到具有某种语言 ID 的后端服务器中。 Based on this language id you can dynamically display different language data in your app.根据此语言 ID,您可以在应用中动态显示不同的语言数据。

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

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