Counts read in the singular for one thing; parts build two-count messages (R2.11)
This commit is contained in:
22 files changed
+130
-49
No files matched your search
@@ -24,17 +24,18 @@ impl Docs {
|
||||
let Some(counts) = self.active_tab().and_then(|tab| tab.extra.counts) else {
|
||||
return status.when_some(zoom, |status, zoom| status.right(zoom));
|
||||
};
|
||||
let (words, characters) = (counts.words.to_string(), counts.characters.to_string());
|
||||
let count = |key, n: u64| ely_ui::i18n::counted(cx, key, n, &[("n", &n.to_string())]);
|
||||
let label = match counts.selected_words {
|
||||
0 => Self::text(
|
||||
cx,
|
||||
"doc.count.words",
|
||||
&[("words", &words), ("characters", &characters)],
|
||||
),
|
||||
selected => Self::text(
|
||||
0 => {
|
||||
let words = count("doc.count.word", counts.words);
|
||||
let characters = count("doc.count.character", counts.characters);
|
||||
Self::text(cx, "doc.count.words", &[("words", &words), ("characters", &characters)])
|
||||
}
|
||||
selected => ely_ui::i18n::counted(
|
||||
cx,
|
||||
"doc.count.selected",
|
||||
&[("selected", &selected.to_string()), ("words", &words)],
|
||||
counts.words,
|
||||
&[("selected", &selected.to_string()), ("words", &counts.words.to_string())],
|
||||
),
|
||||
};
|
||||
status.right(StatusBarItem::new("doc-count").label(label)).when_some(zoom, |status, zoom| status.right(zoom))
|
||||
|
||||
@@ -260,9 +260,8 @@ impl Docs {
|
||||
let folder = folder.display().to_string();
|
||||
let text = match written {
|
||||
Ok(count) => {
|
||||
let count = count.to_string();
|
||||
let text =
|
||||
Docs::text(cx, "doc.merge.done", &[("n", &count), ("folder", &folder)]);
|
||||
let n = count.to_string();
|
||||
let text = ely_ui::i18n::counted(cx, "doc.merge.done", count as u64, &[("n", &n), ("folder", &folder)]);
|
||||
return docs.toast(text, Severity::Success, cx);
|
||||
}
|
||||
Err((n, error)) => Docs::text(
|
||||
|
||||
Reference in new issue
Block a user