Symbian3/SDK/Source/GUID-FC929B37-20E1-5DA7-91A7-CBBED2E69A6E.dita
changeset 0 89d6a7a84779
equal deleted inserted replaced
-1:000000000000 0:89d6a7a84779
       
     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 task
       
    11   PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
       
    12 <task id="GUID-FC929B37-20E1-5DA7-91A7-CBBED2E69A6E" xml:lang="en"><title>Getting
       
    13 Equivalent and Nearest Equivalent Languages </title><shortdesc>This section describes how to call functions of <apiname>BaflUtils</apiname> to
       
    14 get an equivalent language list and a nearest equivalent language. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
       
    15 <prereq><p>This tutorial assumes that you have an understanding of the following
       
    16 topics: </p> <ul>
       
    17 <li id="GUID-3AECC912-FD5E-5837-BB83-763A6536DA73"><p><xref href="GUID-10A50B7C-63DB-599B-86C1-17989595CBD2.dita">Equivalent
       
    18 Language Reference</xref> explains the equivalent language table, including
       
    19 the equivalent language list and its priority. </p> </li>
       
    20 <li id="GUID-BA05E8FE-F6CB-51CE-BA16-39D95631F533"><p><xref href="GUID-28227926-2D5A-500C-B2BC-0EE6CC077DBE.dita">About
       
    21 Application Resources</xref> describes the purpose of resource files. </p> </li>
       
    22 <li id="GUID-17BB5D28-C2F7-5B8F-A2AE-36CE1ED04B42"><p><xref href="GUID-F35C5336-907C-5B2A-92C6-F8883D49996E.dita">How
       
    23 to Localize Resources</xref> describes language-neutral and language-dependent
       
    24 resource files. </p> </li>
       
    25 </ul> </prereq>
       
    26 <context><p> <xref href="GUID-5F9CAA3E-D8BF-3488-9797-3B9FB4452930.dita"><apiname>BaflUtils</apiname></xref> provides the following two static
       
    27 functions to get the equivalent language list and a nearest equivalent language: </p> <ul>
       
    28 <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
       
    29 (<xref href="GUID-2533E3D6-D0D8-3638-847D-C5DED07557BD.dita"><apiname>TLanguagePath</apiname></xref>) which contains the equivalent languages.
       
    30 If no equivalent language is found, <codeph>ELangNone</codeph> is returned. </p> </li>
       
    31 <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
       
    32 file name to identify a resource file for a language. For example, <filepath>filename.r01</filepath> and <filepath>filename.r02</filepath> are
       
    33 the English and French versions of the <filepath>filename.rsc</filepath> resource
       
    34 file. </p> <p>An application calls <codeph>BaflUtils::NearestLanguageFileV2()</codeph> to
       
    35 determine which localized resource file is the closest to the current system
       
    36 language. The function searches the following drives in the given sequence
       
    37 for the available resource files, which have the same file name (without extension)
       
    38 as <codeph>aName</codeph>. Once the resource files are searched on a drive,
       
    39 the function stops searching on the next drive. </p> <ul>
       
    40 <li id="GUID-8BD6E006-7369-559A-AD7E-7192E7F2C400"><p>The custom resource
       
    41 drive if it is set using the <codeph>HAL::ECustomResourceDrive</codeph> attribute
       
    42 or the legacy <codeph>HAL::ESystemDrive</codeph> attribute. </p> </li>
       
    43 <li id="GUID-E361606A-6E26-5E25-9C0E-429047947BB4"><p>The optional drive if
       
    44 it is specified in the <codeph>aName</codeph> parameter. </p> </li>
       
    45 <li id="GUID-D905BA6F-72BE-535E-8225-0018F08E4EAB"><p> <filepath>Z:</filepath> drive
       
    46 if the optional drive is not set in the <codeph>aName</codeph> parameter. </p> </li>
       
    47 </ul> <p>The current system language is then taken as a given language. All
       
    48 the available resource file names are prioritized according to the <xref href="GUID-10A50B7C-63DB-599B-86C1-17989595CBD2.dita">equivalent
       
    49 language list</xref>. The resource file name with the highest priority is
       
    50 returned. </p> </li>
       
    51 </ul> </context>
       
    52 <steps-unordered>
       
    53 <step id="GUID-66A7C747-5484-4BAE-9FCD-A6ECF136DF0F"><cmd><xref href="GUID-A6A6BC5B-4988-45B4-863D-0E3733B77EA2.dita">Getting
       
    54 an Equivalent Language List</xref></cmd>
       
    55 </step>
       
    56 <step id="GUID-A1A4F1ED-DD97-4386-81EB-D41033DA1725"><cmd><xref href="GUID-DDA0ECF7-BC92-4AFB-998F-5FDD300655FB.dita">Getting
       
    57 a Nearest Equivalent Language</xref></cmd>
       
    58 </step>
       
    59 </steps-unordered>
       
    60 </taskbody></task>