Localization for iOS

  • View
    46

  • Download
    0

  • Category

    Mobile

Preview:

Citation preview

Localization

Submitted By: Pawan Ramteke(iOS Developer)

Guided by: Amol Hirkane

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)

Internationalizing User-InterfaceTo Internationalizing project go to:

Project Editor > Project > Info.

Create the Strings FileTo create .string file, go to

Project navigator > New file > resource > string file

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.

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

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

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.

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

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

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]

Thank you!

Recommended