ios - Localized app name vs interface language mismatch -


i ran issue app name in home screen shown in wrong language. happens when none of user's preferred languages supported app. have tested in xcode 8 , ios 10 using multiple projects both in simulator , real device.

when none of user's preferred languages supported app, interface language displayed using app's development region (cfbundledevelopmentregion) described in this document. far good. however, app name in home screen not honor , seems pick english or first .lproj folder alphabetically (if english not present).

let's app supports following languages:

enter image description here

and device settings this:

enter image description here

the following statement:

[nslocale preferredlanguages] 

returns expected result:

<__nsarraym 0x79da6b30>( en ) 

and other statement:

[[nsbundle mainbundle] preferredlocalizations] 

also returns expected result:

<__nsarraym 0x79716630>( zh ) 

however, app name in home screen uses wrong localization:

enter image description here

am missing something? have of run issue?

steps reproduce:

  1. create new ios project.
  2. go project settings -> info -> localizations , add second language e.g. japanese.
  3. add cfbundledisplayname info.plist file.
  4. change cfbundledevelopmentregion zh_cn.
  5. create new infoplist.strings file. in inspector tab, under localization click "localize..." button. select move chinese lproj folder dropdown.
  6. in inspector tab, under localization check japanese checkbox.
  7. edit infoplist.strings files , add "cfbundledisplayname" = "chinese"; or "cfbundledisplayname" = "japanese"; respectively.
  8. run app in simulator or real device language & region settings set different chinese or japanese e.g. english & u.s.

expected results:

the user interface , app name expected displayed in app development language (chinese in example).

observed results:

the user interface shown in app development language (chinese in example) while app name shown in japanese.

first of all, exemplary question lot of details , guide repdroduce issue;)

analysis

this behavior seems bug starting ios 10. not reproduce on ios9.3, expected bundle display name "chinese" shown. ios 11 beta 4 seems have bug. should file bug apple (see bugreporter)

i've tested of app built xcode8.3.3 ios 10.3 sdk.

workaround

as simple workaround, set cfbundledisplayname in info.plist localized value of develepmentregion-language ("chinese"), act default value.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -