Commit 7c25a345 LN

增加日文。

1 个父辈 ee922d2c
......@@ -123,6 +123,9 @@
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resource.ge-DE.resx" />
<EmbeddedResource Include="Properties\Resource.ja-JP.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resource.zh-CN.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
......
......@@ -92,6 +92,7 @@
// btnMiddleMove
//
this.btnMiddleMove.BackColor = System.Drawing.SystemColors.Control;
this.btnMiddleMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMiddleMove.Location = new System.Drawing.Point(263, 64);
this.btnMiddleMove.Name = "btnMiddleMove";
this.btnMiddleMove.Size = new System.Drawing.Size(144, 52);
......@@ -125,6 +126,7 @@
// btnUpDownMove
//
this.btnUpDownMove.BackColor = System.Drawing.SystemColors.Control;
this.btnUpDownMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpDownMove.Location = new System.Drawing.Point(263, 118);
this.btnUpDownMove.Name = "btnUpDownMove";
this.btnUpDownMove.Size = new System.Drawing.Size(144, 52);
......@@ -137,6 +139,7 @@
// btnInOutMove
//
this.btnInOutMove.BackColor = System.Drawing.SystemColors.Control;
this.btnInOutMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnInOutMove.Location = new System.Drawing.Point(263, 171);
this.btnInOutMove.Name = "btnInOutMove";
this.btnInOutMove.Size = new System.Drawing.Size(144, 52);
......@@ -149,6 +152,7 @@
// btnInOutMovej
//
this.btnInOutMovej.BackColor = System.Drawing.SystemColors.Control;
this.btnInOutMovej.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnInOutMovej.Location = new System.Drawing.Point(410, 171);
this.btnInOutMovej.Name = "btnInOutMovej";
this.btnInOutMovej.Size = new System.Drawing.Size(144, 52);
......@@ -161,6 +165,7 @@
// btnUpDownMovej
//
this.btnUpDownMovej.BackColor = System.Drawing.SystemColors.Control;
this.btnUpDownMovej.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpDownMovej.Location = new System.Drawing.Point(410, 118);
this.btnUpDownMovej.Name = "btnUpDownMovej";
this.btnUpDownMovej.Size = new System.Drawing.Size(144, 52);
......@@ -173,6 +178,7 @@
// btnMiddleMovej
//
this.btnMiddleMovej.BackColor = System.Drawing.SystemColors.Control;
this.btnMiddleMovej.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMiddleMovej.Location = new System.Drawing.Point(410, 64);
this.btnMiddleMovej.Name = "btnMiddleMovej";
this.btnMiddleMovej.Size = new System.Drawing.Size(144, 52);
......@@ -184,12 +190,14 @@
//
// button1
//
this.button1.Location = new System.Drawing.Point(428, 374);
this.button1.BackColor = System.Drawing.SystemColors.Control;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Location = new System.Drawing.Point(410, 373);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(126, 37);
this.button1.TabIndex = 16;
this.button1.Text = "关闭";
this.button1.UseVisualStyleBackColor = true;
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// txtInOutPosition
......@@ -246,6 +254,7 @@
// btnComMovej
//
this.btnComMovej.BackColor = System.Drawing.SystemColors.Control;
this.btnComMovej.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnComMovej.Location = new System.Drawing.Point(410, 227);
this.btnComMovej.Name = "btnComMovej";
this.btnComMovej.Size = new System.Drawing.Size(144, 52);
......@@ -258,6 +267,7 @@
// btnComMove
//
this.btnComMove.BackColor = System.Drawing.SystemColors.Control;
this.btnComMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnComMove.Location = new System.Drawing.Point(263, 227);
this.btnComMove.Name = "btnComMove";
this.btnComMove.Size = new System.Drawing.Size(144, 52);
......@@ -293,6 +303,7 @@
// btnAutoMovej
//
this.btnAutoMovej.BackColor = System.Drawing.SystemColors.Control;
this.btnAutoMovej.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAutoMovej.Location = new System.Drawing.Point(410, 285);
this.btnAutoMovej.Name = "btnAutoMovej";
this.btnAutoMovej.Size = new System.Drawing.Size(144, 52);
......@@ -305,6 +316,7 @@
// btnAutoMove
//
this.btnAutoMove.BackColor = System.Drawing.SystemColors.Control;
this.btnAutoMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAutoMove.Location = new System.Drawing.Point(263, 285);
this.btnAutoMove.Name = "btnAutoMove";
this.btnAutoMove.Size = new System.Drawing.Size(144, 52);
......@@ -332,12 +344,14 @@
//
// btnUpdate
//
this.btnUpdate.Location = new System.Drawing.Point(281, 374);
this.btnUpdate.BackColor = System.Drawing.SystemColors.Control;
this.btnUpdate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdate.Location = new System.Drawing.Point(281, 373);
this.btnUpdate.Name = "btnUpdate";
this.btnUpdate.Size = new System.Drawing.Size(126, 37);
this.btnUpdate.TabIndex = 32;
this.btnUpdate.Text = "更新坐标";
this.btnUpdate.UseVisualStyleBackColor = true;
this.btnUpdate.UseVisualStyleBackColor = false;
this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
//
// FrmAxisDebug
......
......@@ -114,7 +114,7 @@
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(542, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(418, 715);
this.groupBox1.Size = new System.Drawing.Size(418, 649);
this.groupBox1.TabIndex = 105;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "DO写入";
......@@ -519,7 +519,7 @@
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(761, 738);
this.button1.Location = new System.Drawing.Point(761, 672);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(115, 34);
this.button1.TabIndex = 254;
......@@ -534,7 +534,7 @@
this.chbAutoRead.Checked = true;
this.chbAutoRead.CheckState = System.Windows.Forms.CheckState.Checked;
this.chbAutoRead.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAutoRead.Location = new System.Drawing.Point(637, 743);
this.chbAutoRead.Location = new System.Drawing.Point(637, 677);
this.chbAutoRead.Name = "chbAutoRead";
this.chbAutoRead.Size = new System.Drawing.Size(75, 21);
this.chbAutoRead.TabIndex = 244;
......@@ -548,7 +548,7 @@
this.groupBox4.Controls.Add(this.tableLayoutPanel2);
this.groupBox4.Location = new System.Drawing.Point(274, 3);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(263, 778);
this.groupBox4.Size = new System.Drawing.Size(263, 712);
this.groupBox4.TabIndex = 104;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "DO列表";
......@@ -558,6 +558,7 @@
this.tableLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel2.AutoScroll = true;
this.tableLayoutPanel2.ColumnCount = 1;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Location = new System.Drawing.Point(5, 14);
......@@ -565,7 +566,7 @@
this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(252, 758);
this.tableLayoutPanel2.Size = new System.Drawing.Size(252, 692);
this.tableLayoutPanel2.TabIndex = 103;
//
// groupBox3
......@@ -575,7 +576,7 @@
this.groupBox3.Controls.Add(this.tableLayoutPanel1);
this.groupBox3.Location = new System.Drawing.Point(12, 3);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(263, 778);
this.groupBox3.Size = new System.Drawing.Size(263, 712);
this.groupBox3.TabIndex = 103;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "DI列表";
......@@ -585,6 +586,7 @@
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.AutoScroll = true;
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Location = new System.Drawing.Point(6, 14);
......@@ -592,14 +594,14 @@
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(252, 758);
this.tableLayoutPanel1.Size = new System.Drawing.Size(252, 692);
this.tableLayoutPanel1.TabIndex = 102;
//
// FrmIOStatus
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(967, 787);
this.ClientSize = new System.Drawing.Size(967, 721);
this.Controls.Add(this.button1);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.groupBox4);
......
......@@ -27,6 +27,7 @@
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.显示ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator21 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.groupAuto = new System.Windows.Forms.GroupBox();
......@@ -238,7 +239,8 @@
this.清理日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
this.英文ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator21 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator22 = new System.Windows.Forms.ToolStripSeparator();
this.contextMenuStrip1.SuspendLayout();
this.groupAuto.SuspendLayout();
this.groupBox6.SuspendLayout();
......@@ -268,19 +270,24 @@
this.toolStripSeparator21,
this.toolStripMenuItem1});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(181, 80);
this.contextMenuStrip1.Size = new System.Drawing.Size(107, 58);
//
// 显示ToolStripMenuItem
//
this.显示ToolStripMenuItem.Name = "显示ToolStripMenuItem";
this.显示ToolStripMenuItem.Size = new System.Drawing.Size(180, 24);
this.显示ToolStripMenuItem.Size = new System.Drawing.Size(106, 24);
this.显示ToolStripMenuItem.Text = "显示";
this.显示ToolStripMenuItem.Click += new System.EventHandler(this.显示ToolStripMenuItem_Click);
//
// toolStripSeparator21
//
this.toolStripSeparator21.Name = "toolStripSeparator21";
this.toolStripSeparator21.Size = new System.Drawing.Size(103, 6);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(180, 24);
this.toolStripMenuItem1.Size = new System.Drawing.Size(106, 24);
this.toolStripMenuItem1.Text = "退出";
this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
//
......@@ -2663,7 +2670,9 @@
this.语言.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.清理日志ToolStripMenuItem,
this.toolStripSeparator12,
this.英文ToolStripMenuItem});
this.英文ToolStripMenuItem,
this.toolStripSeparator22,
this.toolStripMenuItem6});
this.语言.Name = "语言";
this.语言.Size = new System.Drawing.Size(54, 25);
this.语言.Text = "语言";
......@@ -2671,26 +2680,33 @@
// 清理日志ToolStripMenuItem
//
this.清理日志ToolStripMenuItem.Name = "清理日志ToolStripMenuItem";
this.清理日志ToolStripMenuItem.Size = new System.Drawing.Size(112, 26);
this.清理日志ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.清理日志ToolStripMenuItem.Text = "中文";
this.清理日志ToolStripMenuItem.Click += new System.EventHandler(this.清理日志ToolStripMenuItem_Click);
//
// toolStripSeparator12
//
this.toolStripSeparator12.Name = "toolStripSeparator12";
this.toolStripSeparator12.Size = new System.Drawing.Size(109, 6);
this.toolStripSeparator12.Size = new System.Drawing.Size(177, 6);
//
// 英文ToolStripMenuItem
//
this.英文ToolStripMenuItem.Name = "英文ToolStripMenuItem";
this.英文ToolStripMenuItem.Size = new System.Drawing.Size(112, 26);
this.英文ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.英文ToolStripMenuItem.Text = "英文";
this.英文ToolStripMenuItem.Click += new System.EventHandler(this.开启DEBUGToolStripMenuItem_Click);
//
// toolStripSeparator21
// toolStripMenuItem6
//
this.toolStripSeparator21.Name = "toolStripSeparator21";
this.toolStripSeparator21.Size = new System.Drawing.Size(177, 6);
this.toolStripMenuItem6.Name = "toolStripMenuItem6";
this.toolStripMenuItem6.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem6.Text = "日语";
this.toolStripMenuItem6.Click += new System.EventHandler(this.toolStripMenuItem6_Click);
//
// toolStripSeparator22
//
this.toolStripSeparator22.Name = "toolStripSeparator22";
this.toolStripSeparator22.Size = new System.Drawing.Size(177, 6);
//
// FrmStoreBox
//
......@@ -2964,6 +2980,8 @@
private System.Windows.Forms.Button btnCycleOut;
private System.Windows.Forms.Label lblBatchMsg;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator21;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem6;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator22;
}
}
......@@ -1890,5 +1890,13 @@ namespace OnlineStore.AutoInOutStore
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.PleaseStartStore, "请先启动料仓!"));
}
}
private void toolStripMenuItem6_Click(object sender, EventArgs e)
{
string str = ResourceCulture.Japanese;
ResourceCulture.SetCurrentCulture(str);
ConfigAppSettings.SaveValue(Setting_Init.Default_Language, str);
this.LanguageProcess();
}
}
}
......@@ -1423,4 +1423,7 @@
<data name="X31" xml:space="preserve">
<value>Clamping jaw cylinder material plate inspection</value>
</data>
<data name="FrmStoreBox_toolStripMenuItem6_Text" xml:space="preserve">
<value>Japanese</value>
</data>
</root>
\ No newline at end of file
......@@ -1422,4 +1422,7 @@
<data name="X31" xml:space="preserve">
<value>夹爪气缸料盘检测</value>
</data>
<data name="FrmStoreBox_toolStripMenuItem6_Text" xml:space="preserve">
<value>日语</value>
</data>
</root>
\ No newline at end of file
......@@ -20,6 +20,7 @@ namespace OnlineStore.AutoInOutStore
public static string China = "zh-CN";
public static string English = "en-US";
public static string German = "ge-DE";
public static string Japanese = "ja-JP";
private static ResourceManager rm = null;
public static string CurrLanguage = "zh-CN";
......@@ -34,11 +35,10 @@ namespace OnlineStore.AutoInOutStore
CodeLibrary.CodeResourceControl.OpenResourceLog = ShowLog;
ResourceControl.GetStrEvent += GetString;
ResourceControl.GetStringEvent += GetString;
ResourceControl.GetStringByLanEvent += GetStringByLan;
CodeLibrary.CodeResourceControl.GetLanguageEvent += CodeResourceControl_GetLanguageEvent;
CSVResourceControl.GetStrEvent += GetString;
CSVResourceControl.GetStringEvent += GetString;
//UserFromControl.UserControlResource.GetStrEvent += GetString;
//UserFromControl.UserControlResource.GetStringEvent += GetString;
if (string.IsNullOrEmpty(name))
{
name = "en-US";
......@@ -137,7 +137,7 @@ namespace OnlineStore.AutoInOutStore
}
return strCurLanguage;
}
public static string GetString(string id, string defaultStr, params object[] param)
private static string GetStringByLan(string language, string id, string defaultStr, params object[] param)
{
string strCurLanguage = "";
......@@ -148,7 +148,7 @@ namespace OnlineStore.AutoInOutStore
rm = new ResourceManager("OnlineStore.AutoInOutStore.Properties.Resource", assembly);
}
//CultureInfo ci = Thread.CurrentThread.CurrentCulture;
CultureInfo ci = new CultureInfo(CurrLanguage);
CultureInfo ci = new CultureInfo(language);
strCurLanguage = rm.GetString(id, ci).Trim();
if (strCurLanguage.Equals("") && (!defaultStr.Equals("")))
{
......@@ -171,6 +171,12 @@ namespace OnlineStore.AutoInOutStore
return String.Format(strCurLanguage, param);
}
public static string GetString(string id, string defaultStr, params object[] param)
{
return GetStringByLan(CurrLanguage, id, defaultStr, param);
}
private static void NoIdLog(string id, string defaultStr)
{
if (ShowLog)
......
......@@ -72,6 +72,11 @@ namespace OnlineStore.Common
/// </summary>
public string[] msgParam { get; set; }
/// <summary>
/// 中文: zh 英文: en 日语: jp
/// msgData中key为zh, value为对应语言的消息内容
/// </summary>
public Dictionary<string,string> msgData { get; set; }
/// <summary>
/// 包含的多个 BOX 的状态信息
/// </summary>
public Dictionary<int, BoxStatus> boxStatus = new Dictionary<int, BoxStatus>();
......@@ -79,12 +84,7 @@ namespace OnlineStore.Common
/// 报警集合
/// </summary>
public List<AlarmInfo> alarmList = new List<AlarmInfo>();
public void SetMsg(string msg, string type, params string[] param)
{
this.msg = msg;
this.msgCode = type;
this.msgParam = param;
}
}
/// <summary>
......
......@@ -7,11 +7,18 @@ namespace OnlineStore.DeviceLibrary
{
public class ResourceControl
{
public static string China = "zh-CN";
public static string English = "en-US";
// public static string German = "ge-DE";
public static string Japanese = "ja-JP";
public delegate string GetStrDelegate(string id, string defaultStr);
public static event GetStrDelegate GetStrEvent;
public delegate string GetStringDelegate(string id, string defaultStr, params object[] param);
public static event GetStringDelegate GetStringEvent;
public delegate string GetStringByLanDelegate(string language, string id, string defaultStr, params object[] param);
public static event GetStringByLanDelegate GetStringByLanEvent;
public static string GetMsgStr(string value)
{
......@@ -33,7 +40,11 @@ namespace OnlineStore.DeviceLibrary
string result = GetStringEvent?.Invoke(id, defaultStr, param);
return result;
}
public static string GetStringByLan(string language, string id, string defaultStr, params object[] param)
{
string result = GetStringByLanEvent?.Invoke(language, id, defaultStr, param);
return result;
}
/// <summary>
/// AutoOut 自动出库:
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!