Development Environment: s60_3rd_fp2 SDK/carbide C ++ 1.3.2
Step 1: write local content
Add the content to be supported by language in the project.CodeFor example, the simplified Chinese is 31, and the German is 03. Create a file that stores local strings, such as Hakone. L31 and Hakone. l03.
Hakone. L31:
Code
/* -----------------------------------------------------------------
Language Support for Chinese
------------------------------------------------------------------ */
# Define Qtn_caption_string "hakone_s60"
# DefineQtn_connect "connection"
# DefineQtn_disconnect "disconnected"
# DefineQtn_setting "setting"
# DefineQtn_about "about"
# DefineQtn_exit "quit"
After defining the support files for various languages, you need to add a. Loc file to select the Supported languages, such as Hakone. loc.
Code
Character_set utf8
//Default language
# Ifdef language_ SC
# Include"Localization \ Hakone. L01"
# Endif
//English (UK)
# Ifdef required age_01
# Include"Localization \ Hakone. L01"
# Endif
//Simplified Chinese
# Ifdef language_31
# Include"Localization \ Hakone. L31"
# Endif
These files can be stored in any include directory. We recommend that you design the storage location properly.
Step 2: Use related multilingual definitions in the RSS File
For example, Hakone. RSS:
Code
# Include " Hakone. Loc "
//
// Some content here
//
Resource menu_pane r_hakone_main_menu
{
Items =
{
// Added the new options menu command here
Menu_item
{
Command = Emainviewconnect;
Txt = Qtn_connect;
},
Menu_item
{
Command = Emainviewdisconnect;
Txt = Qtn_disconnect;
},
Menu_item
{
Command = Emainviewsettings;
Txt = Qtn_setting;
},
Menu_item
{
Command = Emainviewabout;
Txt = Qtn_about;
},
Menu_item
{
Command = Eaknsoftkeyexit;
Txt = Qtn_exit;
}
};
}
Step 3: update the MPs File
You can use the carbide ide to upgrade the MPs file or manually add multi-language support:
For example, add Hakone. MPP to the following code:
Lang 01 31
Step 4: update the PKG File
You need to add the multi-language file option to the package file. Because the first file compiled by Hakone. L31 is Hakone. R31, add the following code to the Hakone. PKG file:
{
" $ (Epocroot) epoc32 \ data \ Z \ resource \ apps \ hakone_s60.r01 "
" $ (Epocroot) epoc32 \ data \ Z \ resource \ apps \ hakone_s60.r31 "
} - " ! : \ Resource \ apps \ hakone_s60.rsc "
The Code shows thatProgramDuring installation, the system automatically selects different languages to update the resource file hakone_s60.rsc of the application. When the application calls the RSC file to read strings, the content in different languages can be obtained.
Summary:
In this way, you can implement multi-language applications. When installing a program, you will be prompted to select the supported language for installation. At the same time, if you want the program to support different languages at runtime. copy the rxx file to the system so that the application can call different. rxx file.
PS:
Starting with 5800 machines today, although I know it is definitely not as good as n97, I am still looking forward to it. After all, is it the first s60 5th? In an economic crisis, this big advertisement mobile phone has already bought about 2000 yuan, it's cool to combine Nokia's performance in the first quarter...