PoChecker: make the duplicate value test work even if context string is set

git-svn-id: trunk@34606 -
This commit is contained in:
juha 2012-01-06 00:34:47 +00:00
parent d51b2ed1a1
commit 4b7f043a9e
2 changed files with 9 additions and 8 deletions

View File

@ -76,7 +76,7 @@ resourcestring
sErrorOnCreate = 'Error creating an instance of TPoFamily:' + LineEnding + '%s'; sErrorOnCreate = 'Error creating an instance of TPoFamily:' + LineEnding + '%s';
sErrorOnCleanup = 'An unrecoverable error occurred' + LineEnding + '%s' + LineEnding + 'Please close the program'; sErrorOnCleanup = 'An unrecoverable error occurred' + LineEnding + '%s' + LineEnding + 'Please close the program';
sTotalErrors = 'Total errors found: %d'; sTotalErrors = 'Total errors / warnings found: %d';
//sNoErrorsFound = 'No errors found.'; //sNoErrorsFound = 'No errors found.';
sNoTestSelected = 'There are no tests selected.'; sNoTestSelected = 'There are no tests selected.';

View File

@ -97,10 +97,12 @@ const
//sPrevMsgID = '#| msgid "'; //sPrevMsgID = '#| msgid "';
//sPrevStr = '#| "'; //sPrevStr = '#| "';
Divider = '--------------------------------------------------'; Divider = '-------------------------------------------------------';
resourcestring
sOriginal = 'Original'; sOriginal = 'Original';
sTranslation = 'Translation'; sTranslation = 'Translation';
sErrorsByTest = 'Errors reported by %s for:'; sErrorsByTest = 'Errors / warnings reported by %s for:';
sCheckFormatArgs = 'CheckFormatArgs'; sCheckFormatArgs = 'CheckFormatArgs';
sCheckMissingIdentifiers = 'CheckMissingIdentifiers'; sCheckMissingIdentifiers = 'CheckMissingIdentifiers';
sCheckNrOfItems = 'CheckNrOfItems'; sCheckNrOfItems = 'CheckNrOfItems';
@ -108,8 +110,7 @@ const
sCheckDuplicateOriginals = 'CheckDiplicateOriginals'; sCheckDuplicateOriginals = 'CheckDiplicateOriginals';
sIncompatibleFormatArgs = '[Line: %d] Incompatible format() arguments for:' ; sIncompatibleFormatArgs = '[Line: %d] Incompatible format() arguments for:' ;
sNrErrorsFound = 'Found %d errors / warnings.';
sNrErrorsFound = 'Found %d errors.';
sLineInFileName = '[Line %d] in %s:'; sLineInFileName = '[Line %d] in %s:';
sIdentifierNotFoundIn = 'Identifier [%s] not found in %s'; sIdentifierNotFoundIn = 'Identifier [%s] not found in %s';
sMissingMasterIdentifier = 'Identifier [%s] found in %s, but it does not exist in %s'; sMissingMasterIdentifier = 'Identifier [%s] found in %s, but it does not exist in %s';
@ -131,7 +132,7 @@ const
sDuplicateOriginal = 'msgid "%s"'; sDuplicateOriginal = 'msgid "%s"';
sDuplicateContext = 'msgctxt "%s"'; sDuplicateContext = 'msgctxt "%s"';
sDuplicateOriginals2 = 'has the same value as idenftifier %s at line %d'; sDuplicateOriginals2 = 'has the same value as idenftifier %s at line %d';
sDuplicateOriginals3 = 'For this entry it is recommended to set: msgctxt="%s"'; //sDuplicateOriginals3 = 'For this entry it is recommended to set: msgctxt="%s"';
//Helper functions //Helper functions
@ -527,7 +528,7 @@ begin
begin begin
PoItem := FMaster.PoItems[i]; PoItem := FMaster.PoItems[i];
Dup := FMaster.OriginalToItem(PoItem.Original); Dup := FMaster.OriginalToItem(PoItem.Original);
if Assigned(Dup) and (Dup.Identifier <> PoItem.Identifier) and (Dup.Context = '') then if Assigned(Dup) and (Dup.Identifier <> PoItem.Identifier) {and (Dup.Context = '')} then
begin begin
if (ErrorCount = 0) then if (ErrorCount = 0) then
begin begin
@ -544,7 +545,7 @@ begin
ErrorLog.Add(Format(sDuplicateOriginal,[PoItem.Original])); ErrorLog.Add(Format(sDuplicateOriginal,[PoItem.Original]));
ErrorLog.Add(Format(sDuplicateContext,[PoItem.Context])); ErrorLog.Add(Format(sDuplicateContext,[PoItem.Context]));
ErrorLog.Add(Format(sDuplicateOriginals2,[Dup.Identifier,Dup.LineNr])); ErrorLog.Add(Format(sDuplicateOriginals2,[Dup.Identifier,Dup.LineNr]));
ErrorLog.Add(Format(sDuplicateOriginals3,[PoItem.Identifier])); //ErrorLog.Add(Format(sDuplicateOriginals3,[PoItem.Identifier]));
ErrorLog.Add(''); ErrorLog.Add('');
end; end;
end; end;