Symbian3/SDK/Source/GUID-FC929B37-20E1-5DA7-91A7-CBBED2E69A6E.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 21 Jan 2010 18:18:20 +0000
changeset 0 89d6a7a84779
permissions -rw-r--r--
Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE task
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="GUID-FC929B37-20E1-5DA7-91A7-CBBED2E69A6E" xml:lang="en"><title>Getting
Equivalent and Nearest Equivalent Languages </title><shortdesc>This section describes how to call functions of <apiname>BaflUtils</apiname> to
get an equivalent language list and a nearest equivalent language. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
<prereq><p>This tutorial assumes that you have an understanding of the following
topics: </p> <ul>
<li id="GUID-3AECC912-FD5E-5837-BB83-763A6536DA73"><p><xref href="GUID-10A50B7C-63DB-599B-86C1-17989595CBD2.dita">Equivalent
Language Reference</xref> explains the equivalent language table, including
the equivalent language list and its priority. </p> </li>
<li id="GUID-BA05E8FE-F6CB-51CE-BA16-39D95631F533"><p><xref href="GUID-28227926-2D5A-500C-B2BC-0EE6CC077DBE.dita">About
Application Resources</xref> describes the purpose of resource files. </p> </li>
<li id="GUID-17BB5D28-C2F7-5B8F-A2AE-36CE1ED04B42"><p><xref href="GUID-F35C5336-907C-5B2A-92C6-F8883D49996E.dita">How
to Localize Resources</xref> describes language-neutral and language-dependent
resource files. </p> </li>
</ul> </prereq>
<context><p> <xref href="GUID-5F9CAA3E-D8BF-3488-9797-3B9FB4452930.dita"><apiname>BaflUtils</apiname></xref> provides the following two static
functions to get the equivalent language list and a nearest equivalent language: </p> <ul>
<li id="GUID-42B035C0-34C1-585E-8195-B317C694018C"><codeblock id="GUID-0686FF33-BE2D-597C-8CC7-422AE32F1554" xml:space="preserve">GetEquivalentLanguageList(TLanguage aLang, TLanguagePath&amp; aEquivalents)</codeblock> <p>For a given language (<xref href="GUID-698538DF-DCDC-347B-BD32-DD9EB896BAFB.dita"><apiname>TLanguage</apiname></xref>), it returns an array
(<xref href="GUID-2533E3D6-D0D8-3638-847D-C5DED07557BD.dita"><apiname>TLanguagePath</apiname></xref>) which contains the equivalent languages.
If no equivalent language is found, <codeph>ELangNone</codeph> is returned. </p> </li>
<li id="GUID-B2CBF4AA-9F96-59E7-BBD1-C069FEF0EACD"><codeblock id="GUID-6C39809C-E824-52B1-8E87-6EE36F333E4D" xml:space="preserve">NearestLanguageFileV2(const RFs&amp; aFs,TFileName&amp; aName, TLanguage&amp; aLanguage)</codeblock> <p>A <xref href="GUID-698538DF-DCDC-347B-BD32-DD9EB896BAFB.dita"><apiname>TLanguage</apiname></xref> value is used at the end of a resource
file name to identify a resource file for a language. For example, <filepath>filename.r01</filepath> and <filepath>filename.r02</filepath> are
the English and French versions of the <filepath>filename.rsc</filepath> resource
file. </p> <p>An application calls <codeph>BaflUtils::NearestLanguageFileV2()</codeph> to
determine which localized resource file is the closest to the current system
language. The function searches the following drives in the given sequence
for the available resource files, which have the same file name (without extension)
as <codeph>aName</codeph>. Once the resource files are searched on a drive,
the function stops searching on the next drive. </p> <ul>
<li id="GUID-8BD6E006-7369-559A-AD7E-7192E7F2C400"><p>The custom resource
drive if it is set using the <codeph>HAL::ECustomResourceDrive</codeph> attribute
or the legacy <codeph>HAL::ESystemDrive</codeph> attribute. </p> </li>
<li id="GUID-E361606A-6E26-5E25-9C0E-429047947BB4"><p>The optional drive if
it is specified in the <codeph>aName</codeph> parameter. </p> </li>
<li id="GUID-D905BA6F-72BE-535E-8225-0018F08E4EAB"><p> <filepath>Z:</filepath> drive
if the optional drive is not set in the <codeph>aName</codeph> parameter. </p> </li>
</ul> <p>The current system language is then taken as a given language. All
the available resource file names are prioritized according to the <xref href="GUID-10A50B7C-63DB-599B-86C1-17989595CBD2.dita">equivalent
language list</xref>. The resource file name with the highest priority is
returned. </p> </li>
</ul> </context>
<steps-unordered>
<step id="GUID-66A7C747-5484-4BAE-9FCD-A6ECF136DF0F"><cmd><xref href="GUID-A6A6BC5B-4988-45B4-863D-0E3733B77EA2.dita">Getting
an Equivalent Language List</xref></cmd>
</step>
<step id="GUID-A1A4F1ED-DD97-4386-81EB-D41033DA1725"><cmd><xref href="GUID-DDA0ECF7-BC92-4AFB-998F-5FDD300655FB.dita">Getting
a Nearest Equivalent Language</xref></cmd>
</step>
</steps-unordered>
</taskbody></task>