localization for ios

10
Localizatio n Submitted By: Pawan Ramteke (iOS Developer) Guided by: Amol Hirkane

Upload: pawan-ramteke

Post on 16-Apr-2017

46 views

Category:

Mobile


0 download

TRANSCRIPT

Page 1: Localization for iOS

Localization

Submitted By: Pawan Ramteke(iOS Developer)

Guided by: Amol Hirkane

Page 2: Localization for iOS

What is Localization?Localization is the process of rendering the content of your app into multiple languages.Before you can localize your app, you have to internationalize it. Internationalization is the process of making your app able to adapt to different languages, regions, and cultures. It involves 2 parts:User-Interface (.xib, .storyboard)Code (.m, .swift)

Page 3: Localization for iOS

Internationalizing User-InterfaceTo Internationalizing project go to:

Project Editor > Project > Info.

Page 4: Localization for iOS

Create the Strings FileTo create .string file, go to

Project navigator > New file > resource > string file

Page 5: Localization for iOS

Localize Your ProjectNow you are ready to localize your project.

For localize , select the string file > you will see the localize button in the file inspector.

Page 6: Localization for iOS

Add a New LanguageFor adding a new language into your project.

Go to Project Navigator > info > localization tab and click +

Page 7: Localization for iOS

Add Localized Strings into String File

The string file has a following syntax to add localized strings:

“KEY” = “Value”;Ex : “KEY_HELLO” = “HELLO”; (for English localization) The Key should be same in all the localized file.

Page 8: Localization for iOS

Add Preferred Languages into DeviceFor adding preferred languages into device go to:

Device Settings > general > language & region > in Preferred Language Order Add Language

Page 9: Localization for iOS

Get all Preferred languages

For getting all the preferred languages you add previously , NSLocale is use.NSLocale is a Foundation class that encapsulates all of the conventions about language and culture for a particular locale. The following code returns an array if preferred languages code (en - English)

NSArray *ArrayAllLanguages= [NSLocale PreferredLanguages]

Page 10: Localization for iOS

Thank you!