[gbrainy] Supports ignoring specific verbal analogies in translations



commit f3d6b1f64746c3c7295195bfeaeb6de37064e3c2
Author: Jordi Mas <jmas softcatala org>
Date:   Mon Mar 29 20:11:32 2010 +0200

    Supports ignoring specific verbal analogies in translations

 src/Core/Main/Verbal/AnalogiesFactory.cs |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/Core/Main/Verbal/AnalogiesFactory.cs b/src/Core/Main/Verbal/AnalogiesFactory.cs
index cbe2ea6..b33604e 100644
--- a/src/Core/Main/Verbal/AnalogiesFactory.cs
+++ b/src/Core/Main/Verbal/AnalogiesFactory.cs
@@ -33,6 +33,7 @@ namespace gbrainy.Core.Main.Verbal
 		static bool read = false;
 	
 		public const char Separator = '|';
+		static readonly string IgnoreAnalogy = "<ignore>";
 
 		static AnalogiesFactory ()
 		{
@@ -73,7 +74,9 @@ namespace gbrainy.Core.Main.Verbal
 							answers.Clear ();
 						}
 						else {
-							if (reader.NodeType == XmlNodeType.EndElement) {
+							if (reader.NodeType == XmlNodeType.EndElement &&
+								// Ignores verbal analogies disabled for a specific locale
+								Catalog.GetString (analogy.question) != IgnoreAnalogy) {
 								analogy.answers = answers.ToArray ();
 								analogies_arrays [(int) analogy.type].Add (analogies_arrays [(int) analogy.type].Count, analogy);
 							}
@@ -103,6 +106,7 @@ namespace gbrainy.Core.Main.Verbal
 								break;
 							}
 						}
+
 						analogy.question = reader.ReadElementString ();
 						break;
 					case "_tip":



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