开发者

iphone localization: retrieving a different file

开发者 https://www.devze.com 2022-12-31 08:10 出处:网络
i have an app that i have to localize. I am already localizing the nibs and some texts, i just have a doubt.

i have an app that i have to localize. I am already localizing the nibs and some texts, i just have a doubt.

I need to pull a plist from the bundle which contains some texts, for the other languages i would have other plists. How can i accomplish the loading of them in a nice simple way.

My initial though is to have a text.plist , text-sp.plist , text-fr.plist and retrieving the current language then if language == english grab the text.plist, if language == spanish grab text-sp.plist开发者_运维问答 and so on.

Is there a better way to do this?

I'd rather somehow make the .plist localizable and do something similar to what i do with texts using NSLocalizedString, but i am not sure how to use it in this case.


Sorry, just found the solution.

Just right click the .plist file and add new localizations like any other file. Then the OS handles which one to load according to the current locale settings.

I had to clean my targets in order for the changes to take effect, thats why i initially thought this was not working.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号