OpenClinica / enketo-oc

OpenClinica's fork of the Enketo web forms monorepo
Apache License 2.0
0 stars 1 forks source link

Fieldsubmission feedback messages showing text from two different locales #57

Open malcjackson opened 1 year ago

malcjackson commented 1 year ago

Describe the bug Loading a form in the ja locale with a language query parameter of de, the form UI is showing some text in ja and some text from the de locale.

To Reproduce Create form that includes en and ja langauge settings (not de), and access the form with a language query parameter of DE and browser locale of JA: Language Query Parameter: DE Browser Locale: JA Expected form lang: JA Expected form UI lang: DE

Outcome: Some labels in the form UI appear in JA, some appear in DE. The form loads in JA as expected.

1-b

MartijnR commented 1 year ago

@malcjackson, could you please share the XForm? (considering I couldn't reproduce OpenClinica/enketo-oc#58)

malcjackson commented 1 year ago

multilanguagefom.txt Here's an example of a form we're seeing this in. When this form is accessed with a DE language query parameter, it's showing the up like this. The form in fr, and the UI in a mix of de/en.

fr-de-en
MartijnR commented 1 year ago

There is an interesting issue with that form. It has an empty space (newline) before the <?xml declaration. I believe this makes the file invalid. Not sure if that's the issue here though. It seems unlikely that the form would load at all if that was the issue.

I see this in the single/fs/i view with a lang=de query parameter:

Screenshot 2023-01-24 at 2 01 48 PM

Could you email/post is the form URL (src of iframe element) please. You could remove the domain and the Enketo and ecid ID. I just would like to see the path and the lang query parameter.

MartijnR commented 1 year ago

Try review-only mode (see German above button), and readonly as well.

regular: http://localhost:8005/single/fs/i/9ZxLSiE7?ecid=a&lang=de readonly: http://localhost:8005/view/fs/i/de100510370cfdf124a22eb966f11d23?ecid=a&lang=de

review-only:

curl --user enketorules: -d "server_url=http://localhost:3000&form_id=multilang-nodefault&lang=de&instance=\
    <data><page1><locale_note/><yn1>1</yn1><yn1_comment/></page1><meta><instanceID>a</instanceID></meta></data>&instance_id=a&ecid=b" http://localhost:8005/oc/api/v1/instance/note

I cannot reproduce so far. I see French buttons etc, except for the "You're in review-only mode" because that translation is missing in French.

Yes, I can reproduce it with the readonly view in the 4.0.1.oc branch (latest) only

The translation-combined.json built files look correct ("schreibgeschützten" is only present in the german files).

MartijnR commented 1 year ago
MartijnR commented 1 year ago
MartijnR commented 1 year ago

internal PR https://github.com/OpenClinica/enketo-express-oc/pull/623