参考:

1,https://developer.apple.com/documentation/foundation/nsbundle/1417694-localizedstringforkey

2,MJRefresh

 

原理:
1,找到本地化字符串表(string table)对应的 bundle,例如,en.lproj

2,调用系统提供的在string table中值的方法

[targetBundle localizedStringForKey:key value:value table:nil];

value和table一般都是nil。

value的作用是找不到key后的提示。

如果value为nil,找不到key提示为@"" 空字符串。

value可以这样设置下

value = [NSString stringWithFormat:@"%@ 对应的本地化字符串没有在%@ 中找到",key,targetBundle];

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.

 

tableName传入nil,会在bundle的Localizable.strings里查找。

 

相关文章:

  • 2021-09-01
  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2021-06-30
  • 2021-05-21
猜你喜欢
  • 2021-12-22
  • 2022-01-20
  • 2022-12-23
  • 2021-06-10
  • 2022-12-23
  • 2021-12-25
  • 2022-12-23
相关资源
相似解决方案