New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't generate itext block if only one language is defined #285
Comments
See nigeria_wards_internal.xml.txt and nigeria_wards_internal_simplified.xml.txt for what I'm talking about. File size goes from 4.6mb to 3mb. |
Checking this one along while waiting for PR review. |
@nribeka This is a really good one to look into. Please ask if you have any questions about the problem or intended behavior. |
@lognaturel is there a place where i can get the xls for the form? From your description and looking at the xml, the idea is to not use the translation field when there's only one language, right? It should inline it instead of separating it. This is only true when the survey have one language only, right? |
Yes, exactly. Simple example: XLSForm, XForm Note that the static choice list uses literal label text which is what is expected. When I force a dynamic choice list by using a choice filter is where the problem occurs. What we'd like: <instance id="choices">
<root>
<item>
<label>Choice 1</label>
<value>choice 1</value>
</item>
<item>
<label>Choice 2</label>
<value>choice 2</value>
</item>
<item>
<label>Choice 3</label>
<value>choice 3</value>
</item>
<item>
<label>Choice 4</label>
<value>choice 4</value>
</item>
<item>
<label>Choice 5</label>
<value>choice 5</value>
</item>
<item>
<label>Choice 6</label>
<value>choice 6</value>
</item>
</root>
</instance> The <itemset nodeset="instance('choices')/root/item[name != '']">
<value ref="name"/>
<label ref="label"/>
</itemset> |
Another approach would be:
Thoughts? The above draft PR obviously break existing tests that have reference to the field. I'm gonna change the expected output xml files if that's ok? |
The
itext
block can include translations for form elements (see spec).pyxform
always adds this level of indirection for cascading selects, even if the XLSForm only defines labels/hints for a single language. This isn't a big deal for small secondary instances but can make the XML much bigger for large ones.Related to #32 and might be good to address while in the same brain space.
The text was updated successfully, but these errors were encountered: