This commit is contained in:
2023-04-28 12:21:24 +08:00
parent 156d145a48
commit 88e0a25ecd
162 changed files with 26324 additions and 7519 deletions

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@ -0,0 +1,143 @@
namespace LanguageExtractTool
{
partial class FleetInspection
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.txt_src = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txt_destdir = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.fbd = new System.Windows.Forms.FolderBrowserDialog();
this.ofd = new System.Windows.Forms.OpenFileDialog();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(63, 38);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(43, 13);
this.label1.TabIndex = 0;
this.label1.Text = "源文件";
//
// txt_src
//
this.txt_src.Location = new System.Drawing.Point(114, 35);
this.txt_src.Name = "txt_src";
this.txt_src.Size = new System.Drawing.Size(362, 20);
this.txt_src.TabIndex = 1;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(39, 91);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(67, 13);
this.label2.TabIndex = 2;
this.label2.Text = "目标文件夹";
//
// txt_destdir
//
this.txt_destdir.Location = new System.Drawing.Point(113, 91);
this.txt_destdir.Name = "txt_destdir";
this.txt_destdir.Size = new System.Drawing.Size(363, 20);
this.txt_destdir.TabIndex = 3;
//
// button1
//
this.button1.Location = new System.Drawing.Point(482, 33);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(116, 23);
this.button1.TabIndex = 4;
this.button1.Text = "选择源文件";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(482, 91);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(116, 23);
this.button2.TabIndex = 5;
this.button2.Text = "选择目标文件夹";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(268, 156);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 6;
this.button3.Text = "开始提取";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// ofd
//
this.ofd.Filter = "xml files|*.xml|All files|*.*";
//
// FleetInspection
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(614, 193);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.txt_destdir);
this.Controls.Add(this.label2);
this.Controls.Add(this.txt_src);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "FleetInspection";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "提取Inspection多语言文件";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txt_src;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txt_destdir;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.FolderBrowserDialog fbd;
private System.Windows.Forms.OpenFileDialog ofd;
}
}

View File

@ -0,0 +1,114 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml;
using System.IO;
using Newtonsoft.Json;
using static LanguageExtractTool.Form1;
using System.Xml.Linq;
namespace LanguageExtractTool
{
public partial class FleetInspection : Form
{
public FleetInspection()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (ofd.ShowDialog() == DialogResult.OK)
{
txt_src.Text = ofd.FileName;
}
}
private void button2_Click(object sender, EventArgs e)
{
if (fbd.ShowDialog() == DialogResult.OK)
{
txt_destdir.Text = fbd.SelectedPath;
}
}
private void button3_Click(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(txt_src.Text))
{
MessageBox.Show("请选择源文件");
return;
}
if (string.IsNullOrWhiteSpace(txt_destdir.Text))
{
MessageBox.Show("请选择要存放资源文件的文件夹");
return;
}
string destpath = txt_destdir.Text.Trim();
XmlDocument doc = new XmlDocument();
doc.Load(txt_src.Text);
Dictionary<string, ResourceObject> dics = new Dictionary<string, ResourceObject>(StringComparer.OrdinalIgnoreCase);
foreach (XmlNode node in doc.DocumentElement.ChildNodes)
{
string code = node.Name;
foreach (XmlNode node1 in node.ChildNodes)
{
if (string.IsNullOrWhiteSpace(node1.InnerText))
{
continue;
}
string lgid = node1.Name;
ResourceObject res = null;
if (dics.TryGetValue(lgid, out res))
{
res.Values[code] = node1.InnerText;
}
else
{
res = new ResourceObject();
res.LanguageId = lgid;
dics.Add(lgid, res);
res.Values[code] = node1.InnerText;
}
}
}
foreach (var dic in dics)
{
string filename = dic.Key;
if (dic.Key == "en-us")
filename = "en";
else if (dic.Key == "fr-fr")
filename = "fr";
else if (dic.Key == "es-es")
filename = "es";
string fn = Path.Combine(txt_destdir.Text.Trim(), filename + ".xml");
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.AppendChild(xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", null));
XmlElement root = xmlDoc.CreateElement("root");
xmlDoc.AppendChild(root);
foreach (var item in dic.Value.Values)
{
XmlElement el = xmlDoc.CreateElement(item.Key);
el.InnerText = item.Value;
root.AppendChild(el);
}
xmlDoc.Save(fn);
}
MessageBox.Show("分解完成。");
}
}
}

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="fbd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ofd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>87, 17</value>
</metadata>
</root>

143
LanguageExtractTool/Form1.Designer.cs generated Normal file
View File

@ -0,0 +1,143 @@
namespace LanguageExtractTool
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.txt_src = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txt_destdir = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.fbd = new System.Windows.Forms.FolderBrowserDialog();
this.ofd = new System.Windows.Forms.OpenFileDialog();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(63, 38);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(43, 13);
this.label1.TabIndex = 0;
this.label1.Text = "源文件";
//
// txt_src
//
this.txt_src.Location = new System.Drawing.Point(114, 35);
this.txt_src.Name = "txt_src";
this.txt_src.Size = new System.Drawing.Size(362, 20);
this.txt_src.TabIndex = 1;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(39, 91);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(67, 13);
this.label2.TabIndex = 2;
this.label2.Text = "目标文件夹";
//
// txt_destdir
//
this.txt_destdir.Location = new System.Drawing.Point(113, 91);
this.txt_destdir.Name = "txt_destdir";
this.txt_destdir.Size = new System.Drawing.Size(363, 20);
this.txt_destdir.TabIndex = 3;
//
// button1
//
this.button1.Location = new System.Drawing.Point(482, 33);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(116, 23);
this.button1.TabIndex = 4;
this.button1.Text = "选择源文件";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(482, 91);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(116, 23);
this.button2.TabIndex = 5;
this.button2.Text = "选择目标文件夹";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(268, 156);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 6;
this.button3.Text = "开始提取";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// ofd
//
this.ofd.Filter = "xml files|*.xml|All files|*.*";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(614, 193);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.txt_destdir);
this.Controls.Add(this.label2);
this.Controls.Add(this.txt_src);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "提取Fleet多语言文件";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txt_src;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txt_destdir;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.FolderBrowserDialog fbd;
private System.Windows.Forms.OpenFileDialog ofd;
}
}

View File

@ -0,0 +1,160 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml;
using System.IO;
using Newtonsoft.Json;
namespace LanguageExtractTool
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
//this.txt_src.Text = @"E:\IronIntel\Contractor2.0\Language\contractor_res.xml";
//this.txt_destdir.Text = @"E:\IronIntel\Contractor2.0\Contractor\Site\Languages";
}
private void button1_Click(object sender, EventArgs e)
{
if (ofd.ShowDialog() == DialogResult.OK)
{
txt_src.Text = ofd.FileName;
}
}
private void button2_Click(object sender, EventArgs e)
{
if (fbd.ShowDialog() == DialogResult.OK)
{
txt_destdir.Text = fbd.SelectedPath;
}
}
private void button3_Click(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(txt_src.Text))
{
MessageBox.Show("请选择源文件");
return;
}
if (string.IsNullOrWhiteSpace(txt_destdir.Text))
{
MessageBox.Show("请选择要存放资源文件的文件夹");
return;
}
string destpath = txt_destdir.Text.Trim();
XmlDocument doc = new XmlDocument();
doc.Load(txt_src.Text);
Dictionary<string, ResourceObject> docs = GetResources();
foreach (XmlNode node in doc.DocumentElement.ChildNodes)
{
if (string.Equals(node.Name, "Category", StringComparison.OrdinalIgnoreCase))
{
foreach (XmlNode codenode in node.ChildNodes)
{
string code = codenode.Name;
foreach (var d in docs)
{
string lgid = d.Key;
XmlNode node1 = codenode[lgid];
if (node1 == null)
{
var lgids = lgid.Split('-');
node1 = codenode[lgids[0]];
}
if (node1 != null)
d.Value.Values[code] = node1.InnerText;
}
}
}
}
foreach (var kv in docs)
{
string fn = Path.Combine(txt_destdir.Text.Trim(), kv.Key + ".json");
string s = JsonConvert.SerializeObject(kv.Value);
using (FileStream fs = new FileStream(fn, FileMode.Create, FileAccess.Write))
{
using (StreamWriter sw = new StreamWriter(fs, Encoding.UTF8))
{
sw.Write(s);
}
}
}
MessageBox.Show("分解完成。");
}
private Dictionary<string, ResourceObject> GetResources()
{
Dictionary<string, ResourceObject> docs = new Dictionary<string, ResourceObject>(StringComparer.OrdinalIgnoreCase);
ResourceObject resen = new ResourceObject();
resen.Ver = Convert.ToInt64(DateTime.Now.ToString("yyMMddHHmm"));
resen.LanguageId = "en";
docs.Add("en", resen);
ResourceObject resfr = new ResourceObject();
resfr.Ver = Convert.ToInt64(DateTime.Now.ToString("yyMMddHHmm"));
resfr.LanguageId = "fr";
docs.Add("fr", resfr);
ResourceObject res1 = new ResourceObject();
res1.Ver = Convert.ToInt64(DateTime.Now.ToString("yyMMddHHmm"));
res1.LanguageId = "en-us";
docs.Add("en-us", res1);
ResourceObject res2 = new ResourceObject();
res2.Ver = Convert.ToInt64(DateTime.Now.ToString("yyMMddHHmm"));
res2.LanguageId = "en-ca";
docs.Add("en-ca", res2);
ResourceObject res3 = new ResourceObject();
res3.Ver = Convert.ToInt64(DateTime.Now.ToString("yyMMddHHmm"));
res3.LanguageId = "en-au";
docs.Add("en-au", res3);
ResourceObject res4 = new ResourceObject();
res4.Ver = Convert.ToInt64(DateTime.Now.ToString("yyMMddHHmm"));
res4.LanguageId = "en-Components";
docs.Add("en-Components", res4);
ResourceObject res5 = new ResourceObject();
res5.Ver = Convert.ToInt64(DateTime.Now.ToString("yyMMddHHmm"));
res5.LanguageId = "fr-fr";
docs.Add("fr-fr", res5);
ResourceObject res6 = new ResourceObject();
res6.Ver = Convert.ToInt64(DateTime.Now.ToString("yyMMddHHmm"));
res6.LanguageId = "fr-ca";
docs.Add("fr-ca", res6);
ResourceObject res7 = new ResourceObject();
res7.Ver = Convert.ToInt64(DateTime.Now.ToString("yyMMddHHmm"));
res7.LanguageId = "zh-cn";
docs.Add("zh-cn", res7);
return docs;
}
public class ResourceObject
{
public long Ver { get; set; } = 100;
public string LanguageId { get; set; } = "en-us";
public Dictionary<string, string> Values { get; private set; } = new Dictionary<string, string>();
}
}
}

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="fbd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ofd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>87, 17</value>
</metadata>
</root>

165
LanguageExtractTool/Form2.Designer.cs generated Normal file
View File

@ -0,0 +1,165 @@
namespace LanguageExtractTool
{
partial class Form2
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ofd = new System.Windows.Forms.OpenFileDialog();
this.btn_export = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.txt_src = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.cbx_languages = new System.Windows.Forms.ComboBox();
this.btn_import_mobile = new System.Windows.Forms.Button();
this.btn_export_mobile = new System.Windows.Forms.Button();
this.btn_import = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// ofd
//
this.ofd.Filter = "xml files|*.xml|All files|*.*";
//
// btn_export
//
this.btn_export.Location = new System.Drawing.Point(63, 133);
this.btn_export.Name = "btn_export";
this.btn_export.Size = new System.Drawing.Size(99, 28);
this.btn_export.TabIndex = 41;
this.btn_export.Text = "导出Excel";
this.btn_export.UseVisualStyleBackColor = true;
this.btn_export.Click += new System.EventHandler(this.btn_export_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(492, 66);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(116, 23);
this.button1.TabIndex = 40;
this.button1.Text = "选择源文件";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click_1);
//
// txt_src
//
this.txt_src.Location = new System.Drawing.Point(111, 68);
this.txt_src.Name = "txt_src";
this.txt_src.Size = new System.Drawing.Size(362, 20);
this.txt_src.TabIndex = 39;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(60, 71);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(43, 13);
this.label1.TabIndex = 38;
this.label1.Text = "源文件";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(72, 26);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(31, 13);
this.label2.TabIndex = 42;
this.label2.Text = "语言";
//
// cbx_languages
//
this.cbx_languages.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbx_languages.FormattingEnabled = true;
this.cbx_languages.Location = new System.Drawing.Point(111, 23);
this.cbx_languages.Name = "cbx_languages";
this.cbx_languages.Size = new System.Drawing.Size(362, 21);
this.cbx_languages.TabIndex = 43;
//
// btn_import_mobile
//
this.btn_import_mobile.Location = new System.Drawing.Point(451, 133);
this.btn_import_mobile.Name = "btn_import_mobile";
this.btn_import_mobile.Size = new System.Drawing.Size(112, 28);
this.btn_import_mobile.TabIndex = 46;
this.btn_import_mobile.Text = "导入Excel (Mobile)";
this.btn_import_mobile.UseVisualStyleBackColor = true;
this.btn_import_mobile.Click += new System.EventHandler(this.btn_import_mobile_Click);
//
// btn_export_mobile
//
this.btn_export_mobile.Location = new System.Drawing.Point(324, 133);
this.btn_export_mobile.Name = "btn_export_mobile";
this.btn_export_mobile.Size = new System.Drawing.Size(121, 28);
this.btn_export_mobile.TabIndex = 45;
this.btn_export_mobile.Text = "导出Excel (Mobile)";
this.btn_export_mobile.UseVisualStyleBackColor = true;
this.btn_export_mobile.Click += new System.EventHandler(this.btn_export_mobile_Click);
//
// btn_import
//
this.btn_import.Location = new System.Drawing.Point(168, 133);
this.btn_import.Name = "btn_import";
this.btn_import.Size = new System.Drawing.Size(84, 28);
this.btn_import.TabIndex = 44;
this.btn_import.Text = "导入Excel";
this.btn_import.UseVisualStyleBackColor = true;
this.btn_import.Click += new System.EventHandler(this.btn_import_Click);
//
// Form2
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(675, 195);
this.Controls.Add(this.btn_import_mobile);
this.Controls.Add(this.btn_export_mobile);
this.Controls.Add(this.btn_import);
this.Controls.Add(this.cbx_languages);
this.Controls.Add(this.label2);
this.Controls.Add(this.btn_export);
this.Controls.Add(this.button1);
this.Controls.Add(this.txt_src);
this.Controls.Add(this.label1);
this.Name = "Form2";
this.Text = "多语言Excel导入导出";
this.Load += new System.EventHandler(this.Form2_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.OpenFileDialog ofd;
private System.Windows.Forms.Button btn_export;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox txt_src;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox cbx_languages;
private System.Windows.Forms.Button btn_import_mobile;
private System.Windows.Forms.Button btn_export_mobile;
private System.Windows.Forms.Button btn_import;
}
}

View File

@ -0,0 +1,536 @@
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
using IronIntel.Contractor;
using IronIntel.Contractor.ExportExcel;
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml;
namespace LanguageExtractTool
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
List<Languages> lan = new List<Languages>();
lan.Add(new Languages { ID = "all", Name = "ALL" });
lan.Add(new Languages { ID = "en-us", Name = "English (United States)" });
lan.Add(new Languages { ID = "en-ca", Name = "English (Canada)" });
lan.Add(new Languages { ID = "en-au", Name = "English (Australia)" });
lan.Add(new Languages { ID = "fr-fr", Name = "français (France)" });
lan.Add(new Languages { ID = "fr-ca", Name = "français (Canada)" });
lan.Add(new Languages { ID = "zh-cn", Name = "中文" });
lan.Add(new Languages { ID = "es-es", Name = "Spain" });
this.cbx_languages.ValueMember = "ID";
this.cbx_languages.DisplayMember = "Name";
this.cbx_languages.DataSource = lan;
}
private void button1_Click_1(object sender, EventArgs e)
{
if (ofd.ShowDialog() == DialogResult.OK)
{
txt_src.Text = ofd.FileName;
}
}
private void btn_export_Click(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(txt_src.Text))
{
MessageBox.Show("请选择源文件");
return;
}
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "Excel files(*.xlsx)|*.xlsx";
sfd.FilterIndex = 1;
sfd.RestoreDirectory = true;
if (sfd.ShowDialog() == DialogResult.OK)
{
List<LanguagesItem> ls = LoadLanguagesXml();
byte[] buffer = ExportLanguages(ls);
try
{
using (FileStream fs = new FileStream(sfd.FileName, FileMode.Create, FileAccess.Write))
{
fs.Write(buffer, 0, buffer.Length);
MessageBox.Show("导出成功");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
private void btn_import_Click(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(txt_src.Text))
{
MessageBox.Show("请选择源文件");
return;
}
OpenFileDialog sfd = new OpenFileDialog();
sfd.Title = "Excel文件";
sfd.FileName = "";
sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
sfd.Filter = "Excel文件| *.xlsx;*.xls";
sfd.ValidateNames = true;
sfd.CheckFileExists = true;
sfd.CheckPathExists = true;
if (sfd.ShowDialog() == DialogResult.OK)
{
try
{
using (FileStream fs = new FileStream(sfd.FileName, FileMode.Open, FileAccess.Read))
{
byte[] fileBuffer = new byte[fs.Length];
fs.Read(fileBuffer, 0, Convert.ToInt32(fs.Length));
DataTable dt = new ImportFromExcel().LoadExcelData(fileBuffer);
if (dt == null || dt.Rows.Count == 0)
return;
List<LanguagesItem> ls = LoadLanguagesDataTable(dt);
ImportExcel(ls);
MessageBox.Show("导入成功");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
private void btn_export_mobile_Click(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(txt_src.Text))
{
MessageBox.Show("请选择源文件");
return;
}
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "Excel files(*.xlsx)|*.xlsx";
sfd.FilterIndex = 1;
sfd.RestoreDirectory = true;
if (sfd.ShowDialog() == DialogResult.OK)
{
List<LanguagesItem> ls = LoadLanguagesMobileXml();
byte[] buffer = ExportLanguages(ls);
try
{
using (FileStream fs = new FileStream(sfd.FileName, FileMode.Create, FileAccess.Write))
{
fs.Write(buffer, 0, buffer.Length);
MessageBox.Show("导出成功");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
private void btn_import_mobile_Click(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(txt_src.Text))
{
MessageBox.Show("请选择源文件");
return;
}
OpenFileDialog sfd = new OpenFileDialog();
sfd.Title = "Excel文件";
sfd.FileName = "";
sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
sfd.Filter = "Excel文件| *.xlsx;*.xls";
sfd.ValidateNames = true;
sfd.CheckFileExists = true;
sfd.CheckPathExists = true;
if (sfd.ShowDialog() == DialogResult.OK)
{
try
{
using (FileStream fs = new FileStream(sfd.FileName, FileMode.Open, FileAccess.Read))
{
byte[] fileBuffer = new byte[fs.Length];
fs.Read(fileBuffer, 0, Convert.ToInt32(fs.Length));
DataTable dt = new ImportFromExcel().LoadExcelData(fileBuffer);
if (dt == null || dt.Rows.Count == 0)
return;
List<LanguagesItem> ls = LoadLanguagesDataTable(dt);
ImportExcelMobile(ls);
MessageBox.Show("导入成功");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
private List<LanguagesItem> LoadLanguagesXml()
{
XmlDocument doc = new XmlDocument();
doc.Load(txt_src.Text);
List<LanguagesItem> ls = new List<LanguagesItem>();
foreach (XmlNode node in doc.DocumentElement.ChildNodes)
{
if (string.Equals(node.Name, "Category", StringComparison.OrdinalIgnoreCase))
{
foreach (XmlNode codenode in node.ChildNodes)
{
LanguagesItem li = new LanguagesItem();
li.ID = codenode.Name;
foreach (XmlNode node1 in codenode.ChildNodes)
{
if (string.IsNullOrWhiteSpace(node1.InnerText))
{
continue;
}
string lgid = node1.Name;
string lgvalue = node1.InnerText;
lgvalue = lgvalue.Replace("\n", "<br/>");
lgvalue = Regex.Replace(lgvalue, "^ | $", "<blank>");
if (string.Compare(lgid, "en-us", true) == 0)
li.EnglishUS = lgvalue;
else if (string.Compare(lgid, "en-au", true) == 0)
li.EnglishAU = lgvalue;
else if (string.Compare(lgid, "en-ca", true) == 0)
li.EnglishCA = lgvalue;
else if (string.Compare(lgid, "fr-fr", true) == 0)
li.France = lgvalue;
else if (string.Compare(lgid, "fr-ca", true) == 0)
li.FranceCA = lgvalue;
else if (string.Compare(lgid, "zh-cn", true) == 0)
li.Chinese = lgvalue;
else if (string.Compare(lgid, "es-es", true) == 0)
li.Spain = lgvalue;
}
ls.Add(li);
}
}
}
return ls;
}
private List<LanguagesItem> LoadLanguagesMobileXml()
{
XmlDocument doc = new XmlDocument();
doc.Load(txt_src.Text);
List<LanguagesItem> ls = new List<LanguagesItem>();
foreach (XmlNode node in doc.DocumentElement.ChildNodes)
{
LanguagesItem li = new LanguagesItem();
li.ID = node.Name;
foreach (XmlNode node1 in node.ChildNodes)
{
if (string.IsNullOrWhiteSpace(node1.InnerText))
{
continue;
}
string lgid = node1.Name;
string lgvalue = node1.InnerText;
if (string.Compare(lgid, "en-us", true) == 0)
li.EnglishUS = lgvalue;
else if (string.Compare(lgid, "en-au", true) == 0)
li.EnglishAU = lgvalue;
else if (string.Compare(lgid, "en-ca", true) == 0)
li.EnglishCA = lgvalue;
else if (string.Compare(lgid, "fr-fr", true) == 0)
li.France = lgvalue;
else if (string.Compare(lgid, "fr-ca", true) == 0)
li.FranceCA = lgvalue;
else if (string.Compare(lgid, "zh-cn", true) == 0)
li.Chinese = lgvalue;
else if (string.Compare(lgid, "es-es", true) == 0)
li.Spain = lgvalue;
}
ls.Add(li);
}
return ls;
}
private byte[] ExportLanguages(List<LanguagesItem> ls)
{
string clgid = cbx_languages.SelectedValue.ToString();
ExportToExcel ete = new ExportToExcel();
DataTable dt = new DataTable();
dt.Columns.Add("ID", typeof(string));
dt.Columns.Add("English (United States)", typeof(string));
if (clgid == "all")
{
dt.Columns.Add("English (Canada)", typeof(string));
dt.Columns.Add("English (Australia)", typeof(string));
dt.Columns.Add("français (France)", typeof(string));
dt.Columns.Add("français (Canada)", typeof(string));
dt.Columns.Add("中文", typeof(string));
dt.Columns.Add("Spain", typeof(string));
}
else if (clgid == "en-ca")
dt.Columns.Add("English (Canada)", typeof(string));
else if (clgid == "en-au")
dt.Columns.Add("English (Australia)", typeof(string));
else if (clgid == "fr-fr")
dt.Columns.Add("français (France)", typeof(string));
else if (clgid == "fr-ca")
dt.Columns.Add("français (Canada)", typeof(string));
else if (clgid == "zh-cn")
dt.Columns.Add("中文", typeof(string));
else if (clgid == "es-es")
dt.Columns.Add("Spain", typeof(string));
foreach (var item in ls)
{
DataRow row = dt.NewRow();
row[0] = item.ID;
row[1] = item.EnglishUS;
if (clgid == "all")
{
row[2] = item.EnglishCA;
row[3] = item.EnglishAU;
row[4] = item.France;
row[5] = item.FranceCA;
row[6] = item.Chinese;
row[7] = item.Spain;
}
else if (clgid == "en-ca")
row[2] = item.EnglishCA;
else if (clgid == "en-au")
row[2] = item.EnglishAU;
else if (clgid == "fr-fr")
row[2] = item.France;
else if (clgid == "fr-ca")
row[2] = item.FranceCA;
else if (clgid == "zh-cn")
row[2] = item.Chinese;
else if (clgid == "es-es")
row[2] = item.Spain;
dt.Rows.Add(row);
}
double[] widths = new double[] { 200d, 200d, 200d, 200d, 200d, 200d, 200d, 200d };
byte[] data = ete.CreateExcel(dt, null, widths, null);
return data;
}
private List<LanguagesItem> LoadLanguagesDataTable(DataTable dt)
{
List<LanguagesItem> ls = new List<LanguagesItem>();
string clgid = cbx_languages.SelectedValue.ToString();
foreach (DataRow dr in dt.Rows)
{
LanguagesItem li = new LanguagesItem();
li.ID = dr["ID"].ToString();
li.EnglishUS = DataRowValue(dr, "en-us");
if (clgid == "all")
{
li.EnglishCA = DataRowValue(dr, "en-ca");
li.EnglishAU = DataRowValue(dr, "en-au");
li.France = DataRowValue(dr, "fr-fr");
li.FranceCA = DataRowValue(dr, "fr-ca");
li.Chinese = DataRowValue(dr, "zh-cn");
li.Spain = DataRowValue(dr, "es-es");
}
else if (clgid == "en-ca")
li.EnglishCA = DataRowValue(dr, clgid);
else if (clgid == "en-au")
li.EnglishAU = DataRowValue(dr, clgid);
else if (clgid == "fr-fr")
li.France = DataRowValue(dr, clgid);
else if (clgid == "fr-ca")
li.FranceCA = DataRowValue(dr, clgid);
else if (clgid == "zh-cn")
li.Chinese = DataRowValue(dr, clgid);
else if (clgid == "es-es")
li.Spain = DataRowValue(dr, clgid);
ls.Add(li);
}
return ls;
}
private string DataRowValue(DataRow dr, string lgid)
{
string value = string.Empty;
if (lgid == "en-ca")
value = "English (Canada)";
else if (lgid == "en-au")
value = "English (Australia)";
else if (lgid == "fr-fr")
value = "français (France)";
else if (lgid == "fr-ca")
value = "français (Canada)";
else if (lgid == "zh-cn")
value = "中文";
else if (lgid == "es-es")
value = "Spain";
else
value = "English (United States)";
string v = dr[value].ToString();
v = Regex.Replace(v, "^<blank>|<blank>$", " ");
return v;
}
private void ImportExcel(List<LanguagesItem> ls)
{
if (ls == null || ls.Count == 0)
return;
string clgid = cbx_languages.SelectedValue.ToString();
XmlDocument doc = new XmlDocument();
doc.Load(txt_src.Text);
foreach (XmlNode node in doc.DocumentElement.ChildNodes)
{
if (string.Equals(node.Name, "Category", StringComparison.OrdinalIgnoreCase))
{
foreach (XmlNode codenode in node.ChildNodes)
{
string id = codenode.Name;
LanguagesItem lan = ls.FirstOrDefault(m => m.ID == id);
if (lan == null)
continue;
foreach (XmlNode node1 in codenode.ChildNodes)
{
string lgid = node1.Name;
string lgvalue = node1.InnerText;
if (clgid == "all")
{
string text = LanguagesText(lgid, lan);
if (!string.IsNullOrEmpty(text))
node1.InnerText = text;
}
else
{
if (clgid == lgid)
{
string text = LanguagesText(clgid, lan);
if (!string.IsNullOrEmpty(text))
node1.InnerText = text;
}
}
}
}
}
}
doc.Save(txt_src.Text);
}
private void ImportExcelMobile(List<LanguagesItem> ls)
{
if (ls == null || ls.Count == 0)
return;
string clgid = cbx_languages.SelectedValue.ToString();
XmlDocument doc = new XmlDocument();
doc.Load(txt_src.Text);
foreach (XmlNode node in doc.DocumentElement.ChildNodes)
{
string id = node.Name;
LanguagesItem lan = ls.FirstOrDefault(m => m.ID == id);
if (lan == null)
continue;
foreach (XmlNode node1 in node.ChildNodes)
{
string lgid = node1.Name;
string lgvalue = node1.InnerText;
if (clgid == "all")
{
string text = LanguagesText(lgid, lan);
if (!string.IsNullOrEmpty(text))
node1.InnerText = text;
}
else
{
if (clgid == lgid)
{
string text = LanguagesText(clgid, lan);
if (!string.IsNullOrEmpty(text))
node1.InnerText = text;
}
}
}
}
doc.Save(txt_src.Text);
}
private string LanguagesText(string lgid, LanguagesItem lan)
{
string text = string.Empty;
if (lgid == "en-us" && !string.IsNullOrEmpty(lan.EnglishUS))
text = lan.EnglishUS;
else if (lgid == "en-ca" && !string.IsNullOrEmpty(lan.EnglishCA))
text = lan.EnglishCA;
else if (lgid == "en-au" && !string.IsNullOrEmpty(lan.EnglishAU))
text = lan.EnglishAU;
else if (lgid == "fr-fr" && !string.IsNullOrEmpty(lan.France))
text = lan.France;
else if (lgid == "fr-ca" && !string.IsNullOrEmpty(lan.FranceCA))
text = lan.FranceCA;
else if (lgid == "zh-cn" && !string.IsNullOrEmpty(lan.Chinese))
text = lan.Chinese;
else if (lgid == "es-es" && !string.IsNullOrEmpty(lan.Spain))
text = lan.Spain;
return text;
}
}
class Languages
{
public string ID { get; set; }
public string Name { get; set; }
}
class LanguagesItem
{
public string ID { get; set; }
public string EnglishUS { get; set; }
public string EnglishCA { get; set; }
public string EnglishAU { get; set; }
public string France { get; set; }
public string FranceCA { get; set; }
public string Chinese { get; set; }
public string Spain { get; set; }
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ofd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>231, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BE465497-20E8-4C29-B98F-3AF19996F1CB}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>LanguageExtractTool</RootNamespace>
<AssemblyName>LanguageExtractTool</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="DocumentFormat.OpenXml">
<HintPath>..\Reflib\DocumentFormat.OpenXml.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Reflib\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FleetInspection.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FleetInspection.Designer.cs">
<DependentUpon>FleetInspection.cs</DependentUpon>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Form2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form2.Designer.cs">
<DependentUpon>Form2.cs</DependentUpon>
</Compile>
<Compile Include="LanguageMerge.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="LanguageMerge.Designer.cs">
<DependentUpon>LanguageMerge.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FleetInspection.resx">
<DependentUpon>FleetInspection.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form2.resx">
<DependentUpon>Form2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="LanguageMerge.resx">
<DependentUpon>LanguageMerge.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IronIntelContractorBusiness\IronIntelContractorBusiness.csproj">
<Project>{515fb61f-f032-4a48-8f32-93b59b9d37f8}</Project>
<Name>IronIntelContractorBusiness</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,116 @@

namespace LanguageExtractTool
{
partial class LanguageMerge
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.txt_src = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.button3 = new System.Windows.Forms.Button();
this.ofd = new System.Windows.Forms.OpenFileDialog();
this.button4 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(485, 45);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(116, 23);
this.button1.TabIndex = 43;
this.button1.Text = "选择源文件";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// txt_src
//
this.txt_src.Location = new System.Drawing.Point(104, 47);
this.txt_src.Name = "txt_src";
this.txt_src.Size = new System.Drawing.Size(362, 20);
this.txt_src.TabIndex = 42;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(53, 50);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(43, 13);
this.label1.TabIndex = 41;
this.label1.Text = "源文件";
//
// button3
//
this.button3.Location = new System.Drawing.Point(160, 107);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 44;
this.button3.Text = "开始合并";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// ofd
//
this.ofd.Filter = "xml files|*.xml|All files|*.*";
//
// button4
//
this.button4.Location = new System.Drawing.Point(356, 107);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(126, 23);
this.button4.TabIndex = 46;
this.button4.Text = "添加en-components";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// LanguageMerge
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(680, 163);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.button1);
this.Controls.Add(this.txt_src);
this.Controls.Add(this.label1);
this.Name = "LanguageMerge";
this.Text = "多语言合并";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox txt_src;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.OpenFileDialog ofd;
private System.Windows.Forms.Button button4;
}
}

View File

@ -0,0 +1,199 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml;
namespace LanguageExtractTool
{
public partial class LanguageMerge : Form
{
public LanguageMerge()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (ofd.ShowDialog() == DialogResult.OK)
{
txt_src.Text = ofd.FileName;
}
}
private void button3_Click(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(txt_src.Text))
{
MessageBox.Show("请选择源文件");
return;
}
XmlDocument doc = new XmlDocument();
doc.Load(txt_src.Text);
foreach (XmlNode node in doc.DocumentElement.ChildNodes)
{
if (string.Equals(node.Name, "Category", StringComparison.OrdinalIgnoreCase))
{
foreach (XmlNode pcode in node.ChildNodes)
{
MergeLanuageItem li = new MergeLanuageItem();
li.PageID = new NodeValueItem() { Name = pcode.Name, Text = pcode.InnerText };
foreach (XmlNode lancode in pcode.ChildNodes)
{
if (string.IsNullOrWhiteSpace(lancode.InnerText))
{
continue;
}
string lgid = lancode.Name;
string lgvalue = lancode.InnerText;
if (string.Compare(lgid, "en-us", true) == 0)
{
li.English = new NodeValueItem() { Name = "en", Text = lgvalue };
li.EnglishUS = new NodeValueItem() { Name = lgid, Text = lgvalue };
}
else if (string.Compare(lgid, "en-au", true) == 0)
li.EnglishAU = new NodeValueItem() { Name = lgid, Text = lgvalue };
else if (string.Compare(lgid, "en-ca", true) == 0)
li.EnglishCA = new NodeValueItem() { Name = lgid, Text = lgvalue };
else if (string.Compare(lgid, "fr-fr", true) == 0)
{
li.FranceNew = new NodeValueItem() { Name = "fr", Text = lgvalue };
li.France = new NodeValueItem() { Name = lgid, Text = lgvalue };
}
else if (string.Compare(lgid, "fr-ca", true) == 0)
li.FranceCA = new NodeValueItem() { Name = lgid, Text = lgvalue };
else if (string.Compare(lgid, "zh-cn", true) == 0)
{
li.Chinese = new NodeValueItem() { Name = lgid, Text = lgvalue };
}
}
XmlNode pagenode = doc.GetElementsByTagName(li.PageID.Name)[0];
XmlElement frel = doc.CreateElement("fr");
frel.InnerText = li.FranceNew.Text;
pagenode.PrependChild(frel);
XmlElement enel = doc.CreateElement("en");
enel.InnerText = li.English.Text;
pagenode.PrependChild(enel);
try
{
string rst = doc.InnerXml;
var url = "../" + li.PageID.Name + "/";
if (li.EnglishUS != null && string.Compare(li.English.Text, li.EnglishUS.Text, true) == 0)
{
var lnode = pagenode.SelectSingleNode(url + li.EnglishUS.Name);
pagenode.RemoveChild(lnode);
}
if (li.EnglishAU != null && string.Compare(li.English.Text, li.EnglishAU.Text, true) == 0)
{
var lnode = pagenode.SelectSingleNode(url + li.EnglishAU.Name);
pagenode.RemoveChild(lnode);
}
if (li.EnglishCA != null && string.Compare(li.English.Text, li.EnglishCA.Text, true) == 0)
{
var lnode = pagenode.SelectSingleNode(url + li.EnglishCA.Name);
pagenode.RemoveChild(lnode);
}
if (li.France != null)
{
var lnode = pagenode.SelectSingleNode(url + li.France.Name);
pagenode.RemoveChild(lnode);
}
if (li.FranceCA != null)
{
var lnode = pagenode.SelectSingleNode(url + li.FranceCA.Name);
pagenode.RemoveChild(lnode);
}
}
catch (Exception ex)
{
var name = li.PageID.Name;
}
}
}
}
doc.Save(txt_src.Text);
MessageBox.Show("合并完成。");
}
private void button4_Click(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(txt_src.Text))
{
MessageBox.Show("请选择源文件");
return;
}
XmlDocument doc = new XmlDocument();
doc.Load(txt_src.Text);
foreach (XmlNode node in doc.DocumentElement.ChildNodes)
{
if (string.Equals(node.Name, "Category", StringComparison.OrdinalIgnoreCase))
{
foreach (XmlNode pcode in node.ChildNodes)
{
MergeLanuageItem li = new MergeLanuageItem();
li.PageID = new NodeValueItem() { Name = pcode.Name, Text = pcode.InnerText };
foreach (XmlNode lancode in pcode.ChildNodes)
{
if (string.IsNullOrWhiteSpace(lancode.InnerText))
{
continue;
}
string lgid = lancode.Name;
string lgvalue = lancode.InnerText;
//if (string.Compare(lgid, "en", true) == 0)
//{
// li.English = new NodeValueItem() { Name = lgid, Text = lgvalue };
//}
if (string.Compare(lgid, "en-Components", true) == 0)
{
pcode.RemoveChild(lancode);
break;
}
}
//XmlNode pagenode = doc.GetElementsByTagName(li.PageID.Name)[0];
//XmlElement enel = doc.CreateElement("en-Components");
//enel.InnerText = li.English.Text;
//pagenode.AppendChild(enel);
}
}
}
doc.Save(txt_src.Text);
MessageBox.Show("添加完成。");
}
}
class MergeLanuageItem
{
public NodeValueItem PageID { get; set; }
public NodeValueItem English { get; set; }
public NodeValueItem EnglishUS { get; set; }
public NodeValueItem EnglishCA { get; set; }
public NodeValueItem EnglishAU { get; set; }
public NodeValueItem EnglishCOM { get; set; }
public NodeValueItem FranceNew { get; set; }
public NodeValueItem France { get; set; }
public NodeValueItem FranceCA { get; set; }
public NodeValueItem Chinese { get; set; }
}
class NodeValueItem
{
public string Name { get; set; }
public string Text { get; set; }
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ofd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LanguageExtractTool
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LanguageExtractTool")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LanguageExtractTool")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("be465497-20e8-4c29-b98f-3af19996f1cb")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace LanguageExtractTool.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LanguageExtractTool.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace LanguageExtractTool.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>