669 void CCaWidgetDescription::LocalizeTextsL() |
669 void CCaWidgetDescription::LocalizeTextsL() |
670 { |
670 { |
671 if( iTranslationFileName.Length() ) |
671 if( iTranslationFileName.Length() ) |
672 { |
672 { |
673 RBuf translationFileName; |
673 RBuf translationFileName; |
674 translationFileName.Create( iTranslationFileName.Length() + 1 ); |
|
675 CleanupClosePushL( translationFileName ); |
674 CleanupClosePushL( translationFileName ); |
|
675 translationFileName.CreateL( iTranslationFileName.Length() + 1 ); |
676 translationFileName.Copy( iTranslationFileName ); |
676 translationFileName.Copy( iTranslationFileName ); |
677 translationFileName.Append( KWidgetScannerUnderline ); |
677 translationFileName.Append( KWidgetScannerUnderline ); |
678 |
678 |
679 |
|
680 if( !HbTextResolverSymbian::Init( translationFileName, KLocalizationFilepathC ) ) |
679 if( !HbTextResolverSymbian::Init( translationFileName, KLocalizationFilepathC ) ) |
681 { |
680 { |
682 if( !HbTextResolverSymbian::Init( translationFileName, KLocalizationFilepathZ ) ) |
681 if( !HbTextResolverSymbian::Init( translationFileName, KLocalizationFilepathZ ) ) |
683 { |
682 { |
684 // this should not be called too often |
683 // this should not be called too often |
685 TChar currentDriveLetter; |
684 TChar currentDriveLetter; |
686 TDriveList driveList; |
685 TDriveList driveList; |
687 RFs fs; |
686 RFs fs; |
688 User::LeaveIfError( fs.Connect() ); |
687 User::LeaveIfError( fs.Connect() ); |
689 User::LeaveIfError( fs.DriveList( driveList ) ); |
688 User::LeaveIfError( fs.DriveList( driveList ) ); |
690 |
689 |
691 RBuf path; |
690 RBuf path; |
692 path.Create( KLocalizationFilepath().Length() + 1 ); |
691 CleanupClosePushL( path ); |
693 CleanupClosePushL( path ); |
692 path.CreateL( KLocalizationFilepath().Length() + 1 ); |
694 |
693 |
695 for( TInt driveNr=EDriveY; driveNr >= EDriveA; driveNr-- ) |
694 for( TInt driveNr=EDriveY; driveNr >= EDriveA; driveNr-- ) |
696 { |
695 { |
697 if( driveList[driveNr] ) |
696 if( driveList[driveNr] ) |
698 { |
697 { |
699 User::LeaveIfError( fs.DriveToChar( driveNr, |
698 User::LeaveIfError( fs.DriveToChar( driveNr, |
700 currentDriveLetter ) ); |
699 currentDriveLetter ) ); |
701 path.Append( currentDriveLetter ); |
700 path.Append( currentDriveLetter ); |
702 path.Append( KLocalizationFilepath ); |
701 path.Append( KLocalizationFilepath ); |
703 if( HbTextResolverSymbian::Init( translationFileName, path ) ) |
702 if( HbTextResolverSymbian::Init( translationFileName, path ) ) |
704 { |
703 { |
705 break; |
704 break; |
706 } |
705 } |
707 } |
706 } |
708 path.Zero(); |
707 path.Zero(); |
709 } |
708 } |
710 CleanupStack::PopAndDestroy( &path ); |
709 CleanupStack::PopAndDestroy( &path ); |
711 fs.Close(); |
710 fs.Close(); |
712 } |
711 } |
713 } |
712 } |
714 |
713 |
715 HBufC* tmp; |
714 HBufC* tmp; |
716 |
715 |
717 if( iTitle.Length() ) |
716 if( iTitle.Length() ) |
718 { |
717 { |