Localizing application menus in Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Tested with
Devices(s): Nokia E90 Communicator
Platform(s): S60 3rd Edition
S60 3rd Edition, FP1
S60 3rd Edition, FP2
S60 3rd Edition FP2
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Created: tapiolaitinen (31 Jan 2008)
Last edited: hamishwillee (17 Jul 2012)


This code example describes how to localize application menus.

This snippet can be self-signed.


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"

3. Add the localization strings into the appropriate files (for example, data\[app]_loc.l01 and data\[app]_loc.l09):

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 =
command = EHelp;
txt = STRING_r_http_options_help;
command = EAbout;
txt = STRING_r_http_options_about;
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"
;FI resources
"..\..\..\epoc32\data\z\resource\apps\app.r09" -"!:\resource\apps\app.r09"

7. Compile the files and create the SIS package.

This page was last modified on 17 July 2012, at 04:50.
66 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.