Skip to content

Commit

Permalink
Fix bug where no english or georgian translation for field resulted i…
Browse files Browse the repository at this point in the history
…n an error in translated_string()
  • Loading branch information
kellpossible committed Apr 14, 2024
1 parent b00a41f commit 0e94964
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,7 @@ pub async fn middleware(
tracing::debug!("translations: {translations:?}");

if translations.len().unwrap_or(0) == 0 {
return Err(minijinja::Error::new(
minijinja::ErrorKind::MissingArgument,
format!(
"No translations are provided in the translations argument: {translations:?}"
),
));
return Ok(minijinja::Value::from_safe_string(String::new()));
}

let available_languages: Vec<unic_langid::LanguageIdentifier> = translations
Expand Down

0 comments on commit 0e94964

Please sign in to comment.