# HG changeset patch # User IBBoard # Date 1256155878 0 # Node ID c243b043aa624cbfd045678af54a0891339d1bcb # Parent e3488dd61a217bd9a80c835d4d63612816c5b6de Re #179: Make sure that translations are used throughout UI * Put names back on menu items * Add some more translation calls * Make some extra items translatable * Update English translation file diff -r e3488dd61a21 -r c243b043aa62 FrmEditUnitEquipment.cs --- a/FrmEditUnitEquipment.cs Sun Oct 11 19:57:13 2009 +0000 +++ b/FrmEditUnitEquipment.cs Wed Oct 21 20:11:18 2009 +0000 @@ -7,6 +7,8 @@ using System.ComponentModel; using System.Windows.Forms; using IBBoard.Commands; +using IBBoard.Windows.Forms; +using IBBoard.Windows.Forms.I18N; using IBBoard.WarFoundry.API; using IBBoard.WarFoundry.API.Commands; using IBBoard.WarFoundry.API.Objects; @@ -21,9 +23,9 @@ private Unit unit; private UnitEquipmentItem equipItem; private CommandStack commandStack; - private System.Windows.Forms.Label lblAmount; - private System.Windows.Forms.Button bttnCancel; - private System.Windows.Forms.Button bttnOkay; + private IBBLabel lblAmount; + private IBBButton bttnCancel; + private IBBButton bttnOkay; private IBBoard.WarFoundry.GUI.WinForms.UI.EquipmentAmountControl equipmentAmount; /// /// Required designer variable. @@ -36,6 +38,7 @@ this.unit = unit; this.equipItem = equipItem; InitializeComponent(); + ControlTranslator.TranslateControls(Controls); this.Text = equipItem.Name + " for " + unit.Name; equipmentAmount.SetUnit(unit); equipmentAmount.SetUnitEquipmentItem(equipItem); @@ -64,9 +67,9 @@ /// private void InitializeComponent() { - this.lblAmount = new System.Windows.Forms.Label(); - this.bttnCancel = new System.Windows.Forms.Button(); - this.bttnOkay = new System.Windows.Forms.Button(); + this.lblAmount = new IBBLabel(); + this.bttnCancel = new IBBButton(); + this.bttnOkay = new IBBButton(); this.equipmentAmount = new IBBoard.WarFoundry.GUI.WinForms.UI.EquipmentAmountControl(); this.SuspendLayout(); // diff -r e3488dd61a21 -r c243b043aa62 FrmMain.cs --- a/FrmMain.cs Sun Oct 11 19:57:13 2009 +0000 +++ b/FrmMain.cs Wed Oct 21 20:11:18 2009 +0000 @@ -87,8 +87,8 @@ private System.Windows.Forms.ContextMenu redoMenu; private IBBoard.Windows.Forms.ColorableStatusBar statusBar; private System.Windows.Forms.Timer statusBarTimer; - private MenuItem miExportArmyAs; - private MenuItem miExportArmyAsBasicHTML; + private IBBoard.Windows.Forms.IBBMenuItem miExportArmyAs; + private IBBoard.Windows.Forms.IBBMenuItem miExportArmyAsBasicHTML; private System.Windows.Forms.Panel pnlRight; /// @@ -133,21 +133,8 @@ //pnlRight.Top = toolBar.Height + 5; //pnlRight.Height = ClientRectangle.Bottom - statusBar.Height - pnlRight.Top - 3; - foreach (Control ctrl in Controls) - { - ControlTranslator.TranslateControl(ctrl); - } - - foreach(Component comp in components.Components) - { - ControlTranslator.TranslateComponent(comp); - } - - foreach (IBBMenuItem mi in Menu.MenuItems) - { - ControlTranslator.TranslateComponent(mi); - } - + ControlTranslator.TranslateControls(Controls); + ControlTranslator.TranslateComponents(components.Components); ControlTranslator.TranslateComponent(openArmyDialog); ControlTranslator.TranslateComponent(saveArmyDialog); unitWindows = new Dictionary(); @@ -247,8 +234,8 @@ this.miOpenArmy = new IBBoard.Windows.Forms.IBBMenuItem(); this.miSaveArmy = new IBBoard.Windows.Forms.IBBMenuItem(); this.miSaveArmyAs = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miExportArmyAs = new System.Windows.Forms.MenuItem(); - this.miExportArmyAsBasicHTML = new System.Windows.Forms.MenuItem(); + this.miExportArmyAs = new IBBoard.Windows.Forms.IBBMenuItem(); + this.miExportArmyAsBasicHTML = new IBBoard.Windows.Forms.IBBMenuItem(); this.miCloseArmy = new IBBoard.Windows.Forms.IBBMenuItem(); this.miSep2 = new System.Windows.Forms.MenuItem(); this.miReloadFiles = new IBBoard.Windows.Forms.IBBMenuItem(); @@ -396,18 +383,21 @@ this.miSep3, this.miExit}); this.menuFile.Text = "&file"; + this.menuFile.Name = "menuFile"; // // miNewArmy // this.miNewArmy.Index = 0; this.miNewArmy.Text = "&new army"; this.miNewArmy.Click += new System.EventHandler(this.miNewArmy_Click); + this.miNewArmy.Name = "miNewArmy"; // // miOpenArmy // this.miOpenArmy.Index = 1; this.miOpenArmy.Text = "&open army"; this.miOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click); + this.miOpenArmy.Name = "miOpenArmy"; // // miSaveArmy // @@ -415,6 +405,7 @@ this.miSaveArmy.Index = 2; this.miSaveArmy.Text = "&save army"; this.miSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click); + this.miSaveArmy.Name = "miSaveArmy"; // // miSaveArmyAs // @@ -422,6 +413,7 @@ this.miSaveArmyAs.Index = 3; this.miSaveArmyAs.Text = "save army &as..."; this.miSaveArmyAs.Click += new System.EventHandler(this.miSaveArmyAs_Click); + this.miSaveArmyAs.Name = "miSaveArmyAs"; // // miExportArmyAs // @@ -430,12 +422,14 @@ this.miExportArmyAs.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.miExportArmyAsBasicHTML}); this.miExportArmyAs.Text = "export army as..."; + this.miExportArmyAs.Name = "miExportArmyAs"; // // miExportArmyAsBasicHTML // this.miExportArmyAsBasicHTML.Index = 0; - this.miExportArmyAsBasicHTML.Text = "Basic HTML"; + this.miExportArmyAsBasicHTML.Text = "basic html"; this.miExportArmyAsBasicHTML.Click += new System.EventHandler(this.miExportArmyAsBasicHTML_Click); + this.miExportArmyAsBasicHTML.Name = "miExportArmyAsBasicHTML"; // // miCloseArmy // @@ -443,6 +437,7 @@ this.miCloseArmy.Index = 5; this.miCloseArmy.Text = "&close army"; this.miCloseArmy.Click += new System.EventHandler(this.miCloseArmy_Click); + this.miCloseArmy.Name = "miCloseArmy"; // // miSep2 // @@ -454,6 +449,7 @@ this.miReloadFiles.Index = 7; this.miReloadFiles.Text = "&reload files"; this.miReloadFiles.Click += new System.EventHandler(this.miReloadFiles_Click); + this.miReloadFiles.Name = "miReloadFiles"; // // miSep3 // @@ -465,6 +461,7 @@ this.miExit.Index = 9; this.miExit.Text = "e&xit"; this.miExit.Click += new System.EventHandler(this.miExit_Click); + this.miExit.Name = "miExit"; // // menuEdit // @@ -473,6 +470,7 @@ this.miUndo, this.miRedo}); this.menuEdit.Text = "&edit"; + this.menuEdit.Name = "menuEdit"; // // miUndo // @@ -480,6 +478,7 @@ this.miUndo.Index = 0; this.miUndo.Text = "&undo"; this.miUndo.Click += new System.EventHandler(this.miUndo_Click); + this.miUndo.Name = "miUndo"; // // miRedo // @@ -487,6 +486,7 @@ this.miRedo.Index = 1; this.miRedo.Text = "&redo"; this.miRedo.Click += new System.EventHandler(this.miRedo_Click); + this.miRedo.Name = "miRedo"; // // menuHelp // @@ -494,12 +494,14 @@ this.menuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.miAbout}); this.menuHelp.Text = "&help"; + this.menuHelp.Name = "menuHelp"; // // miAbout // this.miAbout.Enabled = false; this.miAbout.Index = 0; this.miAbout.Text = "&about"; + this.miAbout.Name = "miAbout"; // // saveArmyDialog // diff -r e3488dd61a21 -r c243b043aa62 FrmNewArmy.cs --- a/FrmNewArmy.cs Sun Oct 11 19:57:13 2009 +0000 +++ b/FrmNewArmy.cs Wed Oct 21 20:11:18 2009 +0000 @@ -1,49 +1,49 @@ -// This file (FrmNewArmy.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2007, 2008, 2009 IBBoard. -// -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. - -using System; -using System.Drawing; -using System.ComponentModel; -using System.Windows.Forms; -using IBBoard; -using IBBoard.Lang; -using IBBoard.Windows.Forms; -using IBBoard.WarFoundry.API; -using IBBoard.WarFoundry.API.Objects; +// This file (FrmNewArmy.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2007, 2008, 2009 IBBoard. +// +// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. + +using System; +using System.Drawing; +using System.ComponentModel; +using System.Windows.Forms; +using IBBoard; +using IBBoard.Lang; +using IBBoard.Windows.Forms; +using IBBoard.WarFoundry.API; +using IBBoard.WarFoundry.API.Objects; using IBBoard.Windows.Forms.I18N; -namespace IBBoard.WarFoundry.GUI.WinForms -{ - /// - /// Summary description for FrmNewArmy. - /// - public class FrmNewArmy : IBBForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private IBBoard.Windows.Forms.IBBButton bttnCancel; - private IBBoard.Windows.Forms.IBBLabel lblRaceList; - private IBBoard.Windows.Forms.IBBButton bttnSelectRace; - private System.Windows.Forms.ListBox lstRaces; - private IBBoard.Windows.Forms.IBBLabel lblArmyName; - private IBBoard.Windows.Forms.IBBLabel lblArmySize; +namespace IBBoard.WarFoundry.GUI.WinForms +{ + /// + /// Summary description for FrmNewArmy. + /// + public class FrmNewArmy : IBBForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; + private IBBoard.Windows.Forms.IBBButton bttnCancel; + private IBBoard.Windows.Forms.IBBLabel lblRaceList; + private IBBoard.Windows.Forms.IBBButton bttnSelectRace; + private System.Windows.Forms.ListBox lstRaces; + private IBBoard.Windows.Forms.IBBLabel lblArmyName; + private IBBoard.Windows.Forms.IBBLabel lblArmySize; private System.Windows.Forms.NumericUpDown armySize; - private Label lblGameSystem; - private ComboBox gameSystems; + private IBBLabel lblGameSystem; + private ComboBox gameSystems; private System.Windows.Forms.TextBox txtArmyName; private GameSystem system; private Race race; private string armyName; - private int maxPoints; - - public FrmNewArmy(GameSystem system) - { - InitializeComponent(); - + private int maxPoints; + + public FrmNewArmy(GameSystem system) + { + InitializeComponent(); + ControlTranslator.TranslateControl(this); foreach (GameSystem gameSystem in WarFoundryLoader.GetDefault().GetGameSystems()) @@ -54,7 +54,7 @@ if (WarFoundryCore.CurrentGameSystem != null) { gameSystems.SelectedItem = FrmMain.CurrentGameSystem; - } + } } private void SetRaces(GameSystem system) @@ -63,29 +63,29 @@ { lstRaces.Items.Add(race); } - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() + } + + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmNewArmy)); this.lstRaces = new System.Windows.Forms.ListBox(); @@ -96,7 +96,7 @@ this.txtArmyName = new System.Windows.Forms.TextBox(); this.lblArmySize = new IBBoard.Windows.Forms.IBBLabel(); this.armySize = new System.Windows.Forms.NumericUpDown(); - this.lblGameSystem = new System.Windows.Forms.Label(); + this.lblGameSystem = new IBBoard.Windows.Forms.IBBLabel(); this.gameSystems = new System.Windows.Forms.ComboBox(); ((System.ComponentModel.ISupportInitialize) (this.armySize)).BeginInit(); this.SuspendLayout(); @@ -237,40 +237,40 @@ this.ResumeLayout(false); this.PerformLayout(); - } + } #endregion public GameSystem SelectedSystem { get { return system; } - } - - public Race SelectedRace - { - get { return race; } - } - - public string ArmyName - { - get { return armyName; } - } - - public int ArmySize - { - get { return maxPoints; } - } - - private void bttnCancel_Click(object sender, System.EventArgs e) - { - DialogResult = DialogResult.Cancel; - this.Close(); - } - - private void bttnSelectRace_Click(object sender, System.EventArgs e) - { + } + + public Race SelectedRace + { + get { return race; } + } + + public string ArmyName + { + get { return armyName; } + } + + public int ArmySize + { + get { return maxPoints; } + } + + private void bttnCancel_Click(object sender, System.EventArgs e) + { + DialogResult = DialogResult.Cancel; + this.Close(); + } + + private void bttnSelectRace_Click(object sender, System.EventArgs e) + { DialogResult = DialogResult.OK; - SetValues(); - this.Close(); + SetValues(); + this.Close(); } private void SetValues() @@ -284,21 +284,21 @@ private GameSystem GetSelectedGameSystem() { return (GameSystem) gameSystems.SelectedItem; - } - - private void txtArmyName_TextChanged(object sender, System.EventArgs e) - { - setSelectRaceEnabledVal(); - } - - private void setSelectRaceEnabledVal() - { - bttnSelectRace.Enabled = (lstRaces.SelectedIndex>-1 && txtArmyName.Text.Trim()!="" && armySize.Value > 0); - } - - private void lstRaces_SelectedIndexChanged(object sender, System.EventArgs e) - { - setSelectRaceEnabledVal(); + } + + private void txtArmyName_TextChanged(object sender, System.EventArgs e) + { + setSelectRaceEnabledVal(); + } + + private void setSelectRaceEnabledVal() + { + bttnSelectRace.Enabled = (lstRaces.SelectedIndex>-1 && txtArmyName.Text.Trim()!="" && armySize.Value > 0); + } + + private void lstRaces_SelectedIndexChanged(object sender, System.EventArgs e) + { + setSelectRaceEnabledVal(); } private void gameSystems_SelectedValueChanged(object sender, EventArgs e) @@ -310,6 +310,6 @@ { SetRaces(selected); } - } - } -} + } + } +} diff -r e3488dd61a21 -r c243b043aa62 UI/EquipmentAmountControl.cs --- a/UI/EquipmentAmountControl.cs Sun Oct 11 19:57:13 2009 +0000 +++ b/UI/EquipmentAmountControl.cs Wed Oct 21 20:11:18 2009 +0000 @@ -5,7 +5,7 @@ using System.Data; using System.Text; using System.Windows.Forms; -using IBBoard.Lang; +using IBBoard.CustomMath; using IBBoard.WarFoundry.API; using IBBoard.WarFoundry.API.Objects; diff -r e3488dd61a21 -r c243b043aa62 translations/en.translation --- a/translations/en.translation Sun Oct 11 19:57:13 2009 +0000 +++ b/translations/en.translation Wed Oct 21 20:11:18 2009 +0000 @@ -1,38 +1,39 @@ -&File -&Edit -&Help -&Create army -&Open army -E&xit -&About -&Save army -Save army &as... -&Close army -Change &game system -&Undo -&Redo -WarFoundry Army Files (*.army) -Create army -Cancel -Create unit -Unit types: -Races: -Army name: -Select system -Game systems: -Game system selection -Army tree -Create new army -Save army -Army size: -Unit of {0} {1} -Create army -Open army -Save army -{0} pts / {1} pts -&Reload files -&Debug information -Add New {0} Choice + &File + &Edit + &Help + &Create army + &Open army + E&xit + &About + &Save army + Save army &as... + &Export army + Basic HTML + &Close army + &Undo + &Redo + WarFoundry Army Files (*.army) + Create army + OK + Cancel + Create unit + Unit types: + Races: + Army name: + Game systems: + Army Tree + Create new army + Open Army + Save army + Army size: + Unit of {0} {1} + Create army + Open army + Save army + {0} pts / {1} pts + &Reload files + Add New {0} Choice + Amount: \ No newline at end of file