question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integer and decimal widgets disappear after switching language

See original GitHub issue

Describe 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 widgets override, or
  • contains an array of widgets that explicitly includes integer and decimal.

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
  1. Check out tag 5.0.0 from this repository
  2. 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"
            }
        }
    }
    
  3. npm run start etc.
  4. Use XLSForm Online to generate the XForm from numbers-missing-after-language-switch.xlsx (above)
    1. Click “Preview in browser” and see that it works properly
    2. Grab the path and query string, e.g. preview?form=https%3A//xlsform.getodk.org/downloads/xbeexfwc/numbers-missing-after-language-switch.xml
  5. 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
  6. See that things look good initially: image
  7. Switch to “NG” language
  8. See that integer and decimal questions disappear while the text question remains: image
  9. 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:closed
  • Created 9 months ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
lognaturelcommented, Dec 21, 2022

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 active attribute. 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.

0reactions
lognaturelcommented, Dec 22, 2022

overall participation has been limited to a few power users

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found