Research on Symbian OS-based localization technology

Source: Internet
Author: User
Tags define definition

I. Introduction

Symbian OS is an open and robust embedded operating system developed by Symbian. Symbian OS is a new-generation mobile system platform for wireless handheld devices in the future. Its goal is to develop Symbian OS into an industry standard for mobile phones in the future. Therefore, it provides convenient conditions and strong support for application localization. Symbian OS has built-in unicode encoding, and the application development architecture also separates source files from resource files. Therefore, for the Latin character set, you only need to change the resource file to adapt applications using different language texts, because the user's visual text is not embedded in the source file. However, for non-Latin languages such as Chinese, Japanese, and Korean, the localization of text is more complex and requires some additional work. The following uses the Symbian OS Application Development Platform Series 60 as an example to describe how Symbian OS provides Localization support and how to develop applications in Chinese.

II,Symbian OSApplication Development PlatformSeries 60Introduction

Due to the differences between various manufacturers in user interfaces, hardware design and interoperability and their own innovations, Symbian OS provides mobile device manufacturers with great flexibility. This flexibility allows you to design different products using the same Kernel Operating System, and provides device manufacturers with update space to support more devices in the mobile market. The Series 60 platform is built based on the flexibility of Symbian OS. 1.

 

The kernel of the series60 platform is the Symbian OS gt (generic technology, general technology) layer. Provides an extended avkon UI Layer, a complete application suite Based on avkon and uikon libraries, and user interfaces and framework APIs used by third-party GUI applications.

III, Series 60Application Architecture support for localization on the Development Platform

3. 1 file architecture of the application

Before developing an application, you must understand the application file architecture of the series60 platform. Carbide C ++ is a new IDE tool developed by Nokia for its s60 series smartphone applications. After creating a project using carbide C ++ (for example, the project name is helloworld and the program architecture is a single view), we can see the following application file architecture:

(1) The. RSS file in the data folder is separated from the. cpp source file in SRC, which provides convenient conditions for application localization. The subsequent content will detail its implementation mechanism.

(2) The AIF folder contains an optional application information file (. AIF file), which is used to specify the localized icon, title, and system features (such as embeddable) of the application ).

(3) The INC folder contains the. h header file that defines the program skeleton class, And the. Loc and. LXX files that implement localization.

(4) The SRC folder contains the. cpp source file to implement the class defined in. h. The specific relationship between files during the joint compilation is shown in figure 2.

 

3. 2 Relationship between application framework classes

Like compiling a common vc mfc program, you must be familiar with the relationships between classes in the program. Each application must define four objects:

L The application class defines application attributes such as UID and title and creates a new document. Is the main entry of the application, and it also transmits application-related information back to the framework. The application class does not involve application data and algorithms.

L document class describes the data model of the application. For a file-based application, it stores and refreshes the data of the application, and responds to the Appui class to generate a request for document editing.

L Appui is the main user interface class. It is the recipient of notifications sent by a large number of frameworks, such as users' buttons or important system events. The Appui processes the event itself, or, if appropriate, passes the event to its own view for processing purposes.

L View class is used to display application data on the screen and allow users to interact with it. A complex program may display its data in multiple ways, so it contains multiple view classes. The relationship between them is shown in 3.

You can create a document for the Application class, appui for the document class, and view for the Appui class. From figure 3, we can see that an application also includes a model class, which encapsulates application data and its algorithms and provides good APIs for other parts of the program.

 

3. 3. Implement the localization mechanism of applications

To describe the internal mechanism for application localization in detail, the above helloworldloc project is used as an example to implement this mechanism only. RSS file ,. RSG file ,. loc file ,. LXX file for analysis. In Figure 2, we can see files such as. L01,. L02,. l03, And. loc .. The LXX file defines different languages. For example, in helloworldloc. L01, the text to be displayed is defined in English, in helloworldloc. L02, and in helloworldloc. l03, German. Through compilation and release, you can easily localize applications and resources and display the corresponding language on the real machine. For example, you can define English text in the helloworldloc. L01 file:

# Define elanguage elangenglish // caption Language

# Define qtn_app_caption_string "helloworldloc"

# Define qtn_app_short_caption_string "hellowl"

# Define label_text "Hello world! "

In helloworldloc. L02, the French text is defined:

# Define elanguage elangfrench // caption Language

# Define qtn_app_caption_string "bonjourloc"

# Define qtn_app_short_caption_string "bonjourl"

# Define label_text "Bonjour monde! "

Similarly, German text can be defined in helloworldloc. l03.

The helloworldloc. Loc file contains the corresponding. LXX file according to localization requirements, for example, the helloworldloc. L01 file that contains an English string.

# Include "helloworldloc. L01"

The. RSS file contains the helloworldloc. Loc file, which can reference localized resources in. LXX.

# Include "helloworldloc. Loc"

Resource tbuf r_label_text {Buf = label_text ;}

If label_text referenced here is the English text defined in helloworldloc. L01:

# Define label_text "Hello world! "

Then, in the integrated development environment of carbide c++, after the resource interpreter rcomp.exe compiles the helloworldloc. RSS file containing localized resources, It outputs a binary resource file helloworldloc. RSC and a helloworldloc. RSG header file. The # define definition symbol r_label_text is used in the header file of helloworldloc. RSG to reference local resources. Definition:

# Define R_label_text0x2aa81006

The. cpp source file of the View class that displays data contains the header file helloworldloc. RSG. You can reference r_label_text to display the "Hello world! "String.

34. Implementation of the Chinese technology of applications

For English, French, and German, these Latin character sets are all encoded using Unicode standards. Symbian OS has built-in unicode encoding, so it is changed through. the. the LXX file allows you to easily generate applications with different language texts. In the header file/epoc32/include/e32std. h of Symbian OS, we can see that these language identifiers are defined. Each supported language has two-digit identifiers. For example, English is 01, French is 02, and German is 03:

Enum tlanguage

{Elangenglish = 1,/** UK English .*/

Elangfrench = 2,/** French .*/

......

Elanghongkongchinese = 30,/** Hong Kong Chinese .*/

Elangprcchinese = 31,/** les Republic of Chinas Chinese .*/

......

}

In the above-defined identity code, we can see that the Chinese identity code is also defined, respectively 30 and 31. However, we cannot simply define Chinese text in the. LXX file. Chinese text is a non-Latin system. For non-Latin languages, the localization of text is more complex. For applications that use Chinese, Japanese, and Korean, the Symbian OS and series60 sdks provide some support, but we need to do some additional work. To solve the Chinese character problem, we must convert our Chinese character encoding. The following is a specific implementation method for Chinese localization, called static.

First, define # define label_text "string _ Chinese" in the. LXX file"

Then convert the. LXX file to utf8 encoding using word or notepad. Note that during conversion, a flag cannot be seen in the previous text editor is added to the file header after conversion. You must use the edit editor to open and delete the flag, otherwise, compilation will fail. Include the. LXX file # include ". LXX" in the. Loc file ". Define the string in the. RSS file: Resource tbuf r_label_text {Buf = label_text ;}

Add a line of code in the. RSS file header: character_set utf8. The. cpp file contains the. RSG header file. You can reference r_label_text to display the "string _ Chinese" string it identifies.

Iv. Development Prospects of Symbian OS in China

With the further support of Symbian OS for localization, Chinese-made smartphone Software Based on symbain OS will surely be popularized. As an operating system for wireless communication in the future, on the one hand, thanks to its powerful functions, on the other hand, it is supported by the world's major mobile equipment vendors (including its shareholders, other major companies such as Intel, Ti, and IBM have successively announced cooperation with Symbian to develop wireless communication equipment software applications. Symbian OS will have a bright future in China.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.