NSLocalizedString()参数“值”和“ tableName”做什么?

And*_*can 6 localization nslocalizedstring ios

Apple文档(在Xcode和网页中)都没有任何参数说明。

https://developer.apple.com/documentation/foundation/1418095-nslocalizedstring

作为参考,功能签名为

NSLocalizedString(
    _ key    : String, 
    tableName: String? = default,  // ??
    bundle   : Bundle = default, 
    value    : String = default,   // ????
    comment  : String
) -> String
Run Code Online (Sandbox Code Playgroud)

我不清楚这tableName是什么-但更多信息会有所帮助。(这仅仅是字符串文件的文件名吗?)我不知道这value是为了什么。

rma*_*ddy 6

Objective-C文档用于NSLocalizedStringWithDefaultValue解释参数:

参量

key
指定表中字符串的键。

tableName
包含键值对的表的名称。另外,字符串文件(扩展名为.strings的文件)​​的后缀用于存储本地化的字符串。

bundle
包含字符串文件的捆绑软件。

value
如果key为nil或表中找不到key的本地化字符串,则返回的值。

comment
放在字符串文件中的键值对上方的注释。

基本上,将在指定包中key命名的文件中查找tableName.strings。该字符串文件将具有以下格式:

# comment
"key" = "value"
Run Code Online (Sandbox Code Playgroud)