Choosing localization for unsupported languages

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 18:50:41

问题


I have localizations for "en" and "ru" languages, and if user select any other language (fr,de...) I need to display Russian localization variant. I tried changing "Localization native development region" in info.plist to "ru" / "Russian", but it always displays English, when using unsupported language. There is related question from which I'm assuming this task is impossible.

I would be grateful for any advice and insights on these issues.


回答1:


I think with my solution posted here

Localizing strings in iOS: default (fallback) language?

It is possible to set any non-English as default too. Even if the current device is not set to be using that language (eg. Russian).

You can use [UIImage imageNamed:L(@"AN_IMAGE")]

Then in different Localizable.strings file, set to different values:

"AN_IMAGE" = "some_image_default.png";
"AN_IMAGE" = "some_image_ru.png";
"AN_IMAGE" = "some_image_pt.png";



回答2:


Do you have read String Resources from Apple how to create a Localizable.strings file for every needed language. You can use than NSLocalizedString to enter the localized string to every needed file and don't have to translate every file.




回答3:


@Condor:

I have similar issues you have had with localized pictures with localized XIB files. They show up fine with the translation in XCode and my app works well with localization in the Simulator. It's just on the device where I always see plain english for the XIB parts... (All copy translated with NSLocalizedString() works fine on the simulator.

Took the smallest possible example project and implemented similar folder structure there - no problem...



来源:https://stackoverflow.com/questions/6663954/choosing-localization-for-unsupported-languages

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