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");
RFs fileServerSession; CleanupClosePushL(fileServerSession); User::LeaveIfError(fileServerSession.Connect());
BaflUtils::NearestLanguageFileV2().
It will be updated with a new value after the call. TBuf<256> filename; filename.Copy(KRscFilename);
TLanguage lang=ELangNone;
BaflUtils::NearestLanguageFileV2(fileServerSession, filename, lang); ...
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.