Search code examples
iosobjective-ciphonelocalizationios8

IOS 8 NSLocationAlwaysUsageDescription custom translation


I understood that I can have localized NSLocationAlwaysUsageDescription text using standard iOS localization mechanism. Since we are using our custom dynamic localisation mechanism I wonder if there is another way to translate that string. I thought of editing application info.plist file on app start, but it seems to be read only.

Can I change this value from withing the app?


Solution

  • There's no way to use a custom localisation system with the info.plist strings.

    That part of your app will have to use iOS's default localisation mechanism.

    This is how to localise the location request description with iOS's built in strings file localisation system.

    // English.strings file
    "NSLocationAlwaysUsageDescription" = "English description";
    
    // AnotherLanguage.strings
    "NSLocationAlwaysUsageDescription" = "ajbdknfuied wibnrf";
    

    EDIT: At everyone down voting me. The question asked about using a custom "custom localisation system". They explicitly said they did not want to use the built in localisation system, but instead their own custom one. That is why I said it was impossible.

    Localising NSLocationAlwaysUsageDescription is completely possible. Using your own custom localisation system to do it is not.