使用内部框架本地化 iOS 应用程序

发布于 2024-12-22 02:02:17 字数 218 浏览 3 评论 0原文

我们在 iOS 中有一个项目,我们添加了 NSLocalizedString() 以便对其进行本地化。 我们还有一个内部框架,我们使用它链接到该项目。我们为项目和框架编译了一个 Localized.strings 文件(在单个文件中),并且我们在名为 es.lproj 的文件夹中创建了本地化的西班牙语版本...但是本地化的字符串仅出现在项目 - 从我们框架内运行的代码没有显示本地化字符串 - 我们在这里错过了什么吗?!

We've got a project in iOS to which we've added NSLocalizedString() in order to localize it.
We also have an an in-house framework that we use which is linked in to the project. We've compiled a Localizable.strings file for both the project and the framework (in a single file) and we've created a localized Spanish version in a folder called es.lproj... However the localized strings are only appearing in the project - code which is running from within our framework are not showing the localized strings - is there something we've missed here?!

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

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

发布评论

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

评论(1

玩套路吗 2024-12-29 02:02:17

尝试使用 NSLocalizedStringFromTable()。

请参阅以下问题:

在多个文件中分割本地化

注意: Localized.strings 文件不会被编译,而是作为资源添加到应用程序中。
在运行时获取正确的字符串。

Try using NSLocalizedStringFromTable().

See the following question:

Split localization in many files

Note: that the Localized.strings files are not compiled but added as resources in the application.
The correct string is fetched during runtime.

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