Good point. Would be nice to figure that out too. Thanks!
Yes, indeed.
Nothing defined afaik, but actually Enketo does support an undocumented, rogue and forgotten method that relies on using
::nl
postfixes to CSV columns or lang="nl"
attributes in XML nodes. I wonder if that less flexible solution would be acceptable, as it's a very lightweight solution and I like it.
It would be exposed by a (new) translation function call. Enketo chose the function name translate
1 and it could be used in the above proposal like this:
type | parameters | name | label |
---|---|---|---|
select_multiple_from_file hh-data.csv | value=hh_number, label=translate(hh_name) | a | Select |
resulting in the XForm output:
<itemset nodeset="instance('hh-data')/root/item">
<value ref="hh_number" />
<label ref="translate(hh_name)" />
</itemset>
That new XPath function would return from its node-set parameter the first XML node (including transformed CSV to XML) with a lang
attribute that matches the current language.
Note:
1 Very bad name because there is an XPath 1.0 function with that name that does something entirely different. We could use something like current-lang
instead.