summaryrefslogtreecommitdiff
path: root/site/i18n.js (follow)
Commit message (Collapse)AuthorAgeFilesLines
* site: show hint for unselected radio buttonsstuebinm2021-04-121-2/+6
| | | | | | | In surveys containing radio buttons, there will now be a nice little hint directly beneath them if none were selected when attempting to submit (in addition to the relatively nondescript "not all required questions were filled in"-hint at the bottom of the form)
* site: fix locale detectionstuebinm2021-04-121-4/+8
| | | | (it mistakenly set the locale to undefined before)
* site: attempt to guess default languagestuebinm2021-04-081-1/+18
| | | | | (from the browser's preferences set via navigator.language and navigator.languages)
* add translation logic, locales for en and destuebinm2021-04-081-0/+67
This adds a basic "replace fixed keys"-approach to translating the UI of surveys. So far this works great, but for complex things it may fail for some languages — for now I'll just try to take care not to add any output that puts things in the middle of sentences, which I think should work for a simple survey thing. The default language is still english, which is important as the language is declared withing a survey config — i.e. if loading it fails, it cannot be applied, and the "enter passphrase" dialog can also not change based on locales. This could possibly be fixed by adding an unencrypted "header" to the encrypted configs, but for now I'm not sure if that makes a lot of sense — it may be easier to just guess based on the browser's settings, and otherwise fall back to some specified default language. The "thanks for your answers"-page also has no translation so far.