Nokia N97 SDK Example Applications Guide |
Localization
1. About this Example
2. Architecture
3. Design and Implementation
This example demonstrates how to localize an application to adapt to the selected phone language. The application has five
sets of localized strings (English, German, Chinese, Japanese, and Thai) for the application name, labels, text, and image.
The application also presents number, currency, date, and time localization, in which the TLocale method is used to localize
them.
- TLocale
- CFbsBitmap
- StringLoader
- TBuf, TReal, TRealFormat, and TTime
It is recommended that reader is familiarize with following Symbian concepts
- "Internalization and Localization" and usage of the same in S60 platform. Refer the following document for more information.
Internationalization and Localization Guide
- Writing the resource file for Different Languages
Localization follows traditional Symbian OS Control-based architecture.
The program capabilities are defined in the localization_s60_3rd_ed.mmp files: CAPABILITY NONE
The program takes screen parameters in the start of the application and works with all screen modes. The program supports
changing the screen layout while the program is running. Note that this support must be coded in the application and this
code resides in the CLocalizationAppView::SizeChanged() method.
Localization application is localized for English, German, Chinese, Japanese, and Thai. The localization.loc includes language
specific resource files, which all each define the same resource strings in specific language.
The Localization example has as five language specific resource file, in each the Language specific translated * strings for
"Number", "currency", "Date", "Time", and "Text" are present along with the national flag image file of corresponding country.
When localizing to languages, which do not use Western alphabets, such as Chinese or Japanese, a couple of additional steps
needs to be taken. As the language cannot be written in ASCII, the language-specific resource file(.l31, .l32, and .l33) has
to
- be written in UTF-8 format, and
- contain a line CHARACTER_SET UTF8.
This application depicts "Run time Localization", which means Several localized resources are installed. By default, the device
language and locale is used. The language is chosen based on the priorities of included language resource and language supported
by the device.
The beauty of Localization may go waste without usage of API TLocale Date, Time, and Currency in this example are formatted
according to the locale settings with the help of TLocal API.
The Localization example has two mmp files, in order to support the use of Localization example in both S60 2.X and S60 3.X
versions of S60 platform.
|
© Nokia 2009
|

|