OSDN Git Service

Move the paths in CreateMasterPotFile.vbs to const values
authorTim Gerundt <tim@gerundt.de>
Wed, 20 May 2009 16:44:14 +0000 (16:44 +0000)
committerTim Gerundt <tim@gerundt.de>
Wed, 20 May 2009 16:44:14 +0000 (16:44 +0000)
Translations/WinMerge/CreateMasterPotFile.vbs

index 705532a..606da73 100644 (file)
@@ -2,7 +2,7 @@ Option Explicit
 ''
 ' This script creates the master POT file (English.pot).
 '
-' Copyright (C) 2007 by Tim Gerundt
+' Copyright (C) 2007-2009 by Tim Gerundt
 ' Released under the "GNU General Public License"
 '
 ' ID line follows -- this is updated by SVN
@@ -17,6 +17,10 @@ Const STRINGTABLE_BLOCK = 3
 Const VERSIONINFO_BLOCK = 4
 Const ACCELERATORS_BLOCK = 5
 
+Const PATH_ENGLISH_POT = "English.pot"
+Const PATH_MERGE_RC = "../../Src/Merge.rc"
+Const PATH_MERGELANG_RC = "MergeLang.rc"
+
 Dim oFSO, bRunFromCmd
 
 Set oFSO = CreateObject("Scripting.FileSystemObject")
@@ -40,16 +44,16 @@ Sub Main
   InfoBox "Creating POT file from Merge.rc...", 3
   
   bNecessary = True
-  If (oFSO.FileExists("English.pot") = True) And (oFSO.FileExists("MergeLang.rc") = True) Then 'If the POT and RC file exists...
-    bNecessary = GetArchiveBit("../../Src/Merge.rc") Or GetArchiveBit("English.pot") Or GetArchiveBit("MergeLang.rc") 'RCs or POT file changed?
+  If (oFSO.FileExists(PATH_ENGLISH_POT) = True) And (oFSO.FileExists(PATH_MERGELANG_RC) = True) Then 'If the POT and RC file exists...
+    bNecessary = GetArchiveBit(PATH_MERGE_RC) Or GetArchiveBit(PATH_ENGLISH_POT) Or GetArchiveBit(PATH_MERGELANG_RC) 'RCs or POT file changed?
   End If
   
   If (bNecessary = True) Then 'If update necessary...
-    Set oStrings = GetStringsFromRcFile("../../Src/Merge.rc", sCodePage)
-    CreateMasterPotFile "English.pot", oStrings, sCodePage
-    SetArchiveBit "../../Src/Merge.rc", False
-    SetArchiveBit "English.pot", False
-    SetArchiveBit "MergeLang.rc", False
+    Set oStrings = GetStringsFromRcFile(PATH_MERGE_RC, sCodePage)
+    CreateMasterPotFile PATH_ENGLISH_POT, oStrings, sCodePage
+    SetArchiveBit PATH_MERGE_RC, False
+    SetArchiveBit PATH_ENGLISH_POT, False
+    SetArchiveBit PATH_MERGELANG_RC, False
     For Each oFile In oFSO.GetFolder(".").Files 'For all files in the current folder...
       If (LCase(oFSO.GetExtensionName(oFile.Name)) = "po") Then 'If a PO file...
         SetArchiveBit oFile.Path, True