diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-DDA0ECF7-BC92-4AFB-998F-5FDD300655FB.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-DDA0ECF7-BC92-4AFB-998F-5FDD300655FB.dita Wed Mar 31 11:11:55 2010 +0100 @@ -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