Ideally, the text, images, and other content that iPhone applications display to users should be localized for multiple languages. The text that an alert dialog displays, for example, should be in the preferred language of the user. The process of preparing a project for content localized for particular languages is called internationalization. Project components that are candidates for localization include:
Using the Settings application, users select the language they want to see in applications'user interfaces from the Language preferences view. They get to this view from the International group of settings, accessed from General settings.
The Language preference view
The chosen language is associated with a subdirectory of the bundle. The subdirectory name has two components: an ISO 639-1 language code and a .lproj suffix. The language code may also be modified with a particular region by appending (after an underscore) an ISO 166-1 region designator. For example, to designate resources localized to English as spoken in the United States, the bundle would be named en_US.lproj. By convention, these language-localized subdirectories are called lproj folders.
An lproj folder contains all the localized content for a given language and, possibly, a given region. You use the facilities of the NSBundle class or the CF Bundle Ref opaque type to locate (in one of the application’s lproj folders) resources localized for the currently selected language. Listing gives an example of such a directory containing content localized for English (en).
The contents of a language-localized subdirectory
This subdirectory example has the following items:
To internationalize strings in your code for localization, use the NSLocalizedString macro in place of the string. This macro has the following declaration:
The first parameter is a unique key to a localized string in a Localizable.strings file in a given lproj folder. The second parameter is a comment that indicates how the string is used and therefore provides additional context to the translator. For example, suppose you are setting the content of a label (UILabel object) in your user interface. The following code would internationalize the label’s text:
You can then create a Localizable.strings file for a given language and add it to the proper lproj folder. For the above key, this file would have an entry similar to the following:
IPHONE APPS Related Interview Questions
|C Interview Questions||IPHONE APPS Interview Questions|
|Mobile Testing Interview Questions||Oracle apps Interview Questions|
|Java Native Interface (JNI) Interview Questions||JNDI (Java Naming and Directory Interface) Interview Questions|
|Mobile computing Interview Questions||jQuery Mobile Interview Questions|
|Mobile Security Interview Questions||Objective C Interview Questions|
|Mobile Developer Interview Questions||Mobile Application Testing Interview Questions|
|Apps Associates Manual Testing Interview Questions||Mobile Marketing Interview Questions|
Iphone Apps Tutorial
The Core Application
Window And Views
Graphics And Drawing
Text And Web
Files And Networking
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.