Symbian3/SDK/Source/GUID-FC929B37-20E1-5DA7-91A7-CBBED2E69A6E.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 7 51a74ef9ed63
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?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 <codeph>BaflUtils</codeph> to get an equivalent language list and a nearest
equivalent language. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
<prereq id="GUID-03EE02F1-492A-463A-A64B-9BA086897FAE"><p>This tutorial
assumes that you have an understanding of <xref href="GUID-10A50B7C-63DB-599B-86C1-17989595CBD2.dita">Equivalent Language
Reference</xref> which explains the equivalent language table, including
the equivalent language list and its priority.</p> </prereq>
<context id="GUID-11BBC0DD-7E59-423E-81C3-39FA5E5943C4"><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>