|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-88917386-AD48-4C76-A1C7-46F0B1E85A18" xml:lang="en"><title>Implementing |
|
13 UI text localization</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <p>To allow your application to support different languages:</p> |
|
15 <ol> |
|
16 <li id="GUID-4C53C331-EDCB-49A6-A2AE-1946E0CBA85E"><p>In the resource |
|
17 file for your application, use unique symbolic IDs, also known as a logical |
|
18 name, for all UI texts that need to appear on the screen.</p> |
|
19 <note> |
|
20 <p>The Symbian platform provides some unique symbolic IDs that you can use |
|
21 in your code, which means that the UI texts used for these IDs match those |
|
22 used elsewhere in the device. Do not define any values for these symbolic |
|
23 IDs.</p> |
|
24 </note> |
|
25 </li> |
|
26 <li id="GUID-F64825B7-7A7F-4F07-ADFF-21C794534B39"><p>For each language |
|
27 your application supports, create a resource file as follows:</p> |
|
28 <ol> |
|
29 <li id="GUID-509946C5-B45A-4481-8D71-F74DF32EF18A"><p>Create a text |
|
30 file with the extension <parmname>lNN</parmname>, where NN is a two digit |
|
31 number that matches the Symbian OS language code for your target language.</p> |
|
32 <itemgroup> |
|
33 <p>The file naming suggestion reflects the Symbian platform convention, Symbian |
|
34 OS uses <parmname><application_name>_NN.rls</parmname>.</p> |
|
35 </itemgroup> |
|
36 </li> |
|
37 <li id="GUID-256733D4-214F-40E9-9DF1-E60469A8E8BD"><p>Define all |
|
38 the symbolic IDs using the following syntax:</p> |
|
39 <codeblock id="GUID-5EBA1490-2538-4AFA-B348-8D12D0322820" xml:space="preserve">#define symbolicID "value in target language"</codeblock> |
|
40 <p>Each symbolic ID must be on its own line.</p></li> |
|
41 <li id="GUID-AB1ADD82-91F4-4FEF-97C3-D077E73F8A4B"><p>Repeat for |
|
42 each supported language.</p></li> |
|
43 </ol> |
|
44 </li> |
|
45 <li id="GUID-089BCEFD-8E83-4CAE-80C8-14461BC333DC"><p>Create a file |
|
46 to include the compiled localization files in your resource file, as follows:</p> |
|
47 <ol> |
|
48 <li id="GUID-44F02DD4-1502-4BAB-B128-5FC570CB6ABC"><p>Create a text |
|
49 file with the extension <parmname>loc</parmname>.</p><p>The file naming |
|
50 suggestion reflects the Symbian platform naming convention, Symbian OS uses <parmname><application_name>.rls</parmname>.</p> |
|
51 </li> |
|
52 <li id="GUID-D40E9CEB-031F-405A-B031-3B5DDB84C1B2"><p>Add <parmname>#ifdef</parmname>, <parmname>#elif</parmname>, |
|
53 and <parmname>#include</parmname> statements for including the appropriate |
|
54 languages in your application resource files. An example syntax is as follows:</p> |
|
55 <codeblock id="GUID-702C92E6-EEE5-4C0F-8498-8C182C0F0097" xml:space="preserve">#ifndef __LOCALIZATION_LOC__ |
|
56 #define __LOCALIZATION_LOC__ |
|
57 |
|
58 #ifdef LANGUAGE_SC // language code for default |
|
59 #include "..\data\localization.l01" |
|
60 |
|
61 #elif LANGUAGE_01 // language code for UK |
|
62 #include "..\data\localization.l01" |
|
63 |
|
64 #endif |
|
65 #endif</codeblock> |
|
66 </li> |
|
67 </ol> |
|
68 </li> |
|
69 <li id="GUID-3B918E68-258B-4724-9C15-58BC60713E75"><p>Include your <parmname>loc</parmname> file |
|
70 in your resource file.</p></li> |
|
71 <li id="GUID-E15A7374-0C92-48E8-8D47-955C974BFBB6"><p>Add your supported |
|
72 language codes to the <parmname>LANG</parmname> statement in your project <parmname>mmp</parmname> file.</p> |
|
73 </li> |
|
74 <li id="GUID-F185FF9B-A926-44E5-9FAD-AD9ABFC8C215"><p>Build your |
|
75 resource files</p> |
|
76 <note> |
|
77 <p>Some IDEs do not fully support building resource files for different |
|
78 languages, so you may need to use the command line interface of the Symbian |
|
79 build chain.</p> |
|
80 </note> |
|
81 </li> |
|
82 <li id="GUID-88D12169-4847-426C-A0AE-8107DE18183F"><p>Include the |
|
83 appropriate compiled resource files in your deployment package.</p><p>For |
|
84 more information on deploying, see <xref href="GUID-7369BBF7-5432-455D-BBB3-872D310358F2.dita"/>.</p> |
|
85 </li> |
|
86 </ol> |
|
87 <p> The following localization strategies are available:</p> |
|
88 <ul> |
|
89 <li><p>Create an installation package for each language your application |
|
90 supports and add only the appropriate compiled resource file to the package</p> |
|
91 </li> |
|
92 <li><p>Create an installation package that includes support for |
|
93 more than one language, which means there is more than one compiled resource |
|
94 file in the package. The mobile device user selects the desired language upon |
|
95 installation, and only the compiled resource file is installed</p></li> |
|
96 <li><p>Create an installation package that includes support for |
|
97 more than one language, which means there is more than one compiled resource |
|
98 file in the package.</p></li> |
|
99 </ul> |
|
100 </conbody></concept> |