从服务器添加字符串本地化文件 [英] Adding strings localization files from a server

查看:109
本文介绍了从服务器添加字符串本地化文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在与我们所希望的本地化动态数据的应用程序。 我们知道如何字符串iOS和Android本地化,但在这种情况下,数据将被动态地从服务器下载,所以我们需要动态地下载本地化文件。

通常我们存储字符串的文件语言文件夹内。我们如何能做到这一点时,该文件是从服务器来的?

解决方案
  

我们如何能做到这一点时,该文件是从服务器来的?

您不能因为程序包是不是写在iOS设备上。

有,然而, NSLocalizedStringFromTableInBundle(),它可以让你指定一个不同的包,从中可以加载 .strings 文件。我还没有试过,但我想这包还可以驻留在您的应用程序或文档库文件夹。

We are building an application with dynamic data that we wish to localize. We know how to localize strings in iOS and Android but in this case the data will be downloaded dynamically from the server so we will need to download the localization files dynamically.

Usually we store the strings files inside language folders. how can we do that when the file is coming from the server?

解决方案

how can we do that when the file is coming from the server?

You can't because the app bundle is not writable on iOS devices.

There is, however, NSLocalizedStringFromTableInBundle(), which lets you specify a different bundle from which you can load the .strings file. I haven't tried but I suppose this bundle can also reside in your app's Documents or Library folder.

这篇关于从服务器添加字符串本地化文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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