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 {
|
||||
pb::progress::MediaSync {
|
||||
checked: i18n.sync_media_checked_count(p.checked).into(),
|
||||
added: i18n.trn(
|
||||
TR::SyncMediaAddedCount,
|
||||
tr_args!["up"=>p.uploaded_files,"down"=>p.downloaded_files],
|
||||
),
|
||||
removed: i18n.trn(
|
||||
TR::SyncMediaRemovedCount,
|
||||
tr_args!["up"=>p.uploaded_deletions,"down"=>p.downloaded_deletions],
|
||||
),
|
||||
added: i18n
|
||||
.sync_media_added_count(p.uploaded_files, p.downloaded_files)
|
||||
.into(),
|
||||
removed: i18n
|
||||
.sync_media_removed_count(p.uploaded_deletions, p.downloaded_deletions)
|
||||
.into(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -142,17 +142,11 @@ impl AnkiError {
|
|||
i18n.search_unknown_escape(ctx.replace('`', "'")).into()
|
||||
}
|
||||
SearchErrorKind::InvalidState(state) => i18n
|
||||
.trn(
|
||||
TR::SearchInvalidArgument,
|
||||
tr_strs!("term" => "is:", "argument" => state.replace('`', "'")),
|
||||
)
|
||||
.search_invalid_argument("is:", state.replace('`', "'"))
|
||||
.into(),
|
||||
SearchErrorKind::InvalidFlag => i18n.search_invalid_flag(),
|
||||
SearchErrorKind::InvalidPropProperty(prop) => i18n
|
||||
.trn(
|
||||
TR::SearchInvalidArgument,
|
||||
tr_strs!("term" => "prop:", "argument" => prop.replace('`', "'")),
|
||||
)
|
||||
.search_invalid_argument("prop:", prop.replace('`', "'"))
|
||||
.into(),
|
||||
SearchErrorKind::InvalidPropOperator(ctx) => {
|
||||
i18n.search_invalid_prop_operator(ctx.as_str()).into()
|
||||
|
@ -163,33 +157,33 @@ impl AnkiError {
|
|||
SearchErrorKind::Other(Some(info)) => info.into(),
|
||||
SearchErrorKind::Other(None) => i18n.search_invalid_other(),
|
||||
SearchErrorKind::InvalidNumber { provided, context } => i18n
|
||||
.trn(
|
||||
TR::SearchInvalidNumber,
|
||||
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
||||
.search_invalid_number(
|
||||
context.replace('`', "'"),
|
||||
provided.replace('`', "'"),
|
||||
)
|
||||
.into(),
|
||||
SearchErrorKind::InvalidWholeNumber { provided, context } => i18n
|
||||
.trn(
|
||||
TR::SearchInvalidWholeNumber,
|
||||
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
||||
.search_invalid_whole_number(
|
||||
context.replace('`', "'"),
|
||||
provided.replace('`', "'"),
|
||||
)
|
||||
.into(),
|
||||
SearchErrorKind::InvalidPositiveWholeNumber { provided, context } => i18n
|
||||
.trn(
|
||||
TR::SearchInvalidPositiveWholeNumber,
|
||||
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
||||
.search_invalid_positive_whole_number(
|
||||
context.replace('`', "'"),
|
||||
provided.replace('`', "'"),
|
||||
)
|
||||
.into(),
|
||||
SearchErrorKind::InvalidNegativeWholeNumber { provided, context } => i18n
|
||||
.trn(
|
||||
TR::SearchInvalidNegativeWholeNumber,
|
||||
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
||||
.search_invalid_negative_whole_number(
|
||||
context.replace('`', "'"),
|
||||
provided.replace('`', "'"),
|
||||
)
|
||||
.into(),
|
||||
SearchErrorKind::InvalidAnswerButton { provided, context } => i18n
|
||||
.trn(
|
||||
TR::SearchInvalidAnswerButton,
|
||||
tr_strs!["provided"=>provided.replace('`', "'"), "context"=>context.replace('`', "'")],
|
||||
.search_invalid_answer_button(
|
||||
context.replace('`', "'"),
|
||||
provided.replace('`', "'"),
|
||||
)
|
||||
.into(),
|
||||
};
|
||||
|
|
|
@ -94,10 +94,7 @@ where
|
|||
// top summary area
|
||||
if output.trash_count > 0 {
|
||||
let megs = (output.trash_bytes as f32) / 1024.0 / 1024.0;
|
||||
buf += &i.trn(
|
||||
TR::MediaCheckTrashCount,
|
||||
tr_args!["count"=>output.trash_count, "megs"=>megs],
|
||||
);
|
||||
buf += &i.media_check_trash_count(output.trash_count, megs);
|
||||
buf.push('\n');
|
||||
}
|
||||
|
||||
|
@ -126,7 +123,7 @@ where
|
|||
buf += &i.media_check_renamed_header();
|
||||
buf.push('\n');
|
||||
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')
|
||||
|
|
|
@ -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 {
|
||||
match err {
|
||||
TemplateError::NoClosingBrackets(tag) => i18n.trn(
|
||||
TR::CardTemplateRenderingNoClosingBrackets,
|
||||
tr_strs!("tag"=>tag, "missing"=>"}}"),
|
||||
TemplateError::NoClosingBrackets(tag) => i18n
|
||||
.card_template_rendering_no_closing_brackets("}}", tag)
|
||||
.into(),
|
||||
TemplateError::ConditionalNotClosed(tag) => i18n
|
||||
.card_template_rendering_conditional_not_closed(format!("{{{{/{}}}}}", tag))
|
||||
.into(),
|
||||
|
|
Loading…
Reference in a new issue