动态添加新的语言字符串文件,以便在iOS中进行本地化

动态添加新的语言字符串文件,以便在iOS中进行本地化,ios,xcode,localization,internationalization,mainbundle,Ios,Xcode,Localization,Internationalization,Mainbundle,方法 我使用字符串文件实现了本地化,如下所示: 问题 这是否可以在运行时添加新的语言文件?您只需自己创建适当的捆绑目录和字符串文件,并使用更长版本的NSLocalizedString即可 亚历杭德罗·马丁内斯的一篇文章: // The two important new parameters are `tableName` and `bundle`. // By default when using NSLocalizedString the system uses the App //

方法 我使用字符串文件实现了本地化,如下所示:

问题


这是否可以在运行时添加新的语言文件?

您只需自己创建适当的捆绑目录和字符串文件,并使用更长版本的NSLocalizedString即可

亚历杭德罗·马丁内斯的一篇文章:

// The two important new parameters are `tableName` and `bundle`. 
// By default when using NSLocalizedString the system uses the App 
// main bundle and the Localizable table, *table* meaning the name 
// of the strings file. So to hook into the localization system we 
// just need to convert the object structure that we have in memory 
// to the proper file hierarchy that is expected on disk.
NSLocalizedString(_ key: String, tableName: String? = default, 
  bundle: Bundle = default, value: String = default, comment: String)
  -> String

@这不是我想要的。我想添加上面问题中提到的新语言文件。