|
||
Symbian OS applications can be localised by defining all the localisable text and images in language-specific resource and icon files. At install time, depending on the language selected by the user, only a single version of each set of language-specific files will be installed.
To do this, the PKG file should include:
a list of the languages supported,
the vendor names translated into each language listed,
a single non-localised (global) vendor name,
a package header, which consists of the component or application name translated into the different languages supported (in the order specified in the language list), a package UID, and the package's major, minor version numbers and a build number.
a list of the language-neutral files to install and their destination on the target phone.
one or more lists of the language-specific files to install. Each block of language-specific files is enclosed in curly brackets, and within the block, the files are listed in the same order as in the language list. As only one file from each block is installed, each list is followed by the path and name of the file after installation.
The PKG file shown below is
examples\ToolsAndUtilities\Localise\HelloWorld.pkg
.
; Languages
&EN,GE
; List of localised vendor names.
%{"Symbian Software Ltd", "Symbian Software Ltd"}
; Single, non-localised (global) vendor name.
:"Symbian Software Ltd"
; Package header.
; Two component names as we support English and German
#{"Hello World", "Hallo Welt"}, (0xE8000091), 1,0,0
; Language-neutral files to be installed
"HelloWorld.exe"-"!:\sys\bin\HelloWorld.exe"
"HelloWorld_reg.rsc" - "!:\private\10003a3f\import\apps\HelloWorld_reg.rsc"
; Lists of language-specific files. Only one from each list will be installed.
{
"HelloWorld.r01"
"HelloWorld.r03"
}-"!:\resource\apps\HelloWorld.rsc"
{
"HelloWorld01.mbm"
"HelloWorld03.mbm"
}-"!:\resource\apps\HelloWorld.mbm"
Notes:
The first line is the languages list. This uses language codes to specify the supported language variants, in this case English and German. It also defines the order in which the localised vendor names, component names and language-specific files should be specified elsewhere in the PKG file.
In the second line (ignoring comments), a localised vendor name is specified for each language supported.
In the package header line, the name of the component is specified, translated into each of the supported languages.
HelloWorld.exe
and HelloWorld_reg.rsc
are
language-neutral files, installed irrespective of the language selected by the
user.
HelloWorld.rsc
and HelloWorld.mbm
are
language-specific files. HelloWorld.r01
is the English language
version of the resource file and HelloWorld.r03
is the German
version. CreateSIS copies both versions into the SIS file, but at install time,
only one of them will be installed, depending on the user's choice of language.
The installed file is renamed to HelloWorld.rsc
. For more
information on localisable resource files, see
How to localise resources.