Apple Watch base localisation shows wrong default language

女生的网名这么多〃 提交于 2019-12-10 14:49:11

问题


I have an app localised in three languages (Simplified Chinese, French and Czech) with English as the development language.

While the localisations work perfectly on the iPhone, there is an issue with the Apple Watch: If a user has set the Watch language in any other language than English/French/Chinese/Czech, then the content is shown in Chinese instead of English (that should be the default).

According to this Technical Note:

If none of the user’s preferred languages are supported by your app, iOS chooses the language matching your app's development region (CFBundleDevelopmentRegion).

Note: Be sure to set CFBundleDevelopmentRegion for your app. If you adopt Base Localization, make sure that the value of CFBundleDevelopmentRegion matches the language used by your content in the Base.lproj folder.

I have confirmed both the above requirements are being satisfied (CFBundleDevelopmentRegion="en" and all Base.lproj files are indeed in English). Is there something I'm missing? Again, this happens only for the Watch app and not for the iPhone one.


回答1:


From https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-130430 , CFBundleDevelopmentRegion is the language and region, e.g. en-US, not just en.




回答2:


I have both Traditional Chinese and Simplified Chinese but it choose Traditional Chinese as the default language. When I delete the Traditional Chinese translation English is selected.

I also set the CFBundleDevelopmentRegion to en which is the default.

From your screen shot I didn't see English - Development English.




回答3:


I was having the same issue, and found the solution in this thread: https://forums.developer.apple.com/thread/86889

Basically, the watch extension needs needed a Localizable.strings (Base) file. Ordinarily on the iOS side you don't actually need to specify a Base version of the file, only the translations. But on the watch it seems to requires a base version of the file for the system to work at all there. In fact, I only had an Interface translated (in the watch app) and didn't even have a Localizable.strings in the watch extension... so I had to add some localizable strings in the extension, export translations, import them again, and then manually add a Base version (by checking Base in the Localization section of the File Inspector) because this apparently required thing isn't created automatically.



来源:https://stackoverflow.com/questions/44646525/apple-watch-base-localisation-shows-wrong-default-language

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!