Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cip999 committed Dec 18, 2024
1 parent 80dab63 commit 9a72a91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion i18n-helpers/src/gettext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn translate(text: &str, catalog: &Catalog) -> anyhow::Result<String> {
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(),
Expand Down
5 changes: 3 additions & 2 deletions i18n-helpers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -472,7 +472,8 @@ fn heuristic_codeblock<'a>(
)
} else {
(vec![Group::Skip(events.into())], ctx)
})
};
Ok((groups, ctx))
}

/// Creates groups by parsing codeblock.
Expand Down

0 comments on commit 9a72a91

Please sign in to comment.