Integer and decimal widgets disappear after switching language
See original GitHub issueDescribe the bug
For a form with two languages, integer and decimal questions appear initially, but after switching to the second language, they disappear. They do not return after switching back to the first language.
I’ve seen #495, #496, etc., but this problem happens even when config.json either
- contains no
widgetsoverride, or - contains an array of
widgetsthat explicitly includesintegeranddecimal.
The problem does not happen on https://enketo.getodk.org/, but that instance reports to be running version: 5.0.0-4-g67bf890. I couldn’t find that commit in this repository. If there’s a hotfix somewhere, I’d love to use it 😃
To Reproduce
Use this minimal XLSForm: numbers-missing-after-language-switch.xlsx
| type | name | label::OK | label::NG |
|---|---|---|---|
| integer | int_q | OK int | NG int |
| decimal | dec_q | OK dec | NG dec |
| text | txt_q | OK txt | NG txt |
- Check out tag
5.0.0from this repository - Create a minimal
config.json, e.g.{ "port": "8999", "encryption key": "insecure-enketo-dev", "linked form and data server": { "api key": "insecure-enketo-dev", "server url": "" }, "redis": { "cache": { "host": "10.6.6.1", "password": "insecure-redis-dev", "port": "60667" }, "main": { "host": "10.6.6.1", "password": "insecure-redis-dev", "port": "60667" } } } npm run startetc.- Use XLSForm Online to generate the XForm from numbers-missing-after-language-switch.xlsx (above)
- Click “Preview in browser” and see that it works properly
- Grab the path and query string, e.g.
preview?form=https%3A//xlsform.getodk.org/downloads/xbeexfwc/numbers-missing-after-language-switch.xml
- Use that path and query string with local Enketo 5.0.0, e.g.
http://localhost:8999/preview?form=https%3A//xlsform.getodk.org/downloads/xbeexfwc/numbers-missing-after-language-switch.xml - See that things look good initially:

- Switch to “NG” language
- See that integer and decimal questions disappear while the text question remains:

- Switch back to “OK” language and see that the questions are still gone.
Browser and OS (please complete the following information):
- OS: Linux
- Browser: Firefox and Chrome
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Decimal and thousands separators not displaying correctly on ...
Decimal and thousands separators not displaying correctly on widgets. Check that your browser's locale is set to the correct country. Richard Ingram avatar....
Read more >Decimal separator comma (',') with numberDecimal inputType ...
I am using this solution in combination with com.google.android.material.textfield.TextInputEditText , it works like a charm, no duplicate separators. – Dwagner.
Read more >DecimalFormat - Android Developers
If doubled, replaced by international currency symbol. If present in a pattern, the monetary decimal separator is used instead of the decimal separator....
Read more >Carto time-series widget: how to change bucket labels?
In the widget's horizontal axis, the buckets are not labeled with integer values but with decimal values (e.g. 1.8k instead of 1800). People ......
Read more >Decimal separator (period vs comma) [#3121038] | Drupal.org
Use the site-wide setting in the decimal Migrate class. ... example we are no longer able to use the "number" element on the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

One of the changes made to reduce the risk of data loss due to invalid numeric input is to set the lang attribute on numeric controls. This is broadly recommended (eg https://www.ctrl.blog/entry/html5-input-number-localization.html). However, form translations are done by hiding every element with lang attributes that don’t also have an
activeattribute. We’re trying to fix this current issue in a way that makes sense and allows broader use of the lang attribute which is good for accessibility.Yes, that’s what we’re finding too. In general we are not very satisfied with how we do (or don’t) get feedback about Enketo as part of the release process. Ideas for improvement are welcome.
When you find regressions, getting a feel for how severe you find it, whether it’s in production, and how it has been found would be helpful. We try to prioritize regressions but it can be pretty disruptive so if you consider it minor or you’re not deploying yet anyway that would be very helpful to know. It can also take us some time to feel like we have a safe and thoughtful fix when we run into unexpected interactions like we did here.