--- a/web/views/wdoc.py Tue Feb 15 23:30:01 2011 +0100
+++ b/web/views/wdoc.py Wed Feb 16 08:54:09 2011 +0100
@@ -92,9 +92,14 @@
return index
def title_for_lang(node, lang):
+ fallback_title = None
for title in node.findall('title'):
- if title.attrib['{http://www.w3.org/XML/1998/namespace}lang'] == lang:
+ title_lang = title.attrib['{http://www.w3.org/XML/1998/namespace}lang']
+ if title_lang == lang:
return unicode(title.text)
+ if title_lang == 'en':
+ fallback_title = unicode(title.text)
+ return fallback_title
def subsections(node):
return [child for child in node if child.tag == 'section']