From 09629e4e4adc6167e1d4c7342849f79cce9efa83 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 25 Apr 2021 23:03:23 +1000 Subject: [PATCH] add translations for deck option warnings + cap maximum recommended review limit to 9999, since we don't allow the user to set it higher --- ftl/core/deck-config.ftl | 15 +++++++++++++++ ts/deckoptions/DailyLimits.svelte | 13 ++++++------- ts/deckoptions/NewOptions.svelte | 4 ++-- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index f7bfbb196..40aff1614 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -9,3 +9,18 @@ deck-config-default-name = Default deck-config-description-markdown = Enable markdown+clean HTML deck-config-description-markdown-hint = Will appear as text on Anki 2.1.40 and below. deck-config-title = Deck Options + +## Warnings shown to the user + +deck-config-daily-limit-will-be-capped = + A parent deck has a limit of { $cards -> + [one] { $cards } card + *[other] { $cards } cards + }, which will override this limit. +deck-config-reviews-too-low = + If adding { $cards -> + [one] { $cards } new card each day + *[other] { $cards } new cards each day + }, your review limit should be at least { $expected }. +deck-config-learning-step-above-graduating-interval = The graduating interval should be at least as long as your final learning step. +deck-config-good-above-easy = The easy interval should be at least as long as the graduating interval. diff --git a/ts/deckoptions/DailyLimits.svelte b/ts/deckoptions/DailyLimits.svelte index 3116d5b12..0a470eb9f 100644 --- a/ts/deckoptions/DailyLimits.svelte +++ b/ts/deckoptions/DailyLimits.svelte @@ -14,7 +14,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html $: newCardsGreaterThanParent = $config.newPerDay > $parentLimits.newCards - ? `Daily limit will be capped to parent limit of ${$parentLimits.newCards}.` + ? tr.deckConfigDailyLimitWillBeCapped({ cards: $parentLimits.newCards }) : ""; // with the v2 scheduler, this no longer applies @@ -24,12 +24,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html // : ""; $: reviewsTooLow = - $config.newPerDay * 10 > $config.reviewsPerDay - ? `If adding ${ - $config.newPerDay - } new cards each day, your review limit should be at least ${ - $config.newPerDay * 10 - }` + Math.min(9999, $config.newPerDay * 10) > $config.reviewsPerDay + ? tr.deckConfigReviewsTooLow({ + cards: $config.newPerDay, + expected: Math.min(9999, $config.newPerDay * 10), + }) : ""; diff --git a/ts/deckoptions/NewOptions.svelte b/ts/deckoptions/NewOptions.svelte index 35e29148b..c2e9fc25d 100644 --- a/ts/deckoptions/NewOptions.svelte +++ b/ts/deckoptions/NewOptions.svelte @@ -27,13 +27,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html : 0; stepsExceedGraduatingInterval = lastLearnStepInDays > $config.graduatingIntervalGood - ? "Your last learning step is greater than the graduating interval." + ? tr.deckConfigLearningStepAboveGraduatingInterval() : ""; } $: goodExceedsEasy = $config.graduatingIntervalGood > $config.graduatingIntervalEasy - ? "The Good interval should not be larger than the Easy interval." + ? tr.deckConfigGoodAboveEasy() : "";