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);

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

命令:

genstrings  file
genstrings 目錄/* 該目錄下的所有文件
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容