English 中文(简体)
XCode - Multiple targets, Multiple *internationalized* names?
原标题:

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".

That s working fine for a single target, but I can t make it work for multiple targets.

I d like to have several translated InfoPlistMyApp.strings files for the main target, plus several InfoPlistMyAppLite.strings files for the lite version. But I can t figure out how to set it up. The InfoPlist.strings name seems to be set in stone, so I can t replace it dynamically.

Any ideas?

最佳回答

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.

问题回答

暂无回答




相关问题
How does gettext handle dynamic content?

In php (or maybe gettext in general), what does gettext do when it sees a variable to dynamic content? I have 2 cases in mind. 1) Let s say I have <?=$user1?> poked John <?=$user2?>. ...

Explain the Need for Mutexes in Locales, Please

Reading the question Why doesn’t C++ STL support atoi(const string& ) like functions?, I encountered a comment which warned that GCC (at least) has a bug that can slow down multi-threaded ...

How does Vistalizer work

How does Vistalizer manage to override the language limit in Windows Vista Home edition. Which api s does it use to allow installation of Multiple language packages.

Localized exceptions (within a Struts2 app)

I am developing a Struts 2 application with support for multiple languages. If one of the domain objects needs to throw an exception, how can it do so in such a way that the error message is no ...

Rails Globalize plugin help

Has anyone gotten the Globalize plugin to work Rails 2.3.2 or later? If so, could you direct me to some useful info?

热门标签