NSString *loc = @"zh-Hans"; if (![self isChinese]) { loc = @"en"; } NSString *path = [[NSBundle mainBundle] pathForResource:_file ofType:@"strings" inDirectory:nil forLocalization:loc]; // compiled .strings file becomes a "binary property list" NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; NSString *str = [dict objectForKey:_key]; if (str) { return str; } return _key;
然後用NSNotificationCenter去實現內容更新