internationalization of an iPhone Application

前端 未结 4 1917
夕颜
夕颜 2021-01-27 10:45

I am new to iPhone App development (I am using XCode 4.2) and I was wondering if there is a way to translate all the strings , caption etc ... internally without having to trans

4条回答
  •  故里飘歌
    2021-01-27 10:51

    All you will have to create are the files with the key-value pairs for each language you want to translate and name them accordingly i.e. _en, _fr and so on.

    Then all you have to do is send a message to this method:

    NSLocalizedString(@"myKey", nil)
    

    And this will return the localized String, in whatever language the current iPhone configuration is.

提交回复
热议问题