2
// <copyright see="prj:///doc/copyright.txt"/>
3
// <license see="prj:///doc/license.txt"/>
4
// <owner name="" email=""/>
5
// <version>$Revision$</version>
9
using System.Collections;
11
using System.Resources;
14
using System.Drawing.Imaging;
15
using System.Windows.Forms;
16
using System.Runtime.Serialization.Formatters.Binary;
19
public class TranslationBuilder
21
static void Assemble(string pattern)
23
string[] files = Directory.GetFiles(Directory.GetCurrentDirectory(), pattern);
25
foreach (string file in files) {
26
if (Path.GetExtension(file).ToUpper() == ".XML") {
28
XmlDocument doc = new XmlDocument();
30
string resfilename = "StringResources." + doc.DocumentElement.Attributes["language"].InnerText + ".resources";
31
ResourceWriter rw = new ResourceWriter(resfilename);
33
foreach (XmlElement el in doc.DocumentElement.ChildNodes) {
34
rw.AddResource(el.Attributes["name"].InnerText,
40
} catch (Exception e) {
41
Console.WriteLine("Error while processing " + file + " :");
42
Console.WriteLine(e.ToString());
48
static void ShowHelp()
50
Console.WriteLine(".NET Translation Builder Version 0.1");
51
Console.WriteLine("Copyright (C) Mike Krueger 2001. Released under GPL.\n");
52
Console.WriteLine(" Translation Builder Options Options\n");
53
Console.WriteLine(" - INPUT FILES -");
54
Console.WriteLine("<wildcard> translates the given xml files into resource files");
57
public static void Main(string[] args)
59
if (args.Length == 0) {
62
foreach (string param in args) {
63
string par = param.ToUpper();
64
if (par == "/?" || par == "/H" || par== "-?" || par == "-H" || par == "?") {