diff --git a/i18n-helpers/src/gettext.rs b/i18n-helpers/src/gettext.rs index 16e8dca4..46ee2fb7 100644 --- a/i18n-helpers/src/gettext.rs +++ b/i18n-helpers/src/gettext.rs @@ -44,7 +44,7 @@ fn translate(text: &str, catalog: &Catalog) -> anyhow::Result { let events = extract_events(text, None); // Translation should always succeed. let translated_events = - translate_events(&events, catalog).expect("Fatal: failed to translate events"); + translate_events(&events, catalog).expect("Failed to translate events"); let (translated, _) = reconstruct_markdown(&translated_events, None) .map_err(|e| match e { CmarkError::FormatFailed(_) => e.into(), diff --git a/i18n-helpers/src/lib.rs b/i18n-helpers/src/lib.rs index 3ed1b97b..3ab04c10 100644 --- a/i18n-helpers/src/lib.rs +++ b/i18n-helpers/src/lib.rs @@ -462,7 +462,7 @@ fn heuristic_codeblock<'a>( _ => true, }; - Ok(if is_translate { + let (groups, ctx) = if is_translate { ( vec![Group::Translate { events: events.into(), @@ -472,7 +472,8 @@ fn heuristic_codeblock<'a>( ) } else { (vec![Group::Skip(events.into())], ctx) - }) + }; + Ok((groups, ctx)) } /// Creates groups by parsing codeblock.