iOS Localization (Localizable.strings) not working

前端 未结 5 500
慢半拍i
慢半拍i 2021-01-05 12:12

I have an app with an \"Error\" message. I want to translate this error message.

OK, first I created a file named \"Localizable.strings\". In the file I wrote:

5条回答
  •  悲&欢浪女
    2021-01-05 12:45

    If localized string doesn’t show up, there might be another Localizable.strings in the pods so:

    1 - Change “Localizable.strings" name to, say, Localized.strings

    2 - Specify it as the tableName argument

    let myStr = NSLocalizedString("key", tableName: "Localized", comment: "comment")
    

提交回复
热议问题