如何通过代码从应用程序更新 localizable.strings? [英] How to update localizable.strings from app by code?

查看:18
本文介绍了如何通过代码从应用程序更新 localizable.strings?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够通过应用程序中的代码更新本地化字符串.我真正想做的是更改服务器上的本地化,然后让 iPhone 应用程序从服务器获取更新的本地化字符串,然后将它们保存到 localizable.strings 文件中.

I want to be able to update localized strings by code from the app. What I actually want to do is to make changes to the localization on a server and then let the iPhone application fetch updated localization strings from a server and then save them to the localizable.strings file.

推荐答案

你不能!这些文件是捆绑包的一部分,无法更新.您必须自己设置整个翻译框架(这不是很多工作)并使用核心数据或序列化字典(我想每种语言一个)实现缓存.

You can't ! Those files are part of the bundle and can't be updated. You will have to setup the whole translation framework by yourself (which is not that much work) and implement caching using either core data or serialized dictionaries (one for each language I suppose).

这篇关于如何通过代码从应用程序更新 localizable.strings?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆