[gbrainy] Remove unnecesary String.Format calls



commit 7ffe6dfe668a75fa3dd90cc0d882fbf82a40f423
Author: Jordi Mas <jmas softcatala org>
Date:   Fri Sep 24 11:02:22 2010 +0200

    Remove unnecesary String.Format calls

 src/Games/Calculation/CalculationFractions.cs |    2 +-
 src/Games/Logic/Puzzle3DCube.cs               |    2 +-
 src/Games/Logic/PuzzleExtraCircle.cs          |    2 +-
 src/Games/Logic/PuzzleMatrixNumbers.cs        |   22 +++++++---------------
 src/Games/Logic/PuzzleNextFigure.cs           |    2 +-
 src/Games/Logic/PuzzleTrains.cs               |    6 +++---
 src/Games/Memory/MemoryWords.cs               |    2 +-
 7 files changed, 15 insertions(+), 23 deletions(-)
---
diff --git a/src/Games/Calculation/CalculationFractions.cs b/src/Games/Calculation/CalculationFractions.cs
index 3fb2e51..ae5fd86 100644
--- a/src/Games/Calculation/CalculationFractions.cs
+++ b/src/Games/Calculation/CalculationFractions.cs
@@ -65,7 +65,7 @@ namespace gbrainy.Games.Calculation
 		}
 
 		public override string Question {
-			get {return String.Format (Catalog.GetString ("What is the result of the given operation? Answer using either a fraction or a number."));} 
+			get {return Catalog.GetString ("What is the result of the given operation? Answer using either a fraction or a number.");} 
 		}
 
 		private int Factor {
diff --git a/src/Games/Logic/Puzzle3DCube.cs b/src/Games/Logic/Puzzle3DCube.cs
index 0263a31..f18d6b9 100644
--- a/src/Games/Logic/Puzzle3DCube.cs
+++ b/src/Games/Logic/Puzzle3DCube.cs
@@ -33,7 +33,7 @@ namespace gbrainy.Games.Logic
 		}
 
 		public override string Question {
-			get {return String.Format (Catalog.GetString ("How many small cubes does it take to build the large cube below? Answer using a number."));}
+			get {return Catalog.GetString ("How many small cubes does it take to build the large cube below? Answer using a number.");}
 		}
 
 		public override string Tip {
diff --git a/src/Games/Logic/PuzzleExtraCircle.cs b/src/Games/Logic/PuzzleExtraCircle.cs
index 9b06a37..8edda39 100644
--- a/src/Games/Logic/PuzzleExtraCircle.cs
+++ b/src/Games/Logic/PuzzleExtraCircle.cs
@@ -57,7 +57,7 @@ namespace gbrainy.Games.Logic
 
 		public override string Rationale {
 			get {
-				return String.Format (Catalog.GetString ("In all circles the color slices follow the same order except for this one."));
+				return Catalog.GetString ("In all circles the color slices follow the same order except for this one.");
 			}
 		}
 
diff --git a/src/Games/Logic/PuzzleMatrixNumbers.cs b/src/Games/Logic/PuzzleMatrixNumbers.cs
index b95869d..7435dd4 100644
--- a/src/Games/Logic/PuzzleMatrixNumbers.cs
+++ b/src/Games/Logic/PuzzleMatrixNumbers.cs
@@ -59,36 +59,28 @@ namespace gbrainy.Games.Logic
 
 		public override string Rationale {
 			get { 
-				string answer;
-
 				switch (operation) {
 				case Operation.MultiplyAndAdd:
 					if (orientation) {
-						answer = String.Format(Catalog.GetString("The fourth row is calculated by multiplying the first two rows and adding the third."));
+						return Catalog.GetString ("The fourth row is calculated by multiplying the first two rows and adding the third.");
 					} else {
-						answer = String.Format(Catalog.GetString("The fourth column is calculated by multiplying the first two columns and adding the third."));
+						return Catalog.GetString ("The fourth column is calculated by multiplying the first two columns and adding the third.");
 					}
-					break;
 				case Operation.MutilplyAndSubs:
 					if (orientation) {
-						answer = String.Format(Catalog.GetString("The fourth row is calculated by multiplying the first two rows and subtracting the third."));
+						return Catalog.GetString ("The fourth row is calculated by multiplying the first two rows and subtracting the third.");
 					} else {
-						answer = String.Format(Catalog.GetString("The fourth column is calculated by multiplying the first two columns and subtracting the third."));
+						return Catalog.GetString ("The fourth column is calculated by multiplying the first two columns and subtracting the third.");
 					}
-					break;
 				case Operation.AddAndSubs:
 					if (orientation) {
-						answer = String.Format(Catalog.GetString("The fourth row is calculated by adding the first two rows and subtracting the third."));
+						return Catalog.GetString ("The fourth row is calculated by adding the first two rows and subtracting the third.");
 					} else {
-						answer = String.Format(Catalog.GetString("The fourth column is calculated by adding the first two columns and subtracting the third."));
+						return Catalog.GetString ("The fourth column is calculated by adding the first two columns and subtracting the third.");
 					}
-					break;
 				default:
-					answer = string.Empty;
-					break;
+					return string.Empty;
 				}
-
-				return answer;
 			}
 		}
 
diff --git a/src/Games/Logic/PuzzleNextFigure.cs b/src/Games/Logic/PuzzleNextFigure.cs
index d98fc9e..731397b 100644
--- a/src/Games/Logic/PuzzleNextFigure.cs
+++ b/src/Games/Logic/PuzzleNextFigure.cs
@@ -62,7 +62,7 @@ namespace gbrainy.Games.Logic
 
 		public override string Rationale {
 			get {
-				return String.Format (Catalog.GetString ("From first figure, the top circle advances by two positions clockwise, while the left circle goes backwards one position."));
+				return Catalog.GetString ("From first figure, the top circle advances by two positions clockwise, while the left circle goes backwards one position.");
 			}
 		}
 
diff --git a/src/Games/Logic/PuzzleTrains.cs b/src/Games/Logic/PuzzleTrains.cs
index 4fb3c97..695000c 100644
--- a/src/Games/Logic/PuzzleTrains.cs
+++ b/src/Games/Logic/PuzzleTrains.cs
@@ -83,7 +83,7 @@ namespace gbrainy.Games.Logic
 						"A train leaves the station traveling at {0} mph. {1} hours later a second train leaves the station traveling in the same direction at {2} mph. How many hours does it take the second train to overtake the first train?", (int) hours),
 						speed_a, hours, speed_b);
 
-				answer = String.Format (Catalog.GetString ("You can calculate the answer multiplying the second train speed by the time and dividing it by the difference of speeds."));
+				answer = Catalog.GetString ("You can calculate the answer multiplying the second train speed by the time and dividing it by the difference of speeds.");
 
 				break;
 			}
@@ -104,7 +104,7 @@ namespace gbrainy.Games.Logic
 					Catalog.GetString ("Two trains separated by {0} miles are heading towards each other on straight parallel tracks. One travels at {1} mph and the other at {2} mph. In how many hours do they meet?"),
 						distance, speed_a, speed_b);
 
-				answer = String.Format (Catalog.GetString ("You can calculate the answer dividing the distance by the sum of both speeds."));
+				answer = Catalog.GetString ("You can calculate the answer dividing the distance by the sum of both speeds.");
 				break;
 			}
 			case GameType.Apart:
@@ -125,7 +125,7 @@ namespace gbrainy.Games.Logic
 					Catalog.GetString ("Two trains on straight parallel tracks leave from the same point and time traveling in opposite directions at {0} and {1} mph respectively. In how many hours they will be {2} miles apart?"), 
 						speed_a, speed_b, distance);
 
-				answer = String.Format (Catalog.GetString ("You can calculate the answer dividing the distance by the sum of both speeds."));
+				answer = Catalog.GetString ("You can calculate the answer dividing the distance by the sum of both speeds.");
 				break;
 			}
 			default:
diff --git a/src/Games/Memory/MemoryWords.cs b/src/Games/Memory/MemoryWords.cs
index 05e6ab0..c53e417 100644
--- a/src/Games/Memory/MemoryWords.cs
+++ b/src/Games/Memory/MemoryWords.cs
@@ -39,7 +39,7 @@ namespace gbrainy.Games.Memory
 
 		public override string MemoryQuestion {
 			get { 
-				return String.Format (Catalog.GetString ("There is a missing word from the previous list. Which one is the missing word?"));}
+				return Catalog.GetString ("There is a missing word from the previous list. Which one is the missing word?");}
 		}
 
 		protected override void Initialize ()



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