How to make a multilingual application installer...

Theres only three files to be changed:

First, take the .mmp-file and add there LANG attribute. Language values can be seen from TLanguage-enum in e32std.h.
TLanguage enumeration can be seen here.

[myapplication.mmp]
...

SOURCEPATH ..\data
RESOURCE MyApplication.rss
RESOURCE MyApplication_caption.rss
LANG     01 09

USERINCLUDE . 
USERINCLUDE ..\inc

SYSTEMINCLUDE   . \epoc32\include
...
LANG 01 is for English and 09 for Finnish language

Then open the .loc file and add the languages...

[myapplication.loc]

#ifdef LANGUAGE_01

#define qtn_appl_test "Test"
#define qtn_appl_exit "Exit"

#define qtn_app_caption_string "MyApplication"
#define qtn_app_short_caption_string "MyApplication"

#endif

#ifdef LANGUAGE_09

#define qtn_appl_test "Testi"

...

#endif
If you have a lot of strings you maybe want to separate languages in files of their own by replacing #define -statements in .loc like this..
[myapplication.loc]

#ifdef LANGUAGE_01
#include MyApplication.l01
#endif

#ifdef LANGUAGE_09
#include MyApplication.l09
#endif

Those .lXX files should define all strings used.

Last thing is to modify .pkg file to support multilingual installing.

[myapplication.pkg]

"..\..\..\\Epoc32\data\z\system\apps\MyApplication\MyApplication.r01"         -"!:\system\apps\MyApplication\MyApplication.r01"
"..\..\..\\Epoc32\data\z\system\apps\MyApplication\MyApplication_caption.r01" -"!:\system\apps\MyApplication\MyApplication_caption.r01"
"..\..\..\\Epoc32\data\z\system\apps\MyApplication\MyApplication.r09"         -"!:\system\apps\MyApplication\MyApplication.r09"
"..\..\..\\Epoc32\data\z\system\apps\MyApplication\MyApplication_caption.r09" -"!:\system\apps\MyApplication\MyApplication_caption.r09"

After these step you should have multilingual setup for application installer.

© 2005 symbian.louhos.com [back to index]