Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Many of the strings your application uses can be referenced in the application’s layout files, but there’s often a need for building a string dynamically at runtime to display to the user. These strings embedded into your code must be localized as well! In fact, our experience shows that it’s these strings that flesh out the application and test your discipline as a developer committed to localization. These are also the strings that send you back to the translation team with further requests for translation services!
The first and fundamental use of localized strings in code is the simple string retrieved from the string table and directly displayed without further formatting. We’ll start by looking at a snippet of the Field Service application’s code prior to localization. The following listing shows the onCreateOptionsMenu() method, which handles the creation of the presented menu options.