diff mde/content/Items.d @ 107:20f7d813bb0f

Translation: now has a file for each locale, instead of a file for each section. Items updated; all strings translated. New unittest for Translation; I realised the old one wasn't run anymore. Changed unittest data and conf dirs.
author Diggory Hardy <diggory.hardy@gmail.com>
date Sun, 30 Nov 2008 17:17:56 +0000
parents 08651e8a8c51
children c9fc2d303178
line wrap: on
line diff
--- a/mde/content/Items.d	Sat Nov 29 16:43:44 2008 +0000
+++ b/mde/content/Items.d	Sun Nov 30 17:17:56 2008 +0000
@@ -51,7 +51,9 @@
 			list[i++] = opts.contentList;
 		    }
 		    Options.allContentList = new ContentList (h, list);
-		    Options.allContentList.name ("Options");	//FIXME
+		    Translation trl = Translation.get (h);
+		    Translation.Entry trle = trl.getStruct (h);
+		    Options.allContentList.name (trle.name, trle.desc);
 		}
 		return Options.allContentList;
 	    }
@@ -68,9 +70,18 @@
 		if (q && item is null)	// enforce item is an exact match
 		    return *q;
 	    }
-	} else if (h == "quit" && item is null) {
-	    quit.name ("Quit");	//FIXME
-	    return quit;
+	} else if (h == "imde") {
+	    if (!imdeTransl) {
+		Translation trl = Translation.get (h);
+		Translation.Entry trle = trl.getStruct ("quit");
+		quit.name (trle.name, trle.desc);
+		imdeTransl = true;
+	    }
+	    h = head (item);
+	    if (h == "quit" && item is null) {
+		quit.name ("Quit");	//FIXME
+		return quit;
+	    }
 	}
 	throw new ContentItemException (h);
     }
@@ -92,7 +103,7 @@
     
     void loadTransl (Options p, char[] n) {
 	debug logger.trace ("Loading translation strings for Options."~n);
-	Translation trans = Translation.load ("L10n/"~n);
+	Translation trans = Translation.get (n);
 	Translation.Entry transled = trans.getStruct (n);
 	p.contentList = new ContentList (n, p.content);
 	p.contentList.name (transled.name, transled.desc);
@@ -101,3 +112,5 @@
 	    v.name (transled.name, transled.desc);
 	}
     }
+    
+    bool imdeTransl = false;	// Has section imde been translated?