(m_ptBuf[nBuffer]->GetLineFlags(idx[nBuffer] - 1) & (LF_DIFF | LF_GHOST)) == 0))
{
++nDiff;
- tdtag += strutils::format(_T("<a name=\"d%d\" href=\"#d%d\">%d</a>"), nDiff, nDiff, iVisibleLineNumber);
- iVisibleLineNumber = 0;
+ if (iVisibleLineNumber > 0)
+ {
+ tdtag += strutils::format(_T("<a name=\"d%d\" href=\"#d%d\">%d</a>"), nDiff, nDiff, iVisibleLineNumber);
+ iVisibleLineNumber = 0;
+ }
+ else
+ tdtag += strutils::format(_T("<a name=\"d%d\" href=\"#d%d\">.</a>"), nDiff, nDiff);
}
if (iVisibleLineNumber > 0)
- {
tdtag += strutils::format(_T("%d</td>"), iVisibleLineNumber);
- }
else
tdtag += _T("</td>");
file.WriteString(tdtag);
Const ForReading = 1
+Const NO_BLOCK = 0
+Const MENU_BLOCK = 1
+Const DIALOGEX_BLOCK = 2
+Const STRINGTABLE_BLOCK = 3
+Const VERSIONINFO_BLOCK = 4
+Const ACCELERATORS_BLOCK = 5
+
Dim oFSO, bRunFromCmd
Set oFSO = CreateObject("Scripting.FileSystemObject")
''
' ...
Function GetIdsFromResourceFile(ByVal sRcPath)
- Dim oIds, oTextFile, sLine, iLine
+ Dim oIds, oTextFile, sLine, iLine, iBlockType
Dim reId, oMatch, sId
Set oIds = CreateObject("Scripting.Dictionary")
If (oFSO.FileExists(sRcPath) = True) Then 'If the RC file exists...
iLine = 0
+ iBlockType = NO_BLOCK
Set oTextFile = oFSO.OpenTextFile(sRcPath, ForReading)
Do Until oTextFile.AtEndOfStream = True 'For all lines...
sLine = Trim(oTextFile.ReadLine)
iLine = iLine + 1
+ If (InStr(sLine, " MENU") > 0) Then 'MENU...
+ iBlockType = MENU_BLOCK
+ ElseIf (InStr(sLine, " DIALOGEX") > 0) Then 'DIALOGEX...
+ iBlockType = DIALOGEX_BLOCK
+ ElseIf (sLine = "STRINGTABLE") Then 'STRINGTABLE...
+ iBlockType = STRINGTABLE_BLOCK
+ ElseIf (InStr(sLine, " VERSIONINFO") > 0) Then 'VERSIONINFO...
+ iBlockType = VERSIONINFO_BLOCK
+ ElseIf (InStr(sLine, " ACCELERATORS") > 0) Then 'ACCELERATORS...
+ iBlockType = ACCELERATORS_BLOCK
+ ElseIf (sLine = "BEGIN") Then 'BEGIN...
+ 'IGNORE FOR SPEEDUP!
+ ElseIf (sLine = "END") Then 'END...
+ If (iBlockType = STRINGTABLE_BLOCK) Then 'If inside stringtable...
+ iBlockType = NO_BLOCK
+ End If
+ ElseIf (Left(sLine, 2) = "//") Then 'If comment line...
+ sLine = ""
+ 'IGNORE FOR SPEEDUP!
+ ElseIf (sLine <> "") Then 'If NOT empty line...
+ If (iBlockType = MENU_BLOCK) Or (iBlockType = DIALOGEX_BLOCK) Then
+ sLine = ""
+ End If
+ End If
+
sId = ""
+
If reId.Test(sLine) Then 'If ID...
Set oMatch = reId.Execute(sLine)(0)
sId = oMatch.SubMatches(0)
Next
For Each oSubFolder In oFolder.SubFolders 'For all folders...
- If (oSubFolder.Name <> ".svn") Then 'If NOT a SVN folder...
+ If (oSubFolder.Name <> ".svn") And (oSubFolder.Name <> ".hg") And (oSubFolder.Name <> ".git") Then 'If NOT a SVN folder...
GetIdsFromCppFiles oSubFolder.Path, oIds
End If
Next
status.addProject(PoProject('WinMerge', 'WinMerge/English.pot', 'WinMerge'))
status.addProject(PoProject('ShellExtension', 'ShellExtension/English.pot', 'ShellExtension'))
status.addProject(InnoSetupProject('InnoSetup', 'InnoSetup/English.isl', 'InnoSetup'))
- status.addProject(ReadmeProject('Docs/Readme', 'Docs/Readme.txt', 'Docs/Readme'))
+ status.addProject(ReadmeProject('Docs/Readme', 'Docs/ReadMe.txt', 'Docs/Readme'))
status.writeToXmlFile('TranslationsStatus.xml')
status.writeToHtmlFile('TranslationsStatus.html')