From 06f6678ad24551ae2c66c3d9db0cbfa6fff6497a Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Fri, 9 Sep 2011 17:45:16 +0200 Subject: Put title attributes on category links. --- org/madore/damlengine/TodoCategories.java | 2 ++ org/madore/damlengine/TodoWeblogSelectionElement.java | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'org/madore/damlengine') diff --git a/org/madore/damlengine/TodoCategories.java b/org/madore/damlengine/TodoCategories.java index 3219e82..cc104e8 100644 --- a/org/madore/damlengine/TodoCategories.java +++ b/org/madore/damlengine/TodoCategories.java @@ -45,6 +45,8 @@ public final class TodoCategories extends TodoElement { String target1URL = ((ctx.gc.uriToTop==null)?"":(ctx.gc.uriToTop+"weblog/")) + cat + ".html"; a1.setAttributeNS(null, "href", target1URL); + a1.setAttributeNS(null, "title", + TodoWeblogSelectionElement.categoryName(cat, lang)); p.appendChild(a1); a1.appendChild(ctx.doc.createTextNode(cat)); p.appendChild(ctx.doc.createTextNode("(")); diff --git a/org/madore/damlengine/TodoWeblogSelectionElement.java b/org/madore/damlengine/TodoWeblogSelectionElement.java index a7b3490..05d5710 100644 --- a/org/madore/damlengine/TodoWeblogSelectionElement.java +++ b/org/madore/damlengine/TodoWeblogSelectionElement.java @@ -44,18 +44,24 @@ public final class TodoWeblogSelectionElement extends TodoDefaultElement { categoryNames = new HashMap>(); categoryNames.put("en", new HashMap()); categoryNames.put("fr", new HashMap()); + categoryNames.put("de", new HashMap()); + categoryNames.put("ia", new HashMap()); categoryNames.get("en").put("glf", "Gratuitous Literary Fragments"); - categoryNames.get("fr").put("glf", "Fragments lit\u00e9raires gratuits"); + categoryNames.get("fr").put("glf", "Fragments litt\u00e9raires gratuits"); + categoryNames.get("ia").put("glf", "Fragmentos litterari gratuite"); categoryNames.get("en").put("math", "Mathematics"); categoryNames.get("fr").put("math", "Math\u00e9matiques"); categoryNames.get("en").put("phys", "Physics"); categoryNames.get("fr").put("phys", "Physique"); } - public String categoryName(String code, String lang) { + public static String categoryName(String code, String lang) { if ( categoryNames.get(lang) == null ) return code; - return categoryNames.get(lang).get(code); + String name = categoryNames.get(lang).get(code); + if ( name == null ) + return code; + return name; } @Override -- cgit v1.2.3