add default language

This commit is contained in:
Dominic 2024-05-18 15:21:14 +02:00
parent 4612cbdfaa
commit cae7b9b99b
Signed by: msrd0
GPG key ID: AAF7C8430CA3345D
2 changed files with 7 additions and 0 deletions

View file

@ -94,6 +94,12 @@ pub const BRITISH: Language<'static> = Language {
questions_feedback: "Questions, Suggestions and Feedback"
};
impl Default for Language<'static> {
fn default() -> Self {
GERMAN
}
}
impl FromStr for Language<'static> {
type Err = anyhow::Error;

View file

@ -154,6 +154,7 @@ struct ProjectLecture {
docent: String,
#[serde_as(as = "DisplayFromStr")]
date: Date,
#[serde(default = "Default::default")]
#[serde_as(as = "DisplayFromStr")]
lang: Language<'static>
}