更改 iPhone 应用程序中从 xml 文件获取的文本的语言

发布于 12-16 13:25 字数 78 浏览 1 评论 0原文

我已经做了一个反馈获取应用程序,我从 xml 文件中获取问题。现在我需要根据设备上选择的语言更改语言。我应该手动翻译它还是有什么办法 提前致谢

I have done a feedback taking app , where im taking the questions from a xml file.Now i need to change the language with respect to the language selected on the device.Should i translate it manually or is there any way
thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嗼ふ静2024-12-23 13:25:21

如果是静态问题,您可以在项目中使用本地化的字符串。
另外,如果您通过 XML 从服务器获取问题,那么您可以要求服务器以所需的语言发送问题。您可以使用 NSLocale 获取当前的语言选择。

NSString * languageCode = [[NSLocale preferredLanguages] objectAtIndex:0];

You can have localized strings in your project if it is static questions.
Else, if you getting the questions from server thru XML, then you ask the server to send the questions in the required language. You can get the current language selection using NSLocale.

NSString * languageCode = [[NSLocale preferredLanguages] objectAtIndex:0];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文