Namespaces
Variants
Actions
Revision as of 07:50, 17 July 2012 by hamishwillee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Localizing application menus in Symbian C++

Jump to: navigation, search
Archived.png
Archived: 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

Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition, FP1
S60 3rd Edition, FP2

Article
Created: tapiolaitinen (31 Jan 2008)
Last edited: hamishwillee (17 Jul 2012)

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.

273 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved