My new app needs access to the Contacts. This works fine if I add the info.plist file from the MBS example. However, my app is localised and I want localised reason strings. At some point this must have worked for my old app. But when I use the code below access to Contacts is denied. How do I get localised strings into the info.plist?
dim dbg as String
if debugBuild then dbg = ".debug"
dim appNameForShell as string = PropertyValue("App.MacOSXAppName") + dbg +".app" + "/Contents/Info.plist"
appNameForShell = replaceall(appNameForShell, " ", "\ ")
Dim AppPath As String = CurrentBuildLocation + "/" + ReplaceAll(CurrentBuildAppName, " ", "\ ")
if right(AppPath, 4) <> ".app" then appPath = appPath + ".app"
'contacts
dim command as String = "/bin/echo 'NSContactsUsageDescription = ""Nur Deine Email-Adresse und Dein Name werden benötigt.""; '>>" + appPath + "/Contents/Resources/de.lproj/InfoPlist.strings"
Call DoShellCommand(command)
Instead of putting localized strings directly in Info.plist, reference them using key/value strings, and provide localized versions in InfoPlist.strings files.
Use this syntax in your Info.plist for localizable values:
Got this finally solved. Greg was correct, I was missing the correct entry in the main plist file. Also the Xojo script was missing double quotes around each '““NSContactsUsageDescription”” . The translations do not go to the top level of the bundle but the Resources directory.