This page was last modified 22:24, 7 October 2008.
CS000811 - Localizing application menus
From Forum Nokia Wiki
| ID | CS000811 | Creation date | February 6, 2008 |
| Platform | S60 3rd Edition S60 3rd Edition, FP1 S60 3rd Edition, FP2 | Tested on devices | Nokia E90 Communicator |
| Category | Symbian C++ | Subcategory | Localization |
| Keywords (APIs, classes, methods, functions): |
Overview
This code example describes how to localize application menus.
This snippet can be self-signed.
Steps
1. Create a data\[app].rls file.
2. Write localization information into it:
#ifdef LANGUAGE_SC // Default: UK English #include "app_loc.l01" #elif defined LANGUAGE_01 // UK English #include "app_loc.l01" #elif defined LANGUAGE_09 // Finnish #include "app_loc.l09" #endif
3. Add the localization strings into the appropriate files (for example, data\[app]_loc.l01 and data\[app]_loc.l09):
// LOCALIZATION STRINGS rls_string STRING_r_http_options_help "Help" rls_string STRING_r_http_options_about "About" rls_string STRING_r_http_options_exit "Exit"
4. Localize the menus defined in the resource file by using the strings from the .rls file:
#include "[app].rls"
// ---------------------------------------------------------
//
// r_example_menu
// Menu for "Options"
//
// ---------------------------------------------------------
RESOURCE MENU_PANE r_example_menu
{
items =
{
MENU_ITEM
{
command = EHelp;
txt = STRING_r_http_options_help;
},
MENU_ITEM
{
command = EAbout;
txt = STRING_r_http_options_about;
},
MENU_ITEM
{
command = EAknSoftkeyExit;
txt = STRING_r_http_options_exit;
}
};
}
5. Insert the LANG attribute into the group\[app].mmp file:
LANG SC 01 09
6. Make sure the resources are compiled into a SIS package (see sis\[app].pkg):
;EN resources
"..\..\..\epoc32\data\z\resource\apps\app.r01" -"!:\resource\apps\app.r01"
"..\..\..\epoc32\data\z\private\10003a3f\apps\app_reg.r01"
-"!:\private\10003a3f\import\apps\app_reg.r01"
;FI resources
"..\..\..\epoc32\data\z\resource\apps\app.r09" -"!:\resource\apps\app.r09"
"..\..\..\epoc32\data\z\private\10003a3f\apps\app_reg.r09"
-"!:\private\10003a3f\import\apps\app_reg.r09"
7. Compile the files and create the SIS package.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linking an application to the First application screen | brillpappin | Mobile Java General | 4 | 2005-12-13 00:35 |
| Do .loc files *have* to be compiled? | AshramArzephucque | General Symbian C++ | 6 | 2008-01-11 22:17 |
| Multiview application question | cypressx | General Symbian C++ | 4 | 2007-02-26 15:08 |
| Sending SMS in Java | algedi | Mobile Java General | 1 | 2002-05-31 13:10 |
| EIKCOCTL 8 when autofocus | Christophe.A | Symbian User Interface | 2 | 2008-06-24 15:42 |

