Localise App display name that have append suffix
Asked Answered
P

1

7

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

I have add different scheme and User-Defined attribute. So in my info.plist, i have App Name $(BUNDLE_DISPLAY_NAME_SUFFIX) in my CFBundleDisplayName. It will append a -S 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 infoPlist.strings, I tried the following:

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

Both does not append the -S anymore when I run on development scheme. Does anyone know how I could still do that? Like maybe how to get the $(Bundle_DISPLAY_NAME_SUFFIX) to be read in the infoPlist.strings.

More specifically, how do I include a preprocessor in InfoPlist.strings?

Pasol answered 25/8, 2016 at 7:10 Comment(0)
F
3

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

Family answered 4/9, 2016 at 9:27 Comment(12)
Hi @Sajjon, I could already do this. But my question is how can I localise it and still maintain the ability to do it. Because in the infoplist.strings the ${Bundle_Display} don't work.Pasol
But I have three different languages and it still works.Family
For the app name with different language?Pasol
Or do you mean that you want the Display name to be DEPENDENT on the configuration AND the language. In my case I have three configurations and three languages, so do you in this case want nine different display names? :SFamily
I have 2 configuration the app name just need to be localise with the ability to add the -S behind.Pasol
Yes, I need it to be depend on my configuration scheme as wellPasol
Okay I am sorry I misunderstood your question, I think this should be possible, let me get back to you and then update my answer!Family
Cool, look like is workable. I was expecting a script as so far I find Xcode does not do preprocessor for InfoPlist.strings. Will give it a try once I am homePasol
Are you using fastlane per any chance? It would be nice to write that script as a fastlane action :)Family
Yes, to be exact, I am using fastlane on Bitwise actually.Pasol
It is only the last part in the for loop, that I am unsure of how to do in ruby, but should not be too possible I guess. Let me know if you get it working :)Family
Did you ever figure out how to localize the display name of the app for many different schemes? I am struggling to find out how to do it.Carbarn

© 2022 - 2024 — McMap. All rights reserved.