Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
In my iOS app I need to localize the descriptions for the iOS alerts that appear when the user is asked for a certain right, like to use the camera or for location. The usual way to do this is to create a xx.lproj folder inside the Resources folder (where xx is the language, e. g. German is de.lproj). Inside that folder you create an InfoPlist.strings file which is a simple key value file for properties from the Info.plist file.
However, it did not work for me. I thought I did something wrong so I reread the Xamarin tutorial about iOS localisations and found the following detail here: https://developer.xamarin.com/guides/ios/advanced_topics/localization_and_internationalization/#App_name
Valid keys are only:
Keys I need to translate are:
This is an example of my InfoPlist.strings file for German translations located in my iOS project in Resources/de.lproj/InfoPlist.strings:
"NSLocationAlwaysUsageDescription" = "Wir brauchen deinen Standort um ihn deinen Kollegen auf der Karte zu zeigen. Wir nutzen deine Position ausschließlich für diesen Service.";
"NSLocationUsageDescription" = "Wir brauchen deinen Standort um deinen Kollegen deine Position auf der Karte zu zeigen. Wir nutzen deine Position ausschließlich für diesen Service.";
"NSCameraUsageDescription" = "Wir möchten gerne auf deine Kamera zugreifen, so dass du Fotos von Personen, der Farm, Maschinen und Ortsmarken machen kannst.";
"NSPhotoLibraryUsageDescription" = "Wir möchten gerne auf deine Fotogalerie zugreifen, so dass du Fotos von Personen, der Farm, Maschinen und Ortsmarken auswählen kannst.";
Nothing works, except the valid keys I listed above.
Sorry I need to update this bug. I tested very quick and thought all keys are not working. But the only key that does not work is NSLocationUsageDescription. For all other keys I get the right translation.
According to https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html NSLocationUsageDescription is no longer used as of iOS 8. It says to use NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription instead. Can you try whichever of those would apply in your case and update whether it works?
you were absolutely right. Sorry my fault for not reading the documentation carefully. This bug can be closed.
I'm facing this issue with `NSLocationAlwaysUsageDescription` key. I added the `CFBundleDisplayName` keys and values for test purposes and they worked fine, the issue seems to be with the location usage description specifically.
I'm using Xamarin Forms, the app is targeted for iOS 8 and the localization files (for iOS specific stuff) structure is as follows:
When the authorization dialog appears, it displays the content defined in Base.lproj/InfoPlist.strings. The app name is displayed correctly, fetched from pt_BR.lproj
Jose, did you do something special in your quick test? Because I already tried many different things with no success.
@Eric You don't need the Base.lproj as far as I know. Just define the text for your default language in the Info.plist file. Additionally, please ask this question on StackOverflow or in the Xamarin forums because I don't think that this is a bug that needs to be reported. This issue here is already resolved