Localized app name vs interface language mismatch

albertamg

I ran into this issue where the app name in the home screen is shown in the wrong language. This only happens when none of the user's preferred languages is supported by the app. I have tested this in Xcode 8 and iOS 10 using multiple projects both in the simulator and a real device.

When none of the user's preferred languages is supported by the app, the interface language is displayed using the app's development region (CFBundleDevelopmentRegion) as described in this document. So far so good. However, the app name in the home screen does not honor this and it seems to pick English or the first .lproj folder alphabetically (if English is not present).

Let's say my app supports the following languages:

enter image description here

And my device settings look like this:

enter image description here

The following statement:

[NSLocale preferredLanguages]

returns the expected result:

<__NSArrayM 0x79da6b30>(
en
)

And this other statement:

[[NSBundle mainBundle] preferredLocalizations]

also returns the expected result:

<__NSArrayM 0x79716630>(
zh
)

However, the app name in the home screen uses the wrong localization:

enter image description here

Am I missing something? Have any of you run into this issue?

Steps to reproduce:

  1. Create a new iOS project.
  2. Go to project settings -> Info -> Localizations and add a second language e.g. Japanese.
  3. Add a CFBundleDisplayName to the Info.plist file.
  4. Change the CFBundleDevelopmentRegion to zh_CN.
  5. Create new InfoPlist.strings file. In the inspector tab, under Localization click the "Localize..." button. Select to move it to the Chinese lproj folder from the dropdown.
  6. In the inspector tab, under Localization check the Japanese checkbox.
  7. Edit the InfoPlist.strings files and add "CFBundleDisplayName" = "Chinese"; or "CFBundleDisplayName" = "Japanese"; respectively.
  8. Run the app in the simulator or a real device with its language & region settings set to something different than Chinese or Japanese e.g. English & U.S.

Expected Results:

The user interface and app name are expected to be displayed in the app development language (Chinese in the example).

Observed Results:

The user interface is shown in the app development language (Chinese in the example) while the app name is shown in Japanese.

Sven Driemecker

First of all, this is an exemplary question with a lot of details and a good guide to repdroduce your issue;)

Analysis

This behavior seems to be a bug starting with iOS 10. I could not reproduce it on iOS9.3, where the expected Bundle Display Name "Chinese" is shown. iOS 11 Beta 4 also seems to have this bug. You should file a bug to Apple (see their BugReporter)

I've tested all of this with an App built by Xcode8.3.3 with iOS 10.3 SDK.

Workaround

As a simple workaround, you could set the CFBundleDisplayName in the Info.plist to the localized value of the DevelepmentRegion-Language ("Chinese"), which will act as default value.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Localized name of ZoneId's ID

Localized project with several targets with localized app names

Different app-name depending on configuration when app-name is localized in InfoPlist.strings

iOS Get localized version of a string for a specific language

Is there a way to add comments to localized strings in Interface Builder?

Get localized month name using native JS

How to get localized name of Known Folder?

VS 2017 + UWP - create app package fails - language file not found

Install the right file with the same name depending on the app's language in NSIS

Retrieve localized language names by CultureInfo

App interface language?

Interface mismatch in dummy procedure

How to localized app tile title in app list?

Changing NSError's localized description language

Chromecast localized name?

Get localized name other channel

Facebook SDK issues with app name mismatch while trying to share via Android app

Facebook + Android: Failed to authenticate the application because of app name mismatch

Certificate Name 'Mismatch' error

How to have an APP name for each language (Cordova to Android)

Testing localized in-app purchases

Add localized language app descriptions on app store

Android Firebase Invites app description not localized

obj-c app is not localized programmatically

Automation of localized language web app

Interface Mismatch Property Accessor

Get localized country name from country code

Can not see an app with name "advertisements" in admin interface

Localized name for default sounds in /System/Library/Sounds