From 3eeae12c498d1a4dbe969462d2ba841f77ee3ccb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 2 Jan 2011 01:48:38 +0200 Subject: Initial commit. This code based on mana client http://www.gitorious.org/mana/mana and my private repository. --- packaging/windows/make-translations.vbs | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 packaging/windows/make-translations.vbs (limited to 'packaging/windows/make-translations.vbs') diff --git a/packaging/windows/make-translations.vbs b/packaging/windows/make-translations.vbs new file mode 100644 index 000000000..339a0299e --- /dev/null +++ b/packaging/windows/make-translations.vbs @@ -0,0 +1,42 @@ +Set fso = CreateObject("Scripting.FileSystemObject") +Set WshShell = CreateObject("WScript.Shell") +Dim s, infile, outfile, command + +Function CreateFolderIfNonexistent(folder) + if not fso.FolderExists(folder) then + fso.CreateFolder(folder) + end if +end Function + +'check for existence of msgfmt +if not fso.FileExists("msgfmt.exe") then + WScript.echo "msgfmt.exe not found. Please get gettext for windows from http://gnuwin32.sourceforge.net/packages/gettext.htm and copy the files msgfmt.exe and all dll files from the gettext/bin directory into this directory and run this script again." + WScript.Quit(1) +end if + +CreateFolderIfNonexistent("..\..\translations\") + +'open translation list +Set stream = fso.GetFile("..\..\po\LINGUAS").OpenAsTextStream(1, 0) + +'iterate contents of translations file +translations = 0 +do while not stream.AtEndOfStream + s = stream.ReadLine() + if inStr(s, "#") = false then + 'create the output directory + CreateFolderIfNonexistent("..\..\translations\" + s) + CreateFolderIfNonexistent("..\..\translations\" + s + "\LC_MESSAGES") + 'build the translate command + infile = "../../po/" + s + ".po" + outfile = "../../translations/" + s +"/LC_MESSAGES/mana.mo" + command = "msgfmt -c -o " + outfile + " " + infile + 'execute translate command + errval = WshShell.run(command, 0, true) + if errval = 0 then + translations = translations + 1 + end if + end if +loop + +WScript.echo translations, " translations compiled." -- cgit v1.2.3-60-g2f50