Making multi-language ios app [closed]

Deadly 提交于 2019-11-28 02:59:34
Todd Hopkinson

These are great resources for your localization efforts:

Xcode 6.0 : It provides wonderful features for Internationalisation and Localisation. ("Localizing with Xcode 6" video). For quick usage I write some useful steps.

Step 1 :

click on project -> info -> scroll down -> localizations -> click on '+' and add your required language -> check as required -> Finish.

for xcode 6 : click on project -> change target to -> info > scroll down -> localizations -> click on '+' and add your required language -> check as required -> Finish.

Step 2 :

click on 'Supporting Files' -> right click -> New File -> select Resource on left-side list -> select 'Strings Files' -> next -> name it 'Localizable' -> create

Step 3 :

click on newly created file -> go to Utilities -> file inspector -> click on 'Localize..' -> check all language

Step 4 :

open Localizable.strings(English) write "help" = "I can't help you";

here "help" is a key "I can't help you" is a value. You may change them as your wish.

open Localizable.strings(French) or the language you have set. write accordingly and you can translate "I can't help you" to any said language.

Step 5 :

// for test
NSString *str = NSLocalizedString(@"help", Nil);
NSLog(@"%@",str);

We have done it. You may check.

Now, to test goto settings of device -> general -> International -> language -> select said language or the language you have chosen (There are limited languages). Run your app. Hope this will help you. It help me.

I would suggest reading the I18n docs. You will never need to ask the user which language they use as this is obtainable through an API call, so you should do the smart thing and use whichever language they have preferred already on their device.

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