[Winmerge-svn] SF.net SVN: winmerge: [4766] trunk/Src/Languages
Windows visual diff and merge for files and directories
Brought to you by:
christianlist,
grimmdp
From: <ge...@us...> - 2007-11-18 23:32:11
|
Revision: 4766 http://winmerge.svn.sourceforge.net/winmerge/?rev=4766&view=rev Author: gerundt Date: 2007-11-18 15:32:07 -0800 (Sun, 18 Nov 2007) Log Message: ----------- RFE: [ 1830609 ] Need a silent versions of resource scripts (Version 2) Modified Paths: -------------- trunk/Src/Languages/CreateMasterPotFile.vbs trunk/Src/Languages/GetTranslationsStatus.vbs trunk/Src/Languages/UpdatePoFilesFromPotFile.vbs Modified: trunk/Src/Languages/CreateMasterPotFile.vbs =================================================================== --- trunk/Src/Languages/CreateMasterPotFile.vbs 2007-11-18 12:34:30 UTC (rev 4765) +++ trunk/Src/Languages/CreateMasterPotFile.vbs 2007-11-18 23:32:07 UTC (rev 4766) @@ -17,10 +17,15 @@ Const VERSIONINFO_BLOCK = 4 Const ACCELERATORS_BLOCK = 5 -Dim oFSO +Dim oFSO, bRunFromCmd Set oFSO = CreateObject("Scripting.FileSystemObject") +bRunFromCmd = False +If LCase(oFSO.GetFileName(Wscript.FullName)) = "cscript.exe" Then + bRunFromCmd = True +End If + Call Main '' @@ -31,7 +36,7 @@ StartTime = Time - Wscript.Echo "Attention: " & Wscript.ScriptName & " can take few seconds to finish!" + InfoBox "Creating POT file from Merge.rc...", 3 Set oStrings = GetStringsFromRcFile("../Merge.rc", oComments, sCodePage) CreateMasterPotFile "English.pot", oStrings, oComments, sCodePage @@ -39,7 +44,7 @@ EndTime = Time Seconds = DateDiff("s", StartTime, EndTime) - Wscript.Echo Wscript.ScriptName & " finished after " & Seconds & " seconds!" + InfoBox "POT file created, after " & Seconds & " second(s).", 10 End Sub '' @@ -280,3 +285,16 @@ GetPotCreationDate = sYear & "-" & sMonth & "-" & sDay & " " & sHour & ":" & sMinute & "+0000" End Function + +'' +' ... +Function InfoBox(ByVal sText, ByVal iSecondsToWait) + Dim oShell + + If (bRunFromCmd = False) Then 'If run from command line... + Set oShell = Wscript.CreateObject("WScript.Shell") + InfoBox = oShell.Popup(sText, iSecondsToWait, Wscript.ScriptName, 64) + Else 'If NOT run from command line... + Wscript.Echo sText + End If +End Function Modified: trunk/Src/Languages/GetTranslationsStatus.vbs =================================================================== --- trunk/Src/Languages/GetTranslationsStatus.vbs 2007-11-18 12:34:30 UTC (rev 4765) +++ trunk/Src/Languages/GetTranslationsStatus.vbs 2007-11-18 23:32:07 UTC (rev 4766) @@ -30,7 +30,7 @@ StartTime = Time - Wscript.Echo "Attention: " & Wscript.ScriptName & " can take several seconds to finish!" + InfoBox "Creating translations status files...", 3 Set oTranslationsStatus = CreateObject("Scripting.Dictionary") @@ -54,7 +54,7 @@ EndTime = Time Seconds = DateDiff("s", StartTime, EndTime) - Wscript.Echo Wscript.ScriptName & " finished after " & Seconds & " seconds!" + InfoBox "Translations status files created, after " & Seconds & " second(s).", 10 End Sub '' @@ -385,3 +385,16 @@ GetCreationDate = sYear & "-" & sMonth & "-" & sDay End Function + +'' +' ... +Function InfoBox(ByVal sText, ByVal iSecondsToWait) + Dim oShell + + If (bRunFromCmd = False) Then 'If run from command line... + Set oShell = Wscript.CreateObject("WScript.Shell") + InfoBox = oShell.Popup(sText, iSecondsToWait, Wscript.ScriptName, 64) + Else 'If NOT run from command line... + Wscript.Echo sText + End If +End Function Modified: trunk/Src/Languages/UpdatePoFilesFromPotFile.vbs =================================================================== --- trunk/Src/Languages/UpdatePoFilesFromPotFile.vbs 2007-11-18 12:34:30 UTC (rev 4765) +++ trunk/Src/Languages/UpdatePoFilesFromPotFile.vbs 2007-11-18 23:32:07 UTC (rev 4766) @@ -30,7 +30,7 @@ StartTime = Time - Wscript.Echo "Attention: " & Wscript.ScriptName & " can take several seconds to finish!" + InfoBox "Updating PO files from POT file...", 3 sDir = oFSO.GetParentFolderName(Wscript.ScriptFullName) Set oEnglishPotContent = GetContentFromPoFile(sDir & "\English.pot") @@ -40,6 +40,9 @@ For Each oLanguage In oLanguages 'For all languages... sLanguage = CStr(oLanguage) If LCase(oFSO.GetExtensionName(sLanguage)) = "po" Then + If bRunFromCmd Then 'If run from command line... + Wscript.Echo oFSO.GetFileName(sLanguage) + End If Set oLanguagePoContent = GetContentFromPoFile(sLanguage) If oLanguagePoContent.Count > 0 Then 'If content exists... CreateUpdatedPoFile sLanguage, oEnglishPotContent, oLanguagePoContent @@ -50,7 +53,7 @@ EndTime = Time Seconds = DateDiff("s", StartTime, EndTime) - Wscript.Echo Wscript.ScriptName & " finished after " & Seconds & " seconds!" + InfoBox "All PO files updated, after " & Seconds & " second(s).", 10 End Sub '' @@ -75,9 +78,6 @@ reMsgContinued.IgnoreCase = True Set oContent = CreateObject("Scripting.Dictionary") - If bRunFromCmd Then 'If run from command line... - Wscript.Echo sPoPath - End If iMsgStarted = 0 Set oSubContent = New CSubContent @@ -168,3 +168,16 @@ Next oPoFile.Close End Sub + +'' +' ... +Function InfoBox(ByVal sText, ByVal iSecondsToWait) + Dim oShell + + If (bRunFromCmd = False) Then 'If run from command line... + Set oShell = Wscript.CreateObject("WScript.Shell") + InfoBox = oShell.Popup(sText, iSecondsToWait, Wscript.ScriptName, 64) + Else 'If NOT run from command line... + Wscript.Echo sText + End If +End Function This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |