iOS Localization (Localizable.strings) not working

前端 未结 5 497
慢半拍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:48

    I had the same problem. I stared at it for days, until I peeked into the app bundle and saw that none of my .strings files were copied...

    The solution is to create a build phase to copy the string files: (adapted from here)

    1. Goto Target\Build phases
    2. Click "Add build phase" button and select "Copy files"
    3. select "Resources" in "Copy files" phase
    4. add Localizable.strings and any other string files in the project.

    TADA!

提交回复
热议问题