i18n error shown when attempting to rebuild normal deck
This commit is contained in:
parent
ac1b9fadde
commit
f55fe6e518
@ -2,3 +2,4 @@ errors-invalid-input-empty = Invalid input.
|
||||
errors-invalid-input-details = Invalid input: { $details }
|
||||
errors-parse-number-fail = A number was invalid or out of range.
|
||||
errors-filtered-parent-deck = Filtered decks can not have child decks.
|
||||
errors-filtered-deck-required = This action can only be used on a filtered deck.
|
||||
|
@ -107,7 +107,7 @@ impl Deck {
|
||||
if let DeckKind::Filtered(filtered) = &self.kind {
|
||||
Ok(filtered)
|
||||
} else {
|
||||
Err(AnkiError::invalid_input("deck not filtered"))
|
||||
Err(FilteredDeckError::FilteredDeckRequired.into())
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ impl Deck {
|
||||
if let DeckKind::Filtered(filtered) = &mut self.kind {
|
||||
Ok(filtered)
|
||||
} else {
|
||||
Err(AnkiError::invalid_input("deck not filtered"))
|
||||
Err(FilteredDeckError::FilteredDeckRequired.into())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ pub enum FilteredDeckError {
|
||||
MustBeLeafNode,
|
||||
CanNotMoveCardsInto,
|
||||
SearchReturnedNoCards,
|
||||
FilteredDeckRequired,
|
||||
}
|
||||
|
||||
impl FilteredDeckError {
|
||||
@ -20,6 +21,7 @@ impl FilteredDeckError {
|
||||
tr.browsing_cards_cant_be_manually_moved_into()
|
||||
}
|
||||
FilteredDeckError::SearchReturnedNoCards => tr.decks_filtered_deck_search_empty(),
|
||||
FilteredDeckError::FilteredDeckRequired => tr.errors_filtered_deck_required(),
|
||||
}
|
||||
.into()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user