NSLocationWhenInUseUsageDescription localization using .strings file not working

前端 未结 3 421
孤街浪徒
孤街浪徒 2021-01-11 12:39

I\'ve completed translating my app to Turkish using Base Localization. However, I also need to translate NSLocationWhenInUseUsageDescription key in my Info.plis

3条回答
  •  自闭症患者
    2021-01-11 13:19

    Here's what ended up working for me in Xcode 7.1.

    First, go to project directory and manually create two InfoPlist.strings files, the first inside the en.lproj folder and the second inside the fr.lproj folder.

    Both files should have the following content :

    NSLocationWhenInUseUsageDescription = "YOUR TEXT HERE";
    

    Since the files won't show up automatically in Xcode, you have to manually add both to the project bundle, this can be achieve via right-clicking the project name in Xcode and choosing the Add files to X option, then selecting the files you just created.


    Also if you want to test the result & make sure things work, changing the Application Language in Edit Scheme > Run > Options isn't enough.

    You need to change the simulator or the device language via Settings > General > Language & Region > iPhone Language

提交回复
热议问题