将 NSLocalizedString 的翻译值插入数组
我有一个包含一系列字典的 plist。
示例:
items: (array)
item0: (dictionary)
Label: (string)
Img: (string)
item1: (dictionary)
Label: (string)
Img: (string)
使用 NSLocalizedString 翻译标签。
通过这段代码,我将所有内容放入字典中,然后放入数组中。
NSString *myFile = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"plist"];
NSDictionary *dict = [[NSDictionary alloc]initWithContentsOfFile:myFile];
NSMutableArray *arr = [[NSMutableArray alloc] initWithArray:[dict objectForKey:@"Items"]];
但是,如何将直接翻译的值而不是键放入数组中?
感谢大家!
I have a plist with an array of dictionaries.
example:
items: (array)
item0: (dictionary)
Label: (string)
Img: (string)
item1: (dictionary)
Label: (string)
Img: (string)
using NSLocalizedString, the labels are translated.
With this code, I put everything in a dictionary, and after into an array.
NSString *myFile = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"plist"];
NSDictionary *dict = [[NSDictionary alloc]initWithContentsOfFile:myFile];
NSMutableArray *arr = [[NSMutableArray alloc] initWithArray:[dict objectForKey:@"Items"]];
How do I place into the array, however, the value directly translated, and not the key?
Thanks to all!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
怎么样:
How about: