diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-DDA0ECF7-BC92-4AFB-998F-5FDD300655FB.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-DDA0ECF7-BC92-4AFB-998F-5FDD300655FB.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +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.

+
\ No newline at end of file