diff options
author | stuebinm | 2021-04-08 17:44:53 +0200 |
---|---|---|
committer | stuebinm | 2021-04-08 17:53:10 +0200 |
commit | 3890d8ac88b2fdfa7b54d433e8e2edf2164be6f0 (patch) | |
tree | 375aafba67ee4c7a314bd55d17f89275bd691698 /site/examples | |
parent | 7e38d7f84463342dd428e7400777fdc675a8fbce (diff) |
add translation logic, locales for en and de
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.
Diffstat (limited to 'site/examples')
-rw-r--r-- | site/examples/encrypted.json | bin | 641 -> 652 bytes | |||
-rw-r--r-- | site/examples/example.json | 2 |
2 files changed, 1 insertions, 1 deletions
diff --git a/site/examples/encrypted.json b/site/examples/encrypted.json Binary files differindex 3eac1c5..2e24d13 100644 --- a/site/examples/encrypted.json +++ b/site/examples/encrypted.json diff --git a/site/examples/example.json b/site/examples/example.json index 2a6c2f9..fcd09d8 100644 --- a/site/examples/example.json +++ b/site/examples/example.json @@ -1 +1 @@ -{"title":"Test Survey","description":"This is a test survey.","questions":[{"question":"first question","name":"question1","space":"YesOrNo"},{"question":"second question","name":"question2","space":{"Freeform":"test"}},{"question":"third question","name":"question3","space":{"Multiple":["first possible answer","second possible answer","third possible answer"]}}],"pubkey":"age1f380w6eaeuydey65mmu88h4kqv50dda96pxlgkal78sufpnngypqnetmuu"} +{"title":"Test Survey","description":"This is a test survey.","questions":[{"question":"first question","name":"question1","space":"YesOrNo"},{"question":"second question","name":"question2","space":{"Freeform":"test"}},{"question":"third question","name":"question3","space":{"Multiple":["first possible answer","second possible answer","third possible answer"]}}],"pubkey":"age1f380w6eaeuydey65mmu88h4kqv50dda96pxlgkal78sufpnngypqnetmuu","lang":"en"}
\ No newline at end of file |