From 99e672a76dd3fe2d11740420ebad86f8a952781b Mon Sep 17 00:00:00 2001 From: RKrom Date: Wed, 19 Sep 2012 05:36:22 +0000 Subject: [PATCH] Initial changes for the translations of the external command plug-in. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2056 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- .../GreenshotExternalCommandPlugin.csproj | 13 +++- .../language_externalcommandplugin-en-US.xml | 20 +++++ .../SettingsForm.Designer.cs | 74 +++++++++---------- .../SettingsForm.cs | 9 +-- .../SettingsFormDetail.Designer.cs | 30 +++++--- 5 files changed, 92 insertions(+), 54 deletions(-) create mode 100644 GreenshotExternalCommandPlugin/Languages/language_externalcommandplugin-en-US.xml diff --git a/GreenshotExternalCommandPlugin/GreenshotExternalCommandPlugin.csproj b/GreenshotExternalCommandPlugin/GreenshotExternalCommandPlugin.csproj index 55c86ccde..a2aedaa44 100644 --- a/GreenshotExternalCommandPlugin/GreenshotExternalCommandPlugin.csproj +++ b/GreenshotExternalCommandPlugin/GreenshotExternalCommandPlugin.csproj @@ -93,12 +93,11 @@ SettingsFormDetail.cs + "$(SolutionDir)\tools\TortoiseSVN\SubWCRev.exe" "$(ProjectDir)\" "$(ProjectDir)\Properties\AssemblyInfo.cs.template" "$(ProjectDir)\Properties\AssemblyInfo.cs" - mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)" -copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp" @@ -128,4 +127,14 @@ copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$( true + + + + + mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)" +copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp" +copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)" +mkdir "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)" +copy "$(ProjectDir)Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\" + \ No newline at end of file diff --git a/GreenshotExternalCommandPlugin/Languages/language_externalcommandplugin-en-US.xml b/GreenshotExternalCommandPlugin/Languages/language_externalcommandplugin-en-US.xml new file mode 100644 index 000000000..63f30a950 --- /dev/null +++ b/GreenshotExternalCommandPlugin/Languages/language_externalcommandplugin-en-US.xml @@ -0,0 +1,20 @@ + + + + + External command settings + + + Configure command + + + New + + + Delete + + + Edit + + + \ No newline at end of file diff --git a/GreenshotExternalCommandPlugin/SettingsForm.Designer.cs b/GreenshotExternalCommandPlugin/SettingsForm.Designer.cs index a827d710d..c7b5da114 100644 --- a/GreenshotExternalCommandPlugin/SettingsForm.Designer.cs +++ b/GreenshotExternalCommandPlugin/SettingsForm.Designer.cs @@ -44,16 +44,15 @@ namespace ExternalCommand { /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// - private void InitializeComponent() - { + private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsForm)); this.buttonCancel = new GreenshotPlugin.Controls.GreenshotButton(); this.buttonOk = new GreenshotPlugin.Controls.GreenshotButton(); this.listView1 = new System.Windows.Forms.ListView(); this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); - this.button1 = new GreenshotPlugin.Controls.GreenshotButton(); - this.button2 = new GreenshotPlugin.Controls.GreenshotButton(); - this.button4 = new GreenshotPlugin.Controls.GreenshotButton(); + this.button_new = new GreenshotPlugin.Controls.GreenshotButton(); + this.button_delete = new GreenshotPlugin.Controls.GreenshotButton(); + this.button_edit = new GreenshotPlugin.Controls.GreenshotButton(); this.SuspendLayout(); // // buttonCancel @@ -63,7 +62,7 @@ namespace ExternalCommand { this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.TabIndex = 7; - this.buttonCancel.Text = "Cancel"; + this.buttonCancel.LanguageKey = "CANCEL"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick); // @@ -73,7 +72,7 @@ namespace ExternalCommand { this.buttonOk.Name = "buttonOk"; this.buttonOk.Size = new System.Drawing.Size(75, 23); this.buttonOk.TabIndex = 6; - this.buttonOk.Text = "OK"; + this.buttonOk.LanguageKey = "OK"; this.buttonOk.UseVisualStyleBackColor = true; this.buttonOk.Click += new System.EventHandler(this.ButtonOkClick); // @@ -98,36 +97,36 @@ namespace ExternalCommand { this.columnHeader1.Text = "Name"; this.columnHeader1.Width = 226; // - // button1 + // button_new // - this.button1.Location = new System.Drawing.Point(275, 13); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 4; - this.button1.Text = "New"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.ButtonAddClick); + this.button_new.Location = new System.Drawing.Point(275, 13); + this.button_new.Name = "button_new"; + this.button_new.Size = new System.Drawing.Size(75, 23); + this.button_new.TabIndex = 4; + this.button_new.LanguageKey = "externalcommand.settings_new"; + this.button_new.UseVisualStyleBackColor = true; + this.button_new.Click += new System.EventHandler(this.ButtonAddClick); // // button2 // - this.button2.Location = new System.Drawing.Point(274, 71); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(75, 23); - this.button2.TabIndex = 5; - this.button2.Text = "Delete"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.ButtonDeleteClick); + this.button_delete.Location = new System.Drawing.Point(274, 71); + this.button_delete.Name = "button_delete"; + this.button_delete.Size = new System.Drawing.Size(75, 23); + this.button_delete.TabIndex = 5; + this.button_delete.LanguageKey = "externalcommand.settings_delete"; + this.button_delete.UseVisualStyleBackColor = true; + this.button_delete.Click += new System.EventHandler(this.ButtonDeleteClick); // - // button4 + // button_edit // - this.button4.Enabled = false; - this.button4.Location = new System.Drawing.Point(275, 42); - this.button4.Name = "button4"; - this.button4.Size = new System.Drawing.Size(75, 23); - this.button4.TabIndex = 13; - this.button4.Text = "Edit"; - this.button4.UseVisualStyleBackColor = true; - this.button4.Click += new System.EventHandler(this.Button4Click); + this.button_edit.Enabled = false; + this.button_edit.Location = new System.Drawing.Point(275, 42); + this.button_edit.Name = "button_edit"; + this.button_edit.Size = new System.Drawing.Size(75, 23); + this.button_edit.TabIndex = 13; + this.button_edit.LanguageKey = "externalcommand.settings_edit"; + this.button_edit.UseVisualStyleBackColor = true; + this.button_edit.Click += new System.EventHandler(this.ButtonEditClick); // // SettingsForm // @@ -136,18 +135,19 @@ namespace ExternalCommand { this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; this.ClientSize = new System.Drawing.Size(365, 208); - this.Controls.Add(this.button4); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); + this.Controls.Add(this.button_edit); + this.Controls.Add(this.button_delete); + this.Controls.Add(this.button_new); this.Controls.Add(this.listView1); this.Controls.Add(this.buttonOk); this.Controls.Add(this.buttonCancel); + this.LanguageKey = "externalcommand.settings_title"; this.Name = "SettingsForm"; this.ResumeLayout(false); } - private GreenshotPlugin.Controls.GreenshotButton button4; - private GreenshotPlugin.Controls.GreenshotButton button2; - private GreenshotPlugin.Controls.GreenshotButton button1; + private GreenshotPlugin.Controls.GreenshotButton button_edit; + private GreenshotPlugin.Controls.GreenshotButton button_delete; + private GreenshotPlugin.Controls.GreenshotButton button_new; private System.Windows.Forms.ColumnHeader columnHeader1; private System.Windows.Forms.ListView listView1; private GreenshotPlugin.Controls.GreenshotButton buttonOk; diff --git a/GreenshotExternalCommandPlugin/SettingsForm.cs b/GreenshotExternalCommandPlugin/SettingsForm.cs index 9ddbd68f7..8b97a75b2 100644 --- a/GreenshotExternalCommandPlugin/SettingsForm.cs +++ b/GreenshotExternalCommandPlugin/SettingsForm.cs @@ -92,16 +92,14 @@ namespace ExternalCommand { } void ListView1ItemSelectionChanged(object sender, EventArgs e) { - button4.Enabled = listView1.SelectedItems.Count > 0; + button_edit.Enabled = listView1.SelectedItems.Count > 0; } - void Button4Click(object sender, EventArgs e) - { + void ButtonEditClick(object sender, EventArgs e) { ListView1DoubleClick(sender, e); } - void ListView1DoubleClick(object sender, EventArgs e) - { + void ListView1DoubleClick(object sender, EventArgs e) { string commando = listView1.SelectedItems[0].Tag as string; SettingsFormDetail form = new SettingsFormDetail(commando); @@ -110,6 +108,7 @@ namespace ExternalCommand { UpdateView(); } } + public class ListviewComparer : System.Collections.IComparer { public int Compare(object x, object y) { if (!(x is ListViewItem)) { diff --git a/GreenshotExternalCommandPlugin/SettingsFormDetail.Designer.cs b/GreenshotExternalCommandPlugin/SettingsFormDetail.Designer.cs index cf62386da..f3799c573 100644 --- a/GreenshotExternalCommandPlugin/SettingsFormDetail.Designer.cs +++ b/GreenshotExternalCommandPlugin/SettingsFormDetail.Designer.cs @@ -1,15 +1,25 @@ /* - * Created by SharpDevelop. - * User: 05018038 - * Date: 04.04.2012 - * Time: 10:50 + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom * - * To change this template use Tools | Options | Coding | Edit Standard Headers. + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -namespace ExternalCommand -{ - partial class SettingsFormDetail - { +namespace ExternalCommand { + partial class SettingsFormDetail { /// /// Designer variable used to keep track of non-visual components. /// @@ -167,7 +177,7 @@ namespace ExternalCommand this.Controls.Add(this.buttonCancel); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Name = "SettingsFormDetail"; - this.Text = "Configure"; + this.LanguageKey = "externalcommand.settings_detail_title"; this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.ResumeLayout(false);