XLSForm / pyxform

A Python package to create XForms for ODK Collect.
BSD 2-Clause "Simplified" License
80 stars 136 forks source link

Duplicate label translations for secondary itemsets #463

Closed lognaturel closed 4 years ago

lognaturel commented 4 years ago

Software and hardware versions

all

Problem description

When a XLSForm definition includes a select with a choice filter, that select is output as a XForm secondary instance. If the choices have labels in multiple languages, the itext machinery is used and each label gets included twice in the translation block. For example, for this form:

<translation lang="French">
    <text id="/data/foo/a:label">
        <value>Ah</value>
    </text>
    <text id="/data/foo/b:label">
        <value>Bé</value>
    </text>
    <text id="/data/foo/c:label">
        <value>Cé</value>
    </text>
    <text id="static_instance-list-0">
        <value>Ah</value>
    </text>
    <text id="static_instance-list-1">
        <value>Bé</value>
    </text>
    <text id="static_instance-list-2">
        <value>Cé</value>
    </text>
</translation>

Steps to reproduce the problem

Write a form with a select with translated labels and a choice filter.

Expected behavior

Label strings should only be included once per language.

Other information

Note that itext and secondary instances aren't complementary. This ODK forum thread has more on that. The solution might be to swap all of it out at some point but before clients are all on the same page it would be good to only output each label once.

lognaturel commented 4 years ago

Closed by #468