IOS 8 NSLocationAlwaysUsageDescription own translation

I realized that I have localized NSLocationAlwaysUsageDescription text using the standard IOS localization engine. Since we use our dynamic localization mechanism, I wonder if there is another way to translate this line. I was thinking about editing the info.plist application file when the application started, but it seems to be read-only.

Can I change this value using the application?

+6
source share
2 answers

It is not possible to use a custom localization system using info.plist strings.

This part of your application will need to use the default localization engine of iOS.

Here's how to localize your location request description using iOS, which is built into the file localization system.

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

EDIT: Everyone votes me. The question was asked about using a custom "user localization system." They directly stated that they did not want to use the built-in localization system, but instead their own. That is why I said that this is impossible.

Localization of NSLocationAlwaysUsageDescription is quite possible. Using your own localization system for this is not.

+8
source

There is a way. Add a new Strings file called "InfoPlist". Then localize it using the Localize button in the attribute inspector and add localizations to the InfoPlist keys. To localize the CLLocation presale description, add the appropriate key and loacalised value to each version.

 //English file "NSLocationAlwaysUsageDescription" = "English description"; 

_

 //Polish file "NSLocationAlwaysUsageDescription" = "Polski opis"; 
+13
source

Source: https://habr.com/ru/post/977477/


All Articles