首页 > 解决方案 > 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这样的本地化字符串文件吗?

标签: ioscobjective-clocalization

解决方案


推荐阅读