changeset 101:3e78af88ceb3

Re #179: Make sure that translations are used throughout UI * Intermediary fix for locations in the UI for amount translations
author IBBoard <dev@ibboard.co.uk>
date Sat, 21 Nov 2009 21:27:39 +0000
parents 88b5a0da73f2
children 496e4fd66028
files FrmEditUnitEquipment.cs FrmReplaceUnitEquipment.cs UI/EquipmentAmountControl.cs Util/UnitEquipmentChoice.cs translations/en.translation
diffstat 5 files changed, 21 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/FrmEditUnitEquipment.cs	Sat Nov 21 20:17:10 2009 +0000
+++ b/FrmEditUnitEquipment.cs	Sat Nov 21 21:27:39 2009 +0000
@@ -13,6 +13,7 @@
 using IBBoard.WarFoundry.API;
 using IBBoard.WarFoundry.API.Commands;
 using IBBoard.WarFoundry.API.Objects;
+using IBBoard.WarFoundry.API.Util;
 
 namespace IBBoard.WarFoundry.GUI.WinForms
 {
@@ -164,7 +165,7 @@
 				}
 			}
 
-			double oldAmount = unit.GetEquipmentAmount(equipItem);
+			double oldAmount = UnitEquipmentUtil.GetEquipmentAmount(unit, equipItem);
 
 			if (setValue && oldAmount != amount)
 			{
--- a/FrmReplaceUnitEquipment.cs	Sat Nov 21 20:17:10 2009 +0000
+++ b/FrmReplaceUnitEquipment.cs	Sat Nov 21 21:27:39 2009 +0000
@@ -11,6 +11,7 @@
 using IBBoard.WarFoundry.API;
 using IBBoard.WarFoundry.API.Commands;
 using IBBoard.WarFoundry.API.Objects;
+using IBBoard.WarFoundry.API.Util;
 
 namespace IBBoard.WarFoundry
 {
@@ -181,7 +182,7 @@
 				}
 			}
 
-			double oldAmount = unit.GetEquipmentAmount(equipItem);
+			double oldAmount = UnitEquipmentUtil.GetEquipmentAmount(unit, equipItem);
 
 			if (setValue && oldAmount != amount)
 			{
--- a/UI/EquipmentAmountControl.cs	Sat Nov 21 20:17:10 2009 +0000
+++ b/UI/EquipmentAmountControl.cs	Sat Nov 21 21:27:39 2009 +0000
@@ -241,11 +241,11 @@
 
 		private void SetUnitEquipmentItemAmount()
 		{
-			double equipAmountNum = unit.GetEquipmentAmount(equip);
+			double equipAmountNum = UnitEquipmentUtil.GetEquipmentAmount(unit, equip);
 
 			if (equipAmountNum > 0)
 			{
-				bool isRatio = unit.GetEquipmentAmountIsRatio(equip);
+				bool isRatio = UnitEquipmentUtil.GetEquipmentAmountIsRatio(unit, equip);
 
 				if (isRatio)
 				{
--- a/Util/UnitEquipmentChoice.cs	Sat Nov 21 20:17:10 2009 +0000
+++ b/Util/UnitEquipmentChoice.cs	Sat Nov 21 21:27:39 2009 +0000
@@ -51,16 +51,16 @@
 
 				if (amount == 100)
 				{
-					amountString = Translation.GetTranslation("equipmentAmountAll", "all ({1})", amount, number);
+					amountString = Translation.GetTranslation("equipmentChoiceAmountAll", "all ({1})", amount, number);
 				}
 				else
 				{
-					amountString = Translation.GetTranslation("equipmentAmountPercentage", "{0}% ({1})", amount, number);
+					amountString = Translation.GetTranslation("equipmentChoiceAmountPercentage", "{0}% ({1})", amount, number);
 				}
 			}
 			else
 			{
-				amountString = amount.ToString();
+				amountString = Translation.GetTranslation("equipmentChoiceAmountNumber", "{0}", amount);
 			}
 
 			return amountString;
--- a/translations/en.translation	Sat Nov 21 20:17:10 2009 +0000
+++ b/translations/en.translation	Sat Nov 21 21:27:39 2009 +0000
@@ -65,8 +65,9 @@
 	<translation id="bttnEditWeapon">Edit</translation>
 	<translation id="equipmentAmountWithCost">{0} ({1} at {2}pts each)</translation>
 	<translation id="equipmentAmountWithZeroCost">{0} ({1} for free)</translation>
-	<translation id="equipmentAmountAll">For all ({1})</translation>
-	<translation id="equipmentAmountPercentage">For {0}% ({1})</translation>
+	<translation id="equipmentChoiceAmountAll">For all ({1})</translation>
+	<translation id="equipmentChoiceAmountPercentage">For {0}% ({1})</translation>
+	<translation id="equipmentChoiceAmountNumber">{0}</translation>
 	<translation id="InvalidRaceFileBoxTitle">Invalid race file</translation>
 	<translation id="InvalidArmyFileBoxTitle">Invalid army file</translation>
 	<translation id="SaveChangesQuestion">The army "{0}" has been modified.
@@ -74,4 +75,13 @@
 	<translation id="SaveChangesTitle">Unsaved changes</translation>
 	<translation id="SaveFailed">WarFoundry was unable to save the file. Please check the log for more details</translation>
 	<translation id="SaveFailedTitle">File save failed</translation>
+	<translation id="armyHtmlExportEquipAmountAll">all ({1})</translation>
+	<translation id="armyHtmlExportEquipAmountPercentage">{0}% ({1})</translation>
+	<translation id="armyHtmlExportEquipAmountRatio">{0} for {1}</translation>
+	<translation id="equipmentAmountAll">all ({1})</translation>
+	<translation id="equipmentAmountPercentage">{0}% ({1})</translation>
+	<translation id="equipmentAmountNumber">{0}</translation>
+	<translation id="setEquipmentAmountCommandDescription">Set {0} amount for {1} to {2}</translation>
+	<translation id="setEquipmentAmountCommandRemoveDescription">Remove {0} from {1}</translation>
+	<translation id="setEquipmentAmountCommandUndoDescription">Set {0} amount for {1} to {2}</translation>	
 </translations>
\ No newline at end of file