Add optional word

This commit is contained in:
Mo 2023-02-26 14:07:06 +01:00
parent 423dcb6914
commit b12fcef1b3

View file

@ -149,6 +149,20 @@ impl Config {
config.state_config.strings.message_from =
config.state_config.strings.message_from.trim().to_string() + " ";
// Add the optional word to fields without a required_feedback.
config
.state_config
.custom_fields
.iter_mut()
.filter(|field| field.required_feedback.is_none())
.for_each(|field| {
field.label = format!(
"{} ({})",
field.label.trim(),
config.state_config.strings.optional
);
});
Ok(config)
}
}