Search Unity

How to Localize NSCameraUsageDescription for an OSX Unity app?

Discussion in 'macOS' started by RecursiveFrog, Aug 18, 2021.

  1. RecursiveFrog

    RecursiveFrog

    Joined:
    Mar 7, 2011
    Posts:
    350
    Using Unity 2019.4, how can I localize the Camera Usage reason? Unity only allows for the one single string that ends up in the Info.plist for the app.

    I understand how one would do this using Xcode, by adding locales in the XCodeProj and making sure the loc folders + InfoPlist.strings files exist, but how does this work in Unity?

    It should be possible that if one were to add the various folders to Assets such as:


    Code (CSharp):
    1. en.lproj
    2.      InfoPlist.strings
    3. es.lproj
    4.      InfoPlist.strings
    5. fr.lproj
    6.      InfoPlist.strings
    In which each InfoPlist.strings file contains:

    Code (CSharp):
    1.  
    2. NSCameraUsageDescription = "My Localized Description";
    3.  

    But if you're not building an XcodeProj, but instead are building an app, how does Unity know to include these folders as locales in the XcodeProj locales section?

    Is the only way to do this to build as XcodeProj for OSX and use a PostProcessBuild function to modify the XcodeProj file?