Zac Kwan Zac Kwan - 1 year ago 120
Swift Question

Localise App display name that have append suffix

I have a issue with getting app display name to include the appending suffix when adding localisation to


I have add different
attribute. So in my info.plist, i have
in my
. It will append a
to my app name when running on development scheme and normal app name on release scheme that i created. Everything is working well.

However, when I try to translate the app name, it does not work anymore. So in my
, I tried the following:

"CFBundleDisplayName" = "App Name ";
"CFBundleDisplayName" = "App Name $(BUNDLE_DISPLAY_NAME_SUFFIX)";

Both does not append the
anymore when I run on development scheme. Does anyone know how I could still do that? Like maybe how to get the
to be read in the

More specifically, how do I include a preprocessor in

Answer Source

I found the answer to your question in another thread, here, but it says you need a scrip for this.

How you create different suffixes (not what was asked for) Here is how you set up different display name of your app based on the your scheme. You can do this by setting up different configurations. Go to the project settings -> select the project (not the target) -> Info tab -> then create as many configurations you would like. Maybe one for Production, Debug and one for Beta releases.

Then select your Target -> Build settings tab -> Enter display in search. Under User defined you can create your own variable, call it e.g. BUNDLE_DISPLAY_NAME_SUFFIX. Give it different values for Production, Debug and Beta.

Open your Info.plist file, under Bundle display name, your see maybe MyApp, append the string ${BUNDLE_DISPLAY_NAME_SUFFIX} so it makes MyApp${BUNDLE_DISPLAY_NAME_SUFFIX}.

Finally configure your schemes to use the correct configuration. You probably want to use Production for Archive and Debug for Debug.

Here is an image of the User defined variable

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download