1.1 --- a/XSLForms/Output.py Thu Jan 18 22:56:33 2007 +0000
1.2 +++ b/XSLForms/Output.py Thu Jan 18 22:56:53 2007 +0000
1.3 @@ -397,10 +397,12 @@
1.4 transform_context = libxsltmod.xsltXPathGetTransformContext(context)
1.5 translations_var = libxsltmod.xsltVariableLookup(transform_context, "translations", None)
1.6 locale_var = libxsltmod.xsltVariableLookup(transform_context, "locale", None)
1.7 - if translations_var is not None and locale_var is not None:
1.8 + if translations_var is not None and translations_var and locale_var is not None:
1.9 translations = libxml2dom.Node(translations_var[0])
1.10 results = translations.xpath("/translations/locale[code/@value='%s']/translation[@value='%s']/text()" % (locale_var, value))
1.11 - if len(results) > 0:
1.12 + if not results:
1.13 + results = translations.xpath("/translations/locale[1]/translation[@value='%s']/text()" % value)
1.14 + if results:
1.15 return results[0].nodeValue.encode(libxml2_encoding)
1.16 return value.encode(libxml2_encoding)
1.17