Localization CFBundleDisplayName not working

I am trying to localize the name of my application but cannot make it work. I have a localized InfoPlist.strings with the following contents:

CFBundleDisplayName = "Application Name in English"; CFBundleName = "App Name โ€“ in English"; 

and LSHasLocalizedDisplayName ( Application has localized Display Name ) set to YES . What else can I lose?

What can i skip? In another application, this works unreasonably, but for this application I canโ€™t get a name to be localized.

InfoPlist.strings is in the same directory as other localized strings, and the target membership is also selected.

EDIT : as I found out, I have two langauages โ€‹โ€‹(German, English) and it works in German, but not in English ... localizing the application (localizable.strings) to the same directory works fine, but InfoPlist. strings don't ...

+6
source share
3 answers

Have you tried this on a device or in a simulator?

Because in the simulator it will always work in English (or maybe in your Macs language, which is English for me), it will not accept settings from the simulator itself.

This is strange, but you need to configure the language for the application at compile time in the circuit:

enter image description here

+3
source

You mentioned that you added CFBundleDisplayName and CFBundleName to InfoPlist.string . Is it likely that you may not have it in the info.plist file.

In addition, you can check if the following null elements are returned:

 [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleNameKey]; [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleLocalizationsKey]; 

And also (you must have read it, but still) I have doubts that this could be a problem if you can check.

Before displaying the localized name for your package, Finder compares the value of this key with the actual name of your package in the file system. If the two names match, Finder proceeds to display the localized name from the corresponding InfoPlist.strings file in your package. If the names do not match, Finder displays the file system name.

+1
source

I know this is old, but if someone doesnโ€™t see that your application name is localized on the iOS device, even if you edited the target diagram for the language, this is because it will only be displayed if you change the deviceโ€™s language directly (in the "Settings / General / Language and Region" section).

0
source

Source: https://habr.com/ru/post/978277/


All Articles