summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--utils/src/main.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/utils/src/main.rs b/utils/src/main.rs
index 3d6f885..4428ac3 100644
--- a/utils/src/main.rs
+++ b/utils/src/main.rs
@@ -12,11 +12,19 @@ use secrecy::ExposeSecret;
use age::x25519::Recipient;
#[derive(Deserialize, Serialize, StaticType, Debug)]
+#[serde(rename_all="lowercase")]
+enum Lang {
+ de,
+ en
+}
+
+#[derive(Deserialize, Serialize, StaticType, Debug)]
struct Survey {
title: String,
description: String,
questions: Vec<Question>,
- pubkey: Option<String>
+ pubkey: Option<String>,
+ lang: Lang
}
#[derive(Deserialize, Serialize, StaticType, Debug)]
@@ -56,9 +64,10 @@ fn main () {
// imported: just wrap our input code into a dhall "let"-statement.
// Probably doesn't scale very vell, though ...
let code = format!(
- "let Question = {} \nlet Answers = {} \nin {}",
+ "let Question = {} \nlet Answers = {} \nlet Lang = {}\nin {}",
Question::static_type(),
AnswerSpace::static_type(),
+ Lang::static_type(),
config_file
);
match serde_dhall::from_str(&code)