- Home /
Camera Usage Description localization
Hello!
We have been working in an augmented reality app for some time and, since it has been published in several languages, we are trying to localize Unity's Camera Usage Description field. We are using "Smart Localization", an amazing asset to manage languages. I assume that it prevents us from using xCode localization in order to solve the issue.
Did anyone manage to do a similar thing while using a localization asset?
Answer by alvaro-em · Nov 25, 2016 at 01:28 PM
After struggling with this for 2 days, I can finally answer my own question. I haven't found a way to do this from Unity, so I will present the process I followed in xCode. If anyone finds a way to do it from Unity, I would be glad to read it.
You must localize the info.plist file. Since it can't be localized directly, you have to use the InfoPlist.strings file to do it. Follow this steps:
Open the Unity generated project in xCode
Go to the Info tab, where you will find the "Localizations" area (you may need to open the side panel and select the project, since by default I had a "target" selected and it took me a while to find this pane).
Add the Localizations you need by clicking the "+" sign. It may take a while until it appears.
Now a new element called "InfoPlist.strings" should have been created. In my case, it was under the folder "Unity-iPhone Tests"->"Supportings Files". I moved that item near the info.plist file that was under the root, but I don't know if it is needed.
Select that item ("InfoPlist.strings") and in the right side pane make sure that the "Target Membership" matches the "Unity-Iphone" project (mine had Unity-iPhone Tests selected and it wasn't working until I changed this).
Now, under the InfoPlist.strings you should find a different file for each language you chose to localize to. Each of these files should look like this:
Obviously, the values for each variable are supposed to be in the selected language. Additionally, the name of each string variable needs to match the name of the info.plist key for that permission description usage. You can find it by opening the info.plist file with any text editor of your choice and looking for the specific key.
Now, build and run and it should work!
NOTE: I am not an Apple developer, so I apologize for any inaccuracy I may have done while writing this answer. It is intended for those Unity developers that fight with Apple issues from time to time.
I hope this helps!
Thanks a lot! Now that it's a year later, I also had to add similar entries in the Info.plist file (Privacy - Camera Usage Description and Privacy - Location When In Use Usage Description in my case) by hitting the + button after clicking on the file (Info.plist) in the Project navigator. (I am also not an Apple developer, thank christ.)
I don't suppose anyone has created a post process build script that can do this for every build of the project? Am worried that the build process will be slow and we could miss the step on future builds.
You're the best. I've been wasting my time in this for a few days and now it's fixed, THAN$$anonymous$$S DUDE!
Your answer
Follow this Question
Related Questions
Multiple cameras not working correctly on iPad Air 0 Answers
iOS External Display not working 0 Answers
Localizing ios/android app name as visible from device home screen 1 Answer
WebCamTexture and VSync (iPhone 4) 3 Answers
Build an iOS application for personal use without license (not planning to publish or sell)? 0 Answers