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:
and device settings this:
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:
am missing something? have of run issue?
steps reproduce:
- create new ios project.
- go project settings -> info -> localizations , add second language e.g. japanese.
- add cfbundledisplayname info.plist file.
- change cfbundledevelopmentregion zh_cn.
- create new infoplist.strings file. in inspector tab, under localization click "localize..." button. select move chinese lproj folder dropdown.
- in inspector tab, under localization check japanese checkbox.
- edit infoplist.strings files , add "cfbundledisplayname" = "chinese"; or "cfbundledisplayname" = "japanese"; respectively.
- 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
Post a Comment