Localization for iOS
-
Upload
pawan-ramteke -
Category
Mobile
-
view
46 -
download
0
Transcript of Localization for iOS
![Page 1: Localization for iOS](https://reader036.fdocuments.in/reader036/viewer/2022062905/586fe1831a28ab18428b77b9/html5/thumbnails/1.jpg)
Localization
Submitted By: Pawan Ramteke(iOS Developer)
Guided by: Amol Hirkane
![Page 2: Localization for iOS](https://reader036.fdocuments.in/reader036/viewer/2022062905/586fe1831a28ab18428b77b9/html5/thumbnails/2.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062905/586fe1831a28ab18428b77b9/html5/thumbnails/3.jpg)
Internationalizing User-InterfaceTo Internationalizing project go to:
Project Editor > Project > Info.
![Page 4: Localization for iOS](https://reader036.fdocuments.in/reader036/viewer/2022062905/586fe1831a28ab18428b77b9/html5/thumbnails/4.jpg)
Create the Strings FileTo create .string file, go to
Project navigator > New file > resource > string file
![Page 5: Localization for iOS](https://reader036.fdocuments.in/reader036/viewer/2022062905/586fe1831a28ab18428b77b9/html5/thumbnails/5.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062905/586fe1831a28ab18428b77b9/html5/thumbnails/6.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062905/586fe1831a28ab18428b77b9/html5/thumbnails/7.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062905/586fe1831a28ab18428b77b9/html5/thumbnails/8.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062905/586fe1831a28ab18428b77b9/html5/thumbnails/9.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022062905/586fe1831a28ab18428b77b9/html5/thumbnails/10.jpg)
Thank you!