mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
update multi-arg TR references, where some needed reordering
This commit is contained in:
parent
698ae855d3
commit
c45ab78b73
4 changed files with 28 additions and 39 deletions
|
@ -119,14 +119,12 @@ pub(super) fn progress_to_proto(progress: Option<Progress>, i18n: &I18n) -> pb::
|
||||||
fn media_sync_progress(p: MediaSyncProgress, i18n: &I18n) -> pb::progress::MediaSync {
|
fn media_sync_progress(p: MediaSyncProgress, i18n: &I18n) -> pb::progress::MediaSync {
|
||||||
pb::progress::MediaSync {
|
pb::progress::MediaSync {
|
||||||
checked: i18n.sync_media_checked_count(p.checked).into(),
|
checked: i18n.sync_media_checked_count(p.checked).into(),
|
||||||
added: i18n.trn(
|
added: i18n
|
||||||
TR::SyncMediaAddedCount,
|
.sync_media_added_count(p.uploaded_files, p.downloaded_files)
|
||||||
tr_args!["up"=>p.uploaded_files,"down"=>p.downloaded_files],
|
.into(),
|
||||||
),
|
removed: i18n
|
||||||
removed: i18n.trn(
|
.sync_media_removed_count(p.uploaded_deletions, p.downloaded_deletions)
|
||||||
TR::SyncMediaRemovedCount,
|
.into(),
|
||||||
tr_args!["up"=>p.uploaded_deletions,"down"=>p.downloaded_deletions],
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,17 +142,11 @@ impl AnkiError {
|
||||||
i18n.search_unknown_escape(ctx.replace('`', "'")).into()
|
i18n.search_unknown_escape(ctx.replace('`', "'")).into()
|
||||||
}
|
}
|
||||||
SearchErrorKind::InvalidState(state) => i18n
|
SearchErrorKind::InvalidState(state) => i18n
|
||||||
.trn(
|
.search_invalid_argument("is:", state.replace('`', "'"))
|
||||||
TR::SearchInvalidArgument,
|
|
||||||
tr_strs!("term" => "is:", "argument" => state.replace('`', "'")),
|
|
||||||
)
|
|
||||||
.into(),
|
.into(),
|
||||||
SearchErrorKind::InvalidFlag => i18n.search_invalid_flag(),
|
SearchErrorKind::InvalidFlag => i18n.search_invalid_flag(),
|
||||||
SearchErrorKind::InvalidPropProperty(prop) => i18n
|
SearchErrorKind::InvalidPropProperty(prop) => i18n
|
||||||
.trn(
|
.search_invalid_argument("prop:", prop.replace('`', "'"))
|
||||||
TR::SearchInvalidArgument,
|
|
||||||
tr_strs!("term" => "prop:", "argument" => prop.replace('`', "'")),
|
|
||||||
)
|
|
||||||
.into(),
|
.into(),
|
||||||
SearchErrorKind::InvalidPropOperator(ctx) => {
|
SearchErrorKind::InvalidPropOperator(ctx) => {
|
||||||
i18n.search_invalid_prop_operator(ctx.as_str()).into()
|
i18n.search_invalid_prop_operator(ctx.as_str()).into()
|
||||||
|
@ -163,33 +157,33 @@ impl AnkiError {
|
||||||
SearchErrorKind::Other(Some(info)) => info.into(),
|
SearchErrorKind::Other(Some(info)) => info.into(),
|
||||||
SearchErrorKind::Other(None) => i18n.search_invalid_other(),
|
SearchErrorKind::Other(None) => i18n.search_invalid_other(),
|
||||||
SearchErrorKind::InvalidNumber { provided, context } => i18n
|
SearchErrorKind::InvalidNumber { provided, context } => i18n
|
||||||
.trn(
|
.search_invalid_number(
|
||||||
TR::SearchInvalidNumber,
|
context.replace('`', "'"),
|
||||||
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
provided.replace('`', "'"),
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
SearchErrorKind::InvalidWholeNumber { provided, context } => i18n
|
SearchErrorKind::InvalidWholeNumber { provided, context } => i18n
|
||||||
.trn(
|
.search_invalid_whole_number(
|
||||||
TR::SearchInvalidWholeNumber,
|
context.replace('`', "'"),
|
||||||
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
provided.replace('`', "'"),
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
SearchErrorKind::InvalidPositiveWholeNumber { provided, context } => i18n
|
SearchErrorKind::InvalidPositiveWholeNumber { provided, context } => i18n
|
||||||
.trn(
|
.search_invalid_positive_whole_number(
|
||||||
TR::SearchInvalidPositiveWholeNumber,
|
context.replace('`', "'"),
|
||||||
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
provided.replace('`', "'"),
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
SearchErrorKind::InvalidNegativeWholeNumber { provided, context } => i18n
|
SearchErrorKind::InvalidNegativeWholeNumber { provided, context } => i18n
|
||||||
.trn(
|
.search_invalid_negative_whole_number(
|
||||||
TR::SearchInvalidNegativeWholeNumber,
|
context.replace('`', "'"),
|
||||||
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
provided.replace('`', "'"),
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
SearchErrorKind::InvalidAnswerButton { provided, context } => i18n
|
SearchErrorKind::InvalidAnswerButton { provided, context } => i18n
|
||||||
.trn(
|
.search_invalid_answer_button(
|
||||||
TR::SearchInvalidAnswerButton,
|
context.replace('`', "'"),
|
||||||
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
provided.replace('`', "'"),
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
};
|
};
|
||||||
|
|
|
@ -94,10 +94,7 @@ where
|
||||||
// top summary area
|
// top summary area
|
||||||
if output.trash_count > 0 {
|
if output.trash_count > 0 {
|
||||||
let megs = (output.trash_bytes as f32) / 1024.0 / 1024.0;
|
let megs = (output.trash_bytes as f32) / 1024.0 / 1024.0;
|
||||||
buf += &i.trn(
|
buf += &i.media_check_trash_count(output.trash_count, megs);
|
||||||
TR::MediaCheckTrashCount,
|
|
||||||
tr_args!["count"=>output.trash_count, "megs"=>megs],
|
|
||||||
);
|
|
||||||
buf.push('\n');
|
buf.push('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +123,7 @@ where
|
||||||
buf += &i.media_check_renamed_header();
|
buf += &i.media_check_renamed_header();
|
||||||
buf.push('\n');
|
buf.push('\n');
|
||||||
for (old, new) in &output.renamed {
|
for (old, new) in &output.renamed {
|
||||||
buf += &i.trn(TR::MediaCheckRenamedFile, tr_strs!["old"=>old,"new"=>new]);
|
buf += &i.media_check_renamed_file(old.as_str(), new.as_str());
|
||||||
buf.push('\n');
|
buf.push('\n');
|
||||||
}
|
}
|
||||||
buf.push('\n')
|
buf.push('\n')
|
||||||
|
|
|
@ -264,9 +264,9 @@ fn template_error_to_anki_error(err: TemplateError, q_side: bool, i18n: &I18n) -
|
||||||
|
|
||||||
fn localized_template_error(i18n: &I18n, err: TemplateError) -> String {
|
fn localized_template_error(i18n: &I18n, err: TemplateError) -> String {
|
||||||
match err {
|
match err {
|
||||||
TemplateError::NoClosingBrackets(tag) => i18n.trn(
|
TemplateError::NoClosingBrackets(tag) => i18n
|
||||||
TR::CardTemplateRenderingNoClosingBrackets,
|
.card_template_rendering_no_closing_brackets("}}", tag)
|
||||||
tr_strs!("tag"=>tag, "missing"=>"}}"),
|
.into(),
|
||||||
TemplateError::ConditionalNotClosed(tag) => i18n
|
TemplateError::ConditionalNotClosed(tag) => i18n
|
||||||
.card_template_rendering_conditional_not_closed(format!("{{{{/{}}}}}", tag))
|
.card_template_rendering_conditional_not_closed(format!("{{{{/{}}}}}", tag))
|
||||||
.into(),
|
.into(),
|
||||||
|
|
Loading…
Reference in a new issue