开发者

How to call Localization.string file content

How can I get the key value from the Localizati开发者_JAVA百科on.string file on iPhone?


You can use NSLocalizedString(@"Your_Localized_String_Name",@"");


You need to name your strings file "Localizable.strings" exactly if you want to use the easy default behaviour described there. Otherwise, you need to provide the name of the strings file.

In your case, the code would be more like:

NSBundle *thisBundle = [NSBundle bundleForClass:[self class]];

    NSString *locString = [thisBundle
        localizedStringForKey:assortedKeys[keyIndex++]
        value:@"No translation" table:@"Localization"];

If, and only if you rename Localization.string to Localization.strings

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜