I have 2 Apps : Free & Full I have 2 Languages : English & German
This results in 4 different App-Names
How can I achieve this.
Actually all my targets have the name "Free" in it, even it the the Full Version.
I know: I have 1 InfoPlist.strings File, which is multiplied by Localization and I can assign them to targets. So for 1 App I can localize the BundleDisplayName.
But how can I assign the specific names for the second app ?
Change the Bundle IDChoose your project from the left side, then your app target under TARGETS, select the General tab and rename the Bundle Identifier.
The user-visible name for the bundle, used by Siri and visible on the iOS Home screen.
Go to the app > manifests > AndroidManifest. xml file and change the android:label field in your application node in AndroidManifest.
Build Settings> Change "Product Name" TARGETS> Select app> Change "Display Name" Project Navigator> Select project name> Double-click> Change "project name"> Rename> Mange Scheme> Change "Scheme name" info.
PlistBuddy is your friend here. What you need to do is update your plist in a build time.
Here is the code:
infoplist="$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH"
/usr/libexec/PlistBuddy -c "Set CFBundleName some_new_name_here" "$infoplist"
Important thing with this approach is that you're not change nothing in your plist file but with post-actions you already changing the packet prepared for device, so you keep your code repository nice and clean.
From the Apple Developer Technical Notes:
If your app supports localization, be sure to localize CFBundleDisplayName by adding it to all your language-specific InfoPlist.strings files. Furthermore, be sure to use a name that complies with the App Review Guidelines for your app.
Prerequisites
I am assuming you already have multiple targets.
I am also assuming you already have an InfoPlist.strings
file. If your do not, code > File > File... > Resource > Strings File > Next > Save As: InfoPlist > Base.lproj > Target: the english target > Create
Ensure you have enabled this in your Info.plist
:
<key>LSHasLocalizedDisplayName</key>
<true/>
Step by step
InfoPlist.strings
.InfoPlist.strings
into their respective locations.
en.lproj
, drag it onto your Project Navigator, pick Create Groups, add to target your English, or Base target, Finishde.lproj
, fr.lproj
, each time dragging the entire .lproj
from the Finder, and associating with the appropriate target..lproj
may contain other localized files for which you want to enjoy the magic of step 3. Simply remove their references.The final setup, for say the German language, will look like this in the File Inspector:
References:
Share localization across targets:
This is the general method to achieving localization. See https://stackoverflow.com/a/33749062/218152.
Specific localization to specific targets:
This is only useful if you want to explicitly control which languages go into which target. See https://stackoverflow.com/a/33791181/218152.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With