From 7d332c02eca7008e54fc88f2f773f4bdceeacb96 Mon Sep 17 00:00:00 2001 From: maxim Date: Wed, 16 Jul 2014 00:43:56 +0000 Subject: [PATCH] IDE: improved localization git-svn-id: trunk@45888 - --- ide/etfpcmsgparser.pas | 2 +- ide/etmessageframe.pas | 2 +- ide/lazarusidestrconsts.pas | 4 ++++ ide/msgquickfixes.pas | 30 +++++++++++++++--------------- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/ide/etfpcmsgparser.pas b/ide/etfpcmsgparser.pas index 4d9c605fa6..28384e75e2 100644 --- a/ide/etfpcmsgparser.pas +++ b/ide/etfpcmsgparser.pas @@ -1880,7 +1880,7 @@ begin if PPUFiles.Count=1 then s+=Format(lisPackage3, [TIDEPackage(PPUFiles.Objects[0]).Name]) else begin - s+=', multiple packages: '; + s+=lisMultiplePack; for i:=0 to PPUFiles.Count-1 do begin if i>0 then s+=', '; diff --git a/ide/etmessageframe.pas b/ide/etmessageframe.pas index 69eae298e1..b957371be1 100644 --- a/ide/etmessageframe.pas +++ b/ide/etmessageframe.pas @@ -712,7 +712,7 @@ begin if sl[i]='' then continue; MsgLine:=PendingLines.CreateLine(-1); MsgLine.Urgency:=mluPanic; - MsgLine.Msg:='internal error: '+sl[i]; + MsgLine.Msg:=Format(lisInternalError, [sl[i]]); PendingLines.Add(MsgLine); end; finally diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 7ecbe8519c..1afb7c6880 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -5740,6 +5740,7 @@ resourcestring lisCanTFindAValidPpu = 'Can''t find a valid %s.ppu'; lisCannotFind = 'Cannot find %s'; lisUsedBy = ' used by %s'; + lisMaybePackage = '. Maybe package %s needs a clean rebuild.'; lisCheckSearchPathPackageTryACleanRebuildCheckImpleme = '. Check search path of' +' package %s, try a clean rebuild, check implementation uses sections.'; lisCheckIfPackageIsInTheDependencies = '. Check if package %s is in the ' @@ -5750,11 +5751,14 @@ resourcestring lisEnableFlagUseUnitOfUnitInPackage = '. Enable flag "Use Unit" of unit %s in package %s'; lisOfTheProjectInspector = ' of the Project Inspector'; lisOfPackage = ' of package %s'; + lisFatal2 = '%s(%s,%s) Fatal: %s'; lisCompileWithVdForMoreDetailsCheckForDuplicates = '%s -> Compile with -vd ' +'for more details. Check for duplicates.'; lisCannotFindUnit = 'Cannot find unit %s'; lisIncompatiblePpu = ', incompatible ppu=%s'; lisPackage3 = ', package %s'; + lisCannotFindPP = 'Cannot find PPU of unit %s'; + lisMultiplePack = ', multiple packages: '; lisQuickFixError = 'QuickFix error'; lisPositionOutsideOfSource = '%s (position outside of source'; lisHideWithProjectOptionVm = 'Hide with project option (-vm%s)'; diff --git a/ide/msgquickfixes.pas b/ide/msgquickfixes.pas index 6337a2add3..8ab22bef8f 100644 --- a/ide/msgquickfixes.pas +++ b/ide/msgquickfixes.pas @@ -572,43 +572,43 @@ begin if PPUFilename<>'' then begin // there is a ppu file, but the compiler didn't like it // => change message - s:='Can not find '+MissingUnitname; + s:=Format(lisCannotFind, [MissingUnitname]); if UsedByUnit<>'' then - s+=' used by '+UsedByUnit; - s+=', ppu='+CreateRelativePath(PPUFilename,Dir); + s+=Format(lisUsedBy, [UsedByUnit]); + s+=', PPU='+CreateRelativePath(PPUFilename,Dir); if PkgName<>'' then - s+=', package '+PkgName; + s+=Format(lisPackage3, [PkgName]); end else if PkgName<>'' then begin // ppu is missing, but the package is known // => change message - s:='Can''t find ppu of unit '+MissingUnitname; + s:=Format(lisCannotFindPP, [MissingUnitname]); if UsedByUnit<>'' then - s+=' used by '+UsedByUnit; - s+='. Maybe package '+PkgName+' needs a clean rebuild.'; + s+=Format(lisUsedBy, [UsedByUnit]); + s+=Format(lisMaybePackage, [PkgName]); end; end else begin // there is no ppu file in the unit path - s:='Can not find unit '+MissingUnitname; + s:=Format(lisCannotFindUnit, [MissingUnitname]); if UsedByUnit<>'' then - s+=' used by '+UsedByUnit; + s+=Format(lisUsedBy, [UsedByUnit]); if (UsedByOwner is TIDEPackage) and (CompareTextCT(TIDEPackage(UsedByOwner).Name,PkgName)=0) then begin // two units of a package can not find each other - s+='. Check search path package '+TIDEPackage(UsedByOwner).Name+', try a clean rebuild, check implementation uses sections.'; + s+=Format(lisCheckSearchPathPackageTryACleanRebuildCheckImpleme, [TIDEPackage(UsedByOwner).Name]); end else begin if PkgName<>'' then - s+='. Check if package '+PkgName+' is in the dependencies'; + s+=Format(lischeckifpackageisinthedependencies, [PkgName]); if UsedByOwner is TLazProject then - s+=' of the project inspector' + s+=lisoftheprojectinspector else if UsedByOwner is TIDEPackage then - s+=' of package '+TIDEPackage(UsedByOwner).Name; + s+=Format(lisOfPackage, [TIDEPackage(UsedByOwner).Name]); end; s+='.'; end; Msg.GetSourcePosition(Filename,Line,Col); - Msg.Msg:=CreateRelativePath(Filename,Msg.Directory) - +'('+IntToStr(Line)+','+IntToStr(Col)+') Fatal: '+s; + Msg.Msg:=Format(lisFatal2, [CreateRelativePath(Filename, Msg.Directory), + IntToStr(Line), IntToStr(Col), s]); {$IFDEF VerboseQuickFixUnitNotFoundPosition} debugln(['TQuickFixUnitNotFoundPosition.Execute Msg.Msg="',Msg.Msg,'"']); {$ENDIF}