-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix: repair JSON export #51
Conversation
3c8c021
to
768768f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be rebased on the latest main
.
And probably the languages should have been implemented as a map, not as fixed fields. Imagine if we'd have to add Italian, Rumantsch, Chinese, ...
OK, the correct German translations are not necessary, but still nice.
There will be a lot of empty spaces if a language has been chosen which has not been entered. Should we care about that? Isn't there an i18n method which could help, so we can tell it to do fallbacks on different languages, and it will return the 'best'?
web/frontend/src/mocks/mockData.ts
Outdated
Scaffold: [ | ||
{ | ||
ID: (0xa2ab).toString(), | ||
Title: '{ "en" : "Rate the course", "fr" : "Note la course", "de" : "Rate the course"}', | ||
Title: { En: 'Rate the course', Fr: 'Note la course', De: 'Rate the course' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Title: { En: 'Rate the course', Fr: 'Note la course', De: 'Rate the course' }, | |
Title: { En: 'Rate the course', Fr: 'Notez le cours', De: 'Benoten Sie den Kurs' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- please add my changes for
de
- Uploading the form via JSON does work - Hurray!
./scripts/local_form.sh
should create a correct form. I tried to run it with the following JSON on line 7 (I had to add Using correct URL #61 to make it work, which is normal, but just in case you want to repeat my experiment):
{"Title":{"En":"Colours","Fr":"","De":""},"Scaffold":[{"ID":"GErn0cNj","Title":{"En":"Colours","Fr":"","De":""},"Order":["DLfAvGgv"],"Ranks":[{"ID":"DLfAvGgv","Title":{"En":"RGB","Fr":"","De":""},"MaxN":3,"MinN":3,"Choices":["{\"en\":\"Red\"}","{\"en\":\"Green\"}","{\"en\":\"Blue\"}"],"Hint":{"En":"","Fr":"","De":""}}],"Selects":[],"Texts":[],"Subjects":[]}]}
a. To reproduce this, run./scripts/run_local.sh
, then./scripts/local_proxies.sh
, and./scripts/local_forms.sh
with the changed JSON
b. It adds the form, but when I try to vote, the screen is empty
c. In the JSON of the 'ranking' vote above, theChoices
still looks like an escaped string and not a JSON - is this on purpose?
d. Thetitle
of the form created withlocal_form.sh
istitle
, and notColours
e. When trying to vote on this form, I have the following error in my javascript console:
Uncaught TypeError: configObj.Scaffold is not iterable
at unmarshalConfigAndCreateAnswers (JSONparser.ts:171:1)
at useConfiguration.tsx:13:1
|
|
made up my own translations since that's quicker than copying them, hope that's OK |
Works for me. Github allows you to "Merge comment" if it's a code change. So you can simply commit all comments. Sometimes there is even "Add to merge batch" or something like that, but I don't see it always, gotta figure out when it appears... |
This PR fixes the various problems w/ the exported JSON, including
closes dedis#316