diff -r 51a74ef9ed63 -r ae94777fff8f Symbian3/SDK/Source/GUID-DDA0ECF7-BC92-4AFB-998F-5FDD300655FB.dita --- a/Symbian3/SDK/Source/GUID-DDA0ECF7-BC92-4AFB-998F-5FDD300655FB.dita Wed Mar 31 11:11:55 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-DDA0ECF7-BC92-4AFB-998F-5FDD300655FB.dita Fri Jun 11 12:39:03 2010 +0100 @@ -1,57 +1,57 @@ - - - - - -Getting -a Nearest Equivalent Language

In this example, the system language is ELangCanadianEnglish and -there is no exact match of the resource file on the system. The application -calls BaflUtils::NearestLanguageFileV2() to get the closest -match. There are three available resource files:

- - -

In the application, define a string with the neutral-language resource -file name.

_LIT(KRscFilename, "C:\\FileMenu.rsc");
-
- -

Create a session with the File Server to search the file system for -available resource files. RFs fileServerSession; -CleanupClosePushL(fileServerSession); -User::LeaveIfError(fileServerSession.Connect());

-
- -

Construct a buffer to save a resource file name. The buffer takes -the neutral-language resource file name as a input parameter to BaflUtils::NearestLanguageFileV2(). -It will be updated with a new value after the call. TBuf<256> filename; -filename.Copy(KRscFilename);

-
- -

Define a TLanguage as a return parameter for the -nearest equivalent language. TLanguage lang=ELangNone;

-
- -

Get the nearest language. BaflUtils::NearestLanguageFileV2(fileServerSession, filename, lang); -...

-
- -

Close the session with the File Server. CleanupStack::PopAndDestroy (&fileServerSession);

-
-
-

The filename parameter is updated as "c:\\FileMenu.r10" which -is the closest resource file for ELangCanadianEnglish. The lang parameter -is returned as ELangAmerican (value 10) which is the nearest -equivalent language.

+ + + + + +Getting +a Nearest Equivalent Language

In this example, the system language is ELangCanadianEnglish and +there is no exact match of the resource file on the system. The application +calls BaflUtils::NearestLanguageFileV2() to get the closest +match. There are three available resource files:

    +
  • c:\FileMenu.rsc is +the language-neutral resource file.

  • +
  • c:\FileMenu.r01 is +for ELangEnglish.

  • +
  • c:\FileMenu.r10 is +for ELangAmerican.

  • +
+ + +

In the application, define a string with the neutral-language resource +file name.

_LIT(KRscFilename, "C:\\FileMenu.rsc");
+
+ +

Create a session with the File Server to search the file system for +available resource files. RFs fileServerSession; +CleanupClosePushL(fileServerSession); +User::LeaveIfError(fileServerSession.Connect());

+
+ +

Construct a buffer to save a resource file name. The buffer takes +the neutral-language resource file name as a input parameter to BaflUtils::NearestLanguageFileV2(). +It will be updated with a new value after the call. TBuf<256> filename; +filename.Copy(KRscFilename);

+
+ +

Define a TLanguage as a return parameter for the +nearest equivalent language. TLanguage lang=ELangNone;

+
+ +

Get the nearest language. BaflUtils::NearestLanguageFileV2(fileServerSession, filename, lang); +...

+
+ +

Close the session with the File Server. CleanupStack::PopAndDestroy (&fileServerSession);

+
+
+

The filename parameter is updated as "c:\\FileMenu.r10" which +is the closest resource file for ELangCanadianEnglish. The lang parameter +is returned as ELangAmerican (value 10) which is the nearest +equivalent language.

\ No newline at end of file