最佳答案
您可以自己创建适当的包目录和字符串文件,并使用较长版本的 NSLocalizedString。
安approach is described here亚历杭德罗·马丁内斯:
// 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
关于ios - 动态添加新的语言字符串文件以在 iOS 中进行本地化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50810193/