设置bundle包中的默认语言

都只能获取中文

1,

#define VivienResourceBundle [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"Vivien" ofType:@"bundle"]]

#define currentLanguageBundle [NSBundle bundleWithPath:[VivienResourceBundle pathForResource:[[NSLocale preferredLanguages] objectAtIndex:0] ofType:@"lproj"]]

#define An1LocalizedString(key, comment)  NSLocalizedStringFromTableInBundle(key,@"Root",currentLanguageBundle,@"")

 

2,

#define VivienResourceBundle [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"Vivien" ofType:@"bundle"]]

#define currentLanguageBundle  [NSBundle bundleWithPath:[VivienResourceBundle pathForResource:@"en" ofType:@"lproj"]]

#define An2LocalizedString(key, comment)   [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"Vivien"  ofType:@"bundle"]] localizedStringForKey:(key) value:comment table:@"Root"]

 

3,

#define VivienResourceBundle [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"Vivien" ofType:@"bundle"]]

#define VivienResourceBundle_Language(lang)  [NSBundle bundleWithPath:[VivienResourceBundle pathForResource:(lang) ofType:@"lproj"]]

#define VivienResourceBundle_DefaultLanguage  [NSBundle bundleWithPath:[VivienResourceBundle pathForResource:@"en" ofType:@"lproj"]]

//#define AtmobotLocalizedString(key) [VivienResourceBundle_Language([InternationalControl userLanguage]) localizedStringForKey:(key) value:nil table:@"Root"]

#define An3LocalizedString(key) [VivienResourceBundle_DefaultLanguage localizedStringForKey:(key) value:nil table:@"Root"]

posted @ 2016-11-24 16:25  尘恍若梦  阅读(180)  评论(0编辑  收藏  举报