[chronojump] Fixed: 645811 - Plural forms



commit 6098a6a6f9cf0bafba6334c2675a03b4c8df0029
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Mar 28 16:19:40 2011 +0200

    Fixed: 645811 - Plural forms

 src/gui/chronojump.cs              |    7 ++++++-
 src/gui/jump.cs                    |   16 ++++++++++++++--
 src/gui/person.cs                  |    6 +++++-
 src/gui/pulse.cs                   |   11 -----------
 src/gui/run.cs                     |   16 ++++++++++++++--
 src/stats/djIndex.cs               |    6 ++++--
 src/stats/djQ.cs                   |    6 ++++--
 src/stats/fv.cs                    |    3 ++-
 src/stats/global.cs                |    3 ++-
 src/stats/ieIub.cs                 |    6 ++++--
 src/stats/jumpSimpleSubtraction.cs |    6 ++++--
 src/stats/main.cs                  |    2 +-
 src/stats/potency.cs               |    9 ---------
 src/stats/rjAVGSD.cs               |    6 ++++--
 src/stats/rjEvolution.cs           |   13 ++++++++++---
 src/stats/rjIndex.cs               |    6 ++++--
 src/stats/rjPotencyBosco.cs        |    6 ++++--
 src/stats/runIntervallic.cs        |   13 ++++++++++---
 src/stats/runSimple.cs             |    6 ++++--
 src/stats/sjCmjAbk.cs              |    6 ++++--
 src/stats/sjCmjAbkPlus.cs          |    6 ++++--
 21 files changed, 104 insertions(+), 55 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 11b4eff..d32e7b6 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2343,7 +2343,12 @@ public partial class ChronoJumpWindow
 						rowToSelect);
 				sensitiveGuiYesPerson();
 			
-				string myString = string.Format(Catalog.GetString("Successfully added {0} persons"), personAddMultipleWin.PersonsCreatedCount);
+				string myString = string.Format(
+						Catalog.GetPluralString(
+							"Successfully added one person.", 
+							"Successfully added {0} persons.", 
+							personAddMultipleWin.PersonsCreatedCount),
+						personAddMultipleWin.PersonsCreatedCount);
 		appbar2.Push( 1, Catalog.GetString(myString) );
 			}
 		}
diff --git a/src/gui/jump.cs b/src/gui/jump.cs
index 52cbbb1..5e7e81b 100644
--- a/src/gui/jump.cs
+++ b/src/gui/jump.cs
@@ -480,10 +480,22 @@ public class RepairJumpRjWindow
 		if(myJumpType.FixedValue > 0) {
 			if(myJumpType.JumpsLimited) {
 				//if it's a jump type jumpsLimited with a fixed value, then don't allow the creation of more jumps, and respect the -1 at last TF if found
-				fixedString = string.Format(Catalog.GetString("\nThis jump type is fixed to {0} jumps, you cannot add more."), myJumpType.FixedValue);
+				fixedString = "\n" + string.Format(
+						Catalog.GetPluralString(
+							"This jump type is fixed to one jump.",
+							"This jump type is fixed to {0} jumps.",
+							Convert.ToInt32(myJumpType.FixedValue)),
+						myJumpType.FixedValue) +
+					Catalog.GetString("You cannot add more.");
 			} else {
 				//if it's a jump type timeLimited with a fixed value, then complain when the total time is higher
-				fixedString = string.Format(Catalog.GetString("\nThis jump type is fixed to {0} seconds, totaltime cannot be greater."), myJumpType.FixedValue);
+				fixedString = "\n" + string.Format(
+						Catalog.GetPluralString(
+							"This jump type is fixed to one second.",
+							"This jump type is fixed to {0} secondss.",
+							Convert.ToInt32(myJumpType.FixedValue)),
+						myJumpType.FixedValue) +
+					Catalog.GetString("You cannot add more.");
 			}
 		}
 		return jumpTypeString + startString + fixedString;
diff --git a/src/gui/person.cs b/src/gui/person.cs
index a4b966f..4d0f121 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -605,7 +605,11 @@ public class PersonsRecuperateFromOtherSessionWindow : PersonRecuperateWindow
 			if(inserted == 1)
 				statusbar1.Push( 1, Catalog.GetString("Loaded") + " " + currentPerson.Name );
 			else //more inserted
-				statusbar1.Push( 1, string.Format(Catalog.GetString("Successfully added {0} persons"), inserted));
+				statusbar1.Push( 1, string.Format(Catalog.GetPluralString(
+								"Successfully added one person.",
+								"Successfully added {0} persons.",
+								inserted),
+							inserted));
 
 			fakeButtonDone.Click();
 		}
diff --git a/src/gui/pulse.cs b/src/gui/pulse.cs
index c1e4096..29fb341 100644
--- a/src/gui/pulse.cs
+++ b/src/gui/pulse.cs
@@ -330,17 +330,6 @@ public class RepairPulseWindow
 		 * currently all pulseTypes are non fixed, and it's not possible to create more types (by user), then there are no limitations
 		 */
 
-/*
-		if(myPulseType.FixedPulse > 0) {
-			if(myRunType.TracksLimited) {
-				//if it's a run type runsLimited with a fixed value, then don't allow the creation of more runs
-				fixedString = string.Format(Catalog.GetString("\nThis run type is fixed to {0} runs, you cannot add more."), myRunType.FixedValue);
-			} else {
-				//if it's a run type timeLimited with a fixed value, then complain when the total time is higher
-				fixedString = string.Format(Catalog.GetString("\nThis run type is fixed to {0} seconds, totaltime cannot be greater."), myRunType.FixedValue);
-			}
-		}
-*/
 		return pulseTypeString + fixedString;
 	}
 
diff --git a/src/gui/run.cs b/src/gui/run.cs
index 0787cd2..55527a0 100644
--- a/src/gui/run.cs
+++ b/src/gui/run.cs
@@ -640,10 +640,22 @@ public class RepairRunIntervalWindow
 		if(myRunType.FixedValue > 0) {
 			if(myRunType.TracksLimited) {
 				//if it's a run type runsLimited with a fixed value, then don't allow the creation of more runs
-				fixedString = string.Format(Catalog.GetString("\nThis run type is fixed to {0} runs, you cannot add more."), myRunType.FixedValue);
+				fixedString = "\n" +  string.Format(
+						Catalog.GetPluralString(
+							"This run type is fixed to one run.", 
+							"This run type is fixed to {0} runs.",
+							myRunType.FixedValue), 
+						myRunType.FixedValue) +
+					Catalog.GetString("You cannot add more.");
 			} else {
 				//if it's a run type timeLimited with a fixed value, then complain when the total time is higher
-				fixedString = string.Format(Catalog.GetString("\nThis run type is fixed to {0} seconds, totaltime cannot be greater."), myRunType.FixedValue);
+				fixedString = "\n" + string.Format(
+						Catalog.GetPluralString(
+							"This run type is fixed to one second.",
+							"This run type is fixed to {0} seconds.",
+							myRunType.FixedValue),
+						myRunType.FixedValue) +
+					Catalog.GetString("Totaltime cannot be greater.");
 			}
 		}
 		return runTypeString + fixedString;
diff --git a/src/stats/djIndex.cs b/src/stats/djIndex.cs
index ed2173c..99dd2f2 100644
--- a/src/stats/djIndex.cs
+++ b/src/stats/djIndex.cs
@@ -112,9 +112,11 @@ public class StatDjIndex : Stat
 		if(statsJumpsType == 0) { //all jumps
 			selectedValuesString = allValuesString; 
 		} else if(statsJumpsType == 1) { //limit
-			selectedValuesString = string.Format(Catalog.GetString("First {0} values"), limit); 
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"First value", "First {0} values", limit), limit);
 		} else if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each jumper"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		} else if(statsJumpsType == 3) { //avg of each jumper
 			selectedValuesString = avgValuesString; 
 		}  
diff --git a/src/stats/djQ.cs b/src/stats/djQ.cs
index 677e771..85d225f 100644
--- a/src/stats/djQ.cs
+++ b/src/stats/djQ.cs
@@ -112,9 +112,11 @@ public class StatDjQ : Stat
 		if(statsJumpsType == 0) { //all jumps
 			selectedValuesString = allValuesString; 
 		} else if(statsJumpsType == 1) { //limit
-			selectedValuesString = string.Format(Catalog.GetString("First {0} values"), limit); 
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"First value", "First {0} values", limit), limit);
 		} else if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each jumper"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		} else if(statsJumpsType == 3) { //avg of each jumper
 			selectedValuesString = avgValuesString; 
 		}  
diff --git a/src/stats/fv.cs b/src/stats/fv.cs
index 0837ccb..c86eee5 100644
--- a/src/stats/fv.cs
+++ b/src/stats/fv.cs
@@ -107,7 +107,8 @@ public class StatFv : StatIeIub
 		*/
 		
 		if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each jumper"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		} else if(statsJumpsType == 3) { //avg of each jumper
 			selectedValuesString = avgValuesString; 
 		}  
diff --git a/src/stats/global.cs b/src/stats/global.cs
index 42a6b90..8861b25 100644
--- a/src/stats/global.cs
+++ b/src/stats/global.cs
@@ -138,7 +138,8 @@ public class StatGlobal : Stat
 		*/
 		
 		if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each jumper"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		} else if(statsJumpsType == 3) { //avg of each jumper
 			selectedValuesString = avgValuesString; 
 		}  
diff --git a/src/stats/ieIub.cs b/src/stats/ieIub.cs
index 0ddcf1e..47a8701 100644
--- a/src/stats/ieIub.cs
+++ b/src/stats/ieIub.cs
@@ -112,9 +112,11 @@ public class StatIeIub : Stat
 		if(statsJumpsType == 0) { //all jumps
 			selectedValuesString = allValuesString; 
 		} else if(statsJumpsType == 1) { //limit
-			selectedValuesString = string.Format(Catalog.GetString("First {0} values"), limit); 
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"First value", "First {0} values", limit), limit);
 		} else if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each jumper"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		} else if(statsJumpsType == 3) { //avg of each jumper
 			selectedValuesString = avgValuesString; 
 		}  
diff --git a/src/stats/jumpSimpleSubtraction.cs b/src/stats/jumpSimpleSubtraction.cs
index e26e9c0..0ba6546 100644
--- a/src/stats/jumpSimpleSubtraction.cs
+++ b/src/stats/jumpSimpleSubtraction.cs
@@ -108,9 +108,11 @@ public class StatJumpSimpleSubtraction : Stat
 		if(statsJumpsType == 0) { //all jumps
 			selectedValuesString = allValuesString; 
 		} else if(statsJumpsType == 1) { //limit
-			selectedValuesString = string.Format(Catalog.GetString("First {0} values"), limit); 
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"First value", "First {0} values", limit), limit);
 		} else if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each jumper"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		} else if(statsJumpsType == 3) { //avg of each jumper
 			selectedValuesString = avgValuesString; 
 		}  
diff --git a/src/stats/main.cs b/src/stats/main.cs
index 29704e4..520d0a5 100644
--- a/src/stats/main.cs
+++ b/src/stats/main.cs
@@ -81,7 +81,7 @@ public class Stat
 
 	//for toString() in every stat
 	protected string allValuesString = Catalog.GetString("All values");
-	protected string avgValuesString = Catalog.GetString("Avg values of each jumper");
+	protected string avgValuesString = Catalog.GetString("Avg values of each person");
 	
 	protected int numContinuous; //for stats rj evolution and runIntervallic
 	
diff --git a/src/stats/potency.cs b/src/stats/potency.cs
index 1d16006..58f653a 100644
--- a/src/stats/potency.cs
+++ b/src/stats/potency.cs
@@ -126,15 +126,6 @@ public class StatPotency : Stat
 		if(statsJumpsType == 0) { //all jumps
 			selectedValuesString = allValuesString; 
 		} 
-		/*
-		else if(statsJumpsType == 1) { //limit
-			selectedValuesString = string.Format(Catalog.GetString("First {0} values"), limit); 
-		} else if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each jumper"), limit);
-		} else if(statsJumpsType == 3) { //avg of each jumper
-			selectedValuesString = avgValuesString; 
-		}  
-		*/
 
 		string mySessionString = "";
 		if(sessions.Count > 1) {
diff --git a/src/stats/rjAVGSD.cs b/src/stats/rjAVGSD.cs
index 8f19793..cfdfb6b 100644
--- a/src/stats/rjAVGSD.cs
+++ b/src/stats/rjAVGSD.cs
@@ -176,9 +176,11 @@ public class StatRjAVGSD : Stat
 		if(statsJumpsType == 0) { //all jumps
 			selectedValuesString = allValuesString; 
 		} else if(statsJumpsType == 1) { //limit
-			selectedValuesString = string.Format(Catalog.GetString("First {0} values"), limit); 
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"First value", "First {0} values", limit), limit);
 		} else if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each jumper"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		}
 		/* this option is not possible in this statistic
 		 * 
diff --git a/src/stats/rjEvolution.cs b/src/stats/rjEvolution.cs
index 19cee8d..fd0f37a 100644
--- a/src/stats/rjEvolution.cs
+++ b/src/stats/rjEvolution.cs
@@ -255,9 +255,11 @@ public class StatRjEvolution : Stat
 		if(statsJumpsType == 0) { //all jumps
 			selectedValuesString = allValuesString; 
 		} else if(statsJumpsType == 1) { //limit
-			selectedValuesString = string.Format(Catalog.GetString("First {0} values"), limit); 
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"First value", "First {0} values", limit), limit);
 		} else if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each jumper"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		} 
 		/* this option is not possible in this statistic
 		 * 
@@ -272,7 +274,12 @@ public class StatRjEvolution : Stat
 		
 		string bestResalted = "";
 		if(numContinuous != -1) {
-			bestResalted = string.Format(Catalog.GetString(" (best {0} consecutive jumps marked using [tf/tc *100])"), numContinuous);
+			bestResalted = string.Format(
+					Catalog.GetPluralString(
+						" (best jump marked using [tf/tc *100])",
+						" (best {0} consecutive jumps marked using [tf/tc *100])",
+						numContinuous),
+					numContinuous);
 		}
 
 		return string.Format(Catalog.GetString("{0} in Rj Evolution applied to {1} on {2}{3}"), selectedValuesString, jumpType, mySessionString, bestResalted);
diff --git a/src/stats/rjIndex.cs b/src/stats/rjIndex.cs
index 138b1e8..a22f569 100644
--- a/src/stats/rjIndex.cs
+++ b/src/stats/rjIndex.cs
@@ -114,9 +114,11 @@ public class StatRjIndex : Stat
 		if(statsJumpsType == 0) { //all jumps
 			selectedValuesString = allValuesString; 
 		} else if(statsJumpsType == 1) { //limit
-			selectedValuesString = string.Format(Catalog.GetString("First {0} values"), limit); 
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"First value", "First {0} values", limit), limit);
 		} else if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each jumper"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		} else if(statsJumpsType == 3) { //avg of each jumper
 			selectedValuesString = avgValuesString; 
 		}  
diff --git a/src/stats/rjPotencyBosco.cs b/src/stats/rjPotencyBosco.cs
index 023d716..56424f2 100644
--- a/src/stats/rjPotencyBosco.cs
+++ b/src/stats/rjPotencyBosco.cs
@@ -116,9 +116,11 @@ public class StatRjPotencyBosco : Stat
 		if(statsJumpsType == 0) { //all jumps
 			selectedValuesString = allValuesString; 
 		} else if(statsJumpsType == 1) { //limit
-			selectedValuesString = string.Format(Catalog.GetString("First {0} values"), limit); 
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"First value", "First {0} values", limit), limit);
 		} else if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each jumper"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		} else if(statsJumpsType == 3) { //avg of each jumper
 			selectedValuesString = avgValuesString; 
 		}  
diff --git a/src/stats/runIntervallic.cs b/src/stats/runIntervallic.cs
index 83c41f1..e1d53ba 100644
--- a/src/stats/runIntervallic.cs
+++ b/src/stats/runIntervallic.cs
@@ -242,9 +242,11 @@ public class StatRunIntervallic : Stat
 		if(statsJumpsType == 0) { //all jumps
 			selectedValuesString = allValuesString; 
 		} else if(statsJumpsType == 1) { //limit
-			selectedValuesString = string.Format(Catalog.GetString("First {0} values"), limit); 
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"First value", "First {0} values", limit), limit);
 		} else if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each person"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		} 
 		/* this option is not possible in this statistic
 		else if(statsJumpsType == 3) { //avg of each jumper
@@ -258,7 +260,12 @@ public class StatRunIntervallic : Stat
 		
 		string bestResalted = "";
 		if(numContinuous != -1) {
-			bestResalted = string.Format(Catalog.GetString(" (best {0} consecutive runs marked)"), numContinuous);
+			bestResalted = string.Format(
+					Catalog.GetPluralString(
+						" (best run marked)",
+						" (best {0} consecutive runs marked)",
+						numContinuous),
+					numContinuous);
 		}
 
 		return string.Format(Catalog.GetString("{0} in Run Intervallic applied to {1} on {2}{3}"), selectedValuesString, jumpType, mySessionString, bestResalted);
diff --git a/src/stats/runSimple.cs b/src/stats/runSimple.cs
index 910036d..55e5fa6 100644
--- a/src/stats/runSimple.cs
+++ b/src/stats/runSimple.cs
@@ -110,9 +110,11 @@ public class StatRunSimple : Stat
 		if(statsJumpsType == 0) { //all jumps
 			selectedValuesString = allValuesString; 
 		} else if(statsJumpsType == 1) { //limit
-			selectedValuesString = string.Format(Catalog.GetString("First {0} values"), limit); 
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"First value", "First {0} values", limit), limit);
 		} else if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each person"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		} else if(statsJumpsType == 3) { //avg of each jumper
 			selectedValuesString = avgValuesString; 
 		}  
diff --git a/src/stats/sjCmjAbk.cs b/src/stats/sjCmjAbk.cs
index 94daa2d..2a84f7c 100644
--- a/src/stats/sjCmjAbk.cs
+++ b/src/stats/sjCmjAbk.cs
@@ -110,9 +110,11 @@ public class StatSjCmjAbk : Stat
 		if(statsJumpsType == 0) { //all jumps
 			selectedValuesString = allValuesString; 
 		} else if(statsJumpsType == 1) { //limit
-			selectedValuesString = string.Format(Catalog.GetString("First {0} values"), limit); 
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"First value", "First {0} values", limit), limit);
 		} else if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each jumper"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		} else if(statsJumpsType == 3) { //avg of each jumper
 			selectedValuesString = avgValuesString; 
 		}  
diff --git a/src/stats/sjCmjAbkPlus.cs b/src/stats/sjCmjAbkPlus.cs
index a155cbe..20b1281 100644
--- a/src/stats/sjCmjAbkPlus.cs
+++ b/src/stats/sjCmjAbkPlus.cs
@@ -129,9 +129,11 @@ public class StatSjCmjAbkPlus : Stat
 		if(statsJumpsType == 0) { //all jumps
 			selectedValuesString = allValuesString; 
 		} else if(statsJumpsType == 1) { //limit
-			selectedValuesString = string.Format(Catalog.GetString("First {0} values"), limit); 
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"First value", "First {0} values", limit), limit);
 		} else if(statsJumpsType == 2) { //best of each jumper
-			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each jumper"), limit);
+			selectedValuesString = string.Format(Catalog.GetPluralString(
+						"Max value of each person", "Max {0} values of each person", limit), limit);
 		} else if(statsJumpsType == 3) { //avg of each jumper
 			selectedValuesString = avgValuesString; 
 		}  



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]