ios - c文件可以读取Xcode中的本地化字符串吗?
问题描述
App 是用 Objective-c 编写的,但它也需要一些 c 文件。并且 c 文件包含一些需要本地化的字符串。如:
sprintf("%dx%d, %d balls", w, h, ballCount);
printf("Hello");
通常 Objective-c 可以像这样得到本地化的字符串:
NSString* text = [NSString stringWithFormat: NSLocalizedString(@"%dx%d, %d balls",@""), w, h, ballCount];
NSString* text2 = NSLocalizedString(@"Hello",@"");
Localizable.strings
"%dx%d, %d balls" = "%dx%d, %d couilles";
"Hello" = "Bonjour";
c文件可以读取像Objective-c这样的本地化字符串文件吗?
解决方案
推荐阅读
- django - 我想知道django是否可以动态添加html标签,就像javascrip一样
- api - 关于创建自定义文件存储服务的建议
- javascript - 在Javascript中使用带有数字的charAt
- php - 无法在 php 中读取/写入文件
- algorithm - 我需要帮助来创建一个算法以从数字列表中返回可能的数字组列表
- reactjs - 如何从反应中的函数调用另一个文件中的另一个类组件
- sql - 更新查询损坏字符
- angularjs - 通过 $http 服务进行基于 AngularJS 令牌的身份验证
- avro - AVRO,将记录转换为数组
- tensorflow - 如何在 Keras 中实现屏蔽的 softmax 交叉熵损失函数?