XCode - Multiple targets, Multiple *internationalized* names?

前端 未结 1 649
半阙折子戏
半阙折子戏 2020-12-08 07:53

I\'ve got an internationalized iPhone project. In the various ${lang}.lproj/InfoPlist.strings files I\'ve got a single key, CFBundleName = \"My App Name\"

1条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 08:30

    Turns out this is quite easy, if laborious. You can have several InfoPlist.strings, one-enabled-per-target, and they can each be internationalized, as long as each set is in a different Xcode group.

    Set up a directory structure like this:

    .../AppName/
                en.lproj/InfoPlist.strings  <-- Contains CFBundleDisplayName
                it.lproj/InfoPlist.strings  <-- ...
                ...
    .../AppNameLite/
                en.lproj/InfoPlist.strings  <-- ...
                it.lproj/InfoPlist.strings  <-- ...
                ...
    

    Import those files into Xcode groups, so it looks like this:

    alt text

    Right-click "Groups & Files" (top left of Xcode) and make sure "Target Membership" is visible, then go through your targets, checking the the right set of strings is enabled for each.

    0 讨论(0)
提交回复
热议问题