iOS本地化/国际化

本地化

其他可以参考
http://www.cocoachina.com/ios/20170122/18609.html

   /*
     key
     The key for a string in the table identified by tableName.
     value
     The value to return if key is nil or if a localized string for key can’t be found in the table.
     tableName
     The receiver’s string table to search. If tableName is nil or is an empty string, the method attempts to use the table in Localizable.strings
     */
NSString *title = [[NSBundle mainBundle] localizedStringForKey:@"cancle" value:@"" table:nil];
NSString *title = NSLocalizedStringFromTable(@"cancle", @"Test", nil);

系统定义的宏    
NSLocalizedString(<#key#>, <#comment#>)
NSLocalizedStringFromTable(<#key#>, <#tbl#>, <#comment#>)
NSString *title = NSLocalizedStringFromTable(@"cancle", @"Test", nil);
    
[self.btn setTitle:title forState:UIControlStateNormal];

命令:

genstrings  file
genstrings 目录/* 该目录下的所有文件
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容