i18n deckoptions; move some options into separate 'advanced' section

This commit is contained in:
Damien Elmes 2021-04-26 23:34:33 +10:00
parent 5c4434312f
commit a639048a6b
13 changed files with 333 additions and 177 deletions

View File

@ -1,3 +1,5 @@
### Text shown on the "Deck Options" screen
# Used in the deck configuration screen to show how many decks are used
# by a particular configuration group, eg "Group1 (used by 3 decks)"
deck-config-used-by-decks =
@ -6,9 +8,131 @@ deck-config-used-by-decks =
*[other] { $decks } decks
}
deck-config-default-name = Default
deck-config-title = Deck Options
## Daily limits section
deck-config-daily-limits = Daily Limits
deck-config-new-limit-tooltip =
The maximum number of new cards to introduce in a day, if new cards are available.
Because new material will increase your short-term review workload, this should typically
be at least 10x smaller than your review limit.
deck-config-review-limit-tooltip =
The maximum number of review cards to show in a day,
if cards are ready for review.
## New Cards section
deck-config-learning-steps = Learning steps
# Please don't translate '5m' or '2d'
-deck-config-delay-hint = Delays can be in minutes (eg "5m"), or days (eg "2d").
deck-config-learning-steps-tooltip =
One or more delays, separated by spaces. The first delay will be used
when you press the Again button on a new card, and is 1 minute by default.
The Good button will advance to the next step, which is 10 minutes by default.
Once all steps have been passed, the card will become a review card, and
will appear on a different day. { -deck-config-delay-hint }
deck-config-graduating-interval-tooltip =
The number of days to wait before showing a card again, after the Good button
is pressed on the final learning step.
deck-config-easy-interval-tooltip =
The number of days to wait before showing a card again, after the Easy button
is used to immediately remove a card from learning.
## Lapses section
deck-config-relearning-steps = Relearning steps
deck-config-relearning-steps-tooltip =
Zero or more delays, separated by spaces. By default, pressing the Again
button on a review card will show it again 10 minutes later. If no delays
are provided, the card will have its interval changed, without entering
relearning. { -deck-config-delay-hint }
deck-config-leech-threshold-tooltip =
The number of times Again needs to be pressed on a review card before it is
marked as a leech. Leeches are cards that consume a lot of your time, and
when a card is marked as a leech, it's a good idea to rewrite it, delete it, or
think of a mnemonic to help you remember it.
# See actions-suspend-card and scheduling-tag-only for the wording
deck-config-leech-action-tooltip =
<b>Tag Only</b>: Add a "leech" tag to the note, and display a pop-up.<br>
<b>Suspend Card</b>: In addition to tagging the note, hide the card until it is
manually unsuspended.
## Burying section
deck-config-burying-title = Burying
deck-config-bury-tooltip =
Whether other cards of the same note (eg reverse cards, adjacent
cloze deletions) will be delayed until the next day.
## Timer section
deck-config-timer-title = Timer
deck-config-maximum-answer-secs = Maximum answer seconds
deck-config-maximum-answer-secs-tooltip =
The maximum number of seconds to record for a single review. If an answer
exceeds this time (because you stepped away from the screen for example),
the time taken will be recorded as the limit you have set.
deck-config-show-answer-timer-tooltip =
In the review screen, show a timer that counts the number of seconds you're
taking to review each card.
## Audio section
deck-config-audio-title = Audio
deck-config-disable-autoplay = Don't play audio automatically
deck-config-always-include-question-audio-tooltip =
Whether the question audio should be included when the Replay action is
used while looking at the answer side of a card.
## Advanced section
deck-config-advanced-title = Advanced
deck-config-maximum-interval-tooltip =
The maximum number of days a review card will wait. When reviews have
reached the limit, Hard, Good and Easy will all give the same delay.
The shorter you set this, the greater your workload will be.
deck-config-starting-ease-tooltip =
The ease multiplier new cards start with. By default, the Good button on a
newly-learnt card will delay the next review by 2.5x the previous delay.
deck-config-easy-bonus-tooltip =
An extra multiplier that is applied to a review card's interval when you rate
it Easy.
deck-config-interval-modifier-tooltip =
This multiplier is applied to all reviews, and minor adjustments can be used
to make Anki more conservative or aggressive in its scheduling. Please see
the manual before changing this option.
deck-config-hard-interval-tooltip = The multiplier applied to a review interval when answering Hard.
deck-config-new-interval-tooltip = The multiplier applied to a review interval when answering Again.
deck-config-minimum-interval-tooltip = The minimum interval given to a review card after answering Again.
## Adding/renaming
deck-config-add-group = Add Group
deck-config-name-prompt = Name:
deck-config-rename-group = Rename Group
## Removing
deck-config-remove-group = Remove Group
deck-config-confirm-normal = Remove { $name }?
-deck-config-will-require-full-sync = This will require a one-way sync.
# You don't need to translate this
deck-config-confirm-full =
{ deck-config-confirm-normal }
{ -deck-config-will-require-full-sync }
## Other Buttons
deck-config-save-button = Save
deck-config-save-to-all-children = Save to All Children
deck-config-revert-button-tooltip = Restore this setting to its default value.
## These strings are shown via the Description button at the bottom of the
## overview screen.
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

View File

@ -0,0 +1,76 @@
<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import * as tr from "lib/i18n";
import SpinBox from "./SpinBox.svelte";
import SpinBoxFloat from "./SpinBoxFloat.svelte";
import type { DeckOptionsState } from "./lib";
export let state: DeckOptionsState;
let config = state.currentConfig;
let defaults = state.defaults;
</script>
<h2>{tr.deckConfigAdvancedTitle()}</h2>
<SpinBox
label={tr.schedulingMaximumInterval()}
tooltip={tr.deckConfigMaximumIntervalTooltip()}
min={1}
max={365 * 100}
defaultValue={defaults.maximumReviewInterval}
bind:value={$config.maximumReviewInterval} />
<SpinBoxFloat
label={tr.schedulingStartingEase()}
tooltip={tr.deckConfigStartingEaseTooltip()}
min={1.31}
max={5}
defaultValue={defaults.initialEase}
value={$config.initialEase}
on:changed={(evt) => ($config.initialEase = evt.detail.value)} />
<SpinBoxFloat
label={tr.schedulingEasyBonus()}
tooltip={tr.deckConfigEasyBonusTooltip()}
min={1}
max={3}
defaultValue={defaults.easyMultiplier}
value={$config.easyMultiplier}
on:changed={(evt) => ($config.easyMultiplier = evt.detail.value)} />
<SpinBoxFloat
label={tr.schedulingIntervalModifier()}
tooltip={tr.deckConfigIntervalModifierTooltip()}
min={0.5}
max={2}
defaultValue={defaults.intervalMultiplier}
value={$config.intervalMultiplier}
on:changed={(evt) => ($config.intervalMultiplier = evt.detail.value)} />
<SpinBoxFloat
label={tr.schedulingHardInterval()}
tooltip={tr.deckConfigHardIntervalTooltip()}
min={0.5}
max={1.3}
defaultValue={defaults.hardMultiplier}
value={$config.hardMultiplier}
on:changed={(evt) => ($config.hardMultiplier = evt.detail.value)} />
<SpinBoxFloat
label={tr.schedulingNewInterval()}
tooltip={tr.deckConfigNewIntervalTooltip()}
min={0}
max={1}
defaultValue={defaults.lapseMultiplier}
value={$config.lapseMultiplier}
on:changed={(evt) => ($config.lapseMultiplier = evt.detail.value)} />
<SpinBox
label={tr.schedulingMinimumInterval()}
tooltip={tr.deckConfigMinimumIntervalTooltip()}
min={1}
defaultValue={defaults.minimumLapseInterval}
bind:value={$config.minimumLapseInterval} />

View File

@ -0,0 +1,27 @@
<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import * as tr from "lib/i18n";
import CheckBox from "./CheckBox.svelte";
import type { DeckOptionsState } from "./lib";
export let state: DeckOptionsState;
let config = state.currentConfig;
let defaults = state.defaults;
</script>
<h2>{tr.deckConfigBuryingTitle()}</h2>
<CheckBox
label={tr.schedulingBuryRelatedNewCardsUntilThe()}
tooltip={tr.deckConfigBuryTooltip()}
defaultValue={defaults.buryNew}
bind:value={$config.buryNew} />
<CheckBox
label={tr.schedulingBuryRelatedReviewsUntilTheNext()}
tooltip={tr.deckConfigBuryTooltip()}
defaultValue={defaults.buryReviews}
bind:value={$config.buryReviews} />

View File

@ -4,11 +4,19 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import ConfigEntry from "./ConfigEntry.svelte";
import HelpPopup from "./HelpPopup.svelte";
export let label: string;
export let value: boolean;
export let defaultValue: boolean;
export let tooltip = "";
export let id: string | undefined = undefined;
</script>
<ConfigEntry label="" wholeLine={true} bind:value {defaultValue}>
<div><label> <input type="checkbox" bind:checked={value} /> {label} </label></div>
<ConfigEntry {id} label="" wholeLine={true} bind:value {defaultValue}>
<div>
<label> <input type="checkbox" bind:checked={value} /> {label} </label>
{#if tooltip}
<HelpPopup html={tooltip} />
{/if}
</div>
</ConfigEntry>

View File

@ -5,7 +5,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<script lang="ts">
import DailyLimits from "./DailyLimits.svelte";
import NewOptions from "./NewOptions.svelte";
import ReviewOptions from "./ReviewOptions.svelte";
import BuryingOptions from "./BuryingOptions.svelte";
import AdvancedOptions from "./AdvancedOptions.svelte";
import LapseOptions from "./LapseOptions.svelte";
import GeneralOptions from "./GeneralOptions.svelte";
import Addons from "./Addons.svelte";
@ -27,8 +28,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<div>
<DailyLimits {state} />
<NewOptions {state} />
<ReviewOptions {state} />
<LapseOptions {state} />
<BuryingOptions {state} />
<GeneralOptions {state} />
<Addons {state} />
<AdvancedOptions {state} />
</div>

View File

@ -14,6 +14,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
/// empty strings will be ignored
export let warnings: string[] = [];
export let wholeLine = false;
export let id: string | undefined = undefined;
</script>
<style lang="scss">
@ -53,7 +54,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
}
</style>
<div class="outer">
<div {id} class="outer">
{#if label}
<div class="table">
<span class="vcenter">

View File

@ -17,12 +17,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
? tr.deckConfigDailyLimitWillBeCapped({ cards: $parentLimits.newCards })
: "";
// with the v2 scheduler, this no longer applies
// $: reviewsGreaterThanParent =
// $config.reviewsPerDay > $parentLimits.reviews
// ? `Daily limit will be capped to parent limit of ${$parentLimits.reviews}.`
// : "";
$: reviewsTooLow =
Math.min(9999, $config.newPerDay * 10) > $config.reviewsPerDay
? tr.deckConfigReviewsTooLow({
@ -32,22 +26,20 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
: "";
</script>
<div>
<h2>Daily Limits</h2>
<h2>{tr.deckConfigDailyLimits()}</h2>
<SpinBox
label={tr.schedulingNewCardsday()}
tooltip="The maximum number of new cards to introduce in a day."
min={0}
warnings={[newCardsGreaterThanParent]}
defaultValue={defaults.newPerDay}
bind:value={$config.newPerDay} />
<SpinBox
label={tr.schedulingNewCardsday()}
tooltip={tr.deckConfigNewLimitTooltip()}
min={0}
warnings={[newCardsGreaterThanParent]}
defaultValue={defaults.newPerDay}
bind:value={$config.newPerDay} />
<SpinBox
label={tr.schedulingMaximumReviewsday()}
tooltip="The maximum number of reviews cards to show in a day."
min={0}
warnings={[reviewsTooLow]}
defaultValue={defaults.reviewsPerDay}
bind:value={$config.reviewsPerDay} />
</div>
<SpinBox
label={tr.schedulingMaximumReviewsday()}
tooltip={tr.deckConfigReviewLimitTooltip()}
min={0}
warnings={[reviewsTooLow]}
defaultValue={defaults.reviewsPerDay}
bind:value={$config.reviewsPerDay} />

View File

@ -6,10 +6,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import ConfigEntry from "./ConfigEntry.svelte";
export let label: string;
export let tooltip: string;
export let choices: string[];
export let value: number = 0;
export let defaultValue: number;
export let tooltip = "";
</script>
<ConfigEntry {label} {tooltip} wholeLine={true} bind:value {defaultValue}>

View File

@ -13,29 +13,32 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
let defaults = state.defaults;
</script>
<div>
<h2>General</h2>
<h2>{tr.deckConfigTimerTitle()}</h2>
<SpinBox
label={tr.schedulingIgnoreAnswerTimesLongerThan()}
tooltip="The maximum number of seconds to record for a single review."
min={30}
max={600}
defaultValue={defaults.capAnswerTimeToSecs}
bind:value={$config.capAnswerTimeToSecs} />
<SpinBox
label={tr.deckConfigMaximumAnswerSecs()}
tooltip={tr.deckConfigMaximumAnswerSecsTooltip()}
min={30}
max={600}
defaultValue={defaults.capAnswerTimeToSecs}
bind:value={$config.capAnswerTimeToSecs} />
<CheckBox
label={tr.schedulingShowAnswerTimer()}
defaultValue={defaults.showTimer}
bind:value={$config.showTimer} />
<CheckBox
id="showAnswerTimer"
label={tr.schedulingShowAnswerTimer()}
tooltip={tr.deckConfigShowAnswerTimerTooltip()}
defaultValue={defaults.showTimer}
bind:value={$config.showTimer} />
<CheckBox
label="Don't play audio automatically"
defaultValue={defaults.disableAutoplay}
bind:value={$config.disableAutoplay} />
<h2>{tr.deckConfigAudioTitle()}</h2>
<CheckBox
label={tr.schedulingAlwaysIncludeQuestionSideWhenReplaying()}
defaultValue={defaults.skipQuestionWhenReplayingAnswer}
bind:value={$config.skipQuestionWhenReplayingAnswer} />
</div>
<CheckBox
label={tr.deckConfigDisableAutoplay()}
defaultValue={defaults.disableAutoplay}
bind:value={$config.disableAutoplay} />
<CheckBox
label={tr.schedulingAlwaysIncludeQuestionSideWhenReplaying()}
tooltip={tr.deckConfigAlwaysIncludeQuestionAudioTooltip()}
defaultValue={defaults.skipQuestionWhenReplayingAnswer}
bind:value={$config.skipQuestionWhenReplayingAnswer} />

View File

@ -5,7 +5,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<script lang="ts">
import * as tr from "lib/i18n";
import SpinBox from "./SpinBox.svelte";
import SpinBoxFloat from "./SpinBoxFloat.svelte";
import StepsInput from "./StepsInput.svelte";
import EnumSelector from "./EnumSelector.svelte";
import type { DeckOptionsState } from "./lib";
@ -18,41 +17,25 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</script>
<div>
<h2>Lapses</h2>
<h2>{tr.schedulingLapses()}</h2>
<StepsInput
label="Relearning steps"
tooltip="Relearning steps, separated by spaces."
label={tr.deckConfigRelearningSteps()}
tooltip={tr.deckConfigRelearningStepsTooltip()}
defaultValue={defaults.relearnSteps}
value={$config.relearnSteps}
on:changed={(evt) => ($config.relearnSteps = evt.detail.value)} />
<SpinBoxFloat
label={tr.schedulingNewInterval()}
tooltip="The multiplier applied to review cards when answering Again."
min={0}
max={1}
defaultValue={defaults.lapseMultiplier}
value={$config.lapseMultiplier}
on:changed={(evt) => ($config.lapseMultiplier = evt.detail.value)} />
<SpinBox
label={tr.schedulingMinimumInterval()}
tooltip="The minimum new interval a lapsed card will be given after relearning."
min={1}
defaultValue={defaults.minimumLapseInterval}
bind:value={$config.minimumLapseInterval} />
<SpinBox
label={tr.schedulingLeechThreshold()}
tooltip="Number of times Again needs to be pressed on a review card to make it a leech."
tooltip={tr.deckConfigLeechThresholdTooltip()}
min={1}
defaultValue={defaults.leechThreshold}
bind:value={$config.leechThreshold} />
<EnumSelector
label={tr.schedulingLeechAction()}
tooltip=""
tooltip={tr.deckConfigLeechActionTooltip()}
choices={leechChoices}
defaultValue={defaults.leechAction}
bind:value={$config.leechAction} />

View File

@ -5,8 +5,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<script lang="ts">
import * as tr from "lib/i18n";
import SpinBox from "./SpinBox.svelte";
import SpinBoxFloat from "./SpinBoxFloat.svelte";
import CheckBox from "./CheckBox.svelte";
import StepsInput from "./StepsInput.svelte";
import EnumSelector from "./EnumSelector.svelte";
import type { DeckOptionsState } from "./lib";
@ -37,48 +35,31 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
: "";
</script>
<div>
<h2>New Cards</h2>
<h2>{tr.schedulingNewCards()}</h2>
<StepsInput
label="Learning steps"
tooltip="Learning steps, separated by spaces."
defaultValue={defaults.learnSteps}
value={$config.learnSteps}
on:changed={(evt) => ($config.learnSteps = evt.detail.value)} />
<StepsInput
label={tr.deckConfigLearningSteps()}
tooltip={tr.deckConfigLearningStepsTooltip()}
defaultValue={defaults.learnSteps}
value={$config.learnSteps}
on:changed={(evt) => ($config.learnSteps = evt.detail.value)} />
<EnumSelector
label={tr.schedulingOrder()}
tooltip=""
choices={newOrderChoices}
defaultValue={defaults.newCardOrder}
bind:value={$config.newCardOrder} />
<SpinBox
label={tr.schedulingGraduatingInterval()}
tooltip={tr.deckConfigGraduatingIntervalTooltip()}
warnings={[stepsExceedGraduatingInterval]}
defaultValue={defaults.graduatingIntervalGood}
bind:value={$config.graduatingIntervalGood} />
<SpinBox
label={tr.schedulingGraduatingInterval()}
tooltip="Days to wait after answering Good on the last learning step."
warnings={[stepsExceedGraduatingInterval]}
defaultValue={defaults.graduatingIntervalGood}
bind:value={$config.graduatingIntervalGood} />
<SpinBox
label={tr.schedulingEasyInterval()}
tooltip={tr.deckConfigEasyIntervalTooltip()}
warnings={[goodExceedsEasy]}
defaultValue={defaults.graduatingIntervalEasy}
bind:value={$config.graduatingIntervalEasy} />
<SpinBox
label={tr.schedulingEasyInterval()}
tooltip="Days to wait after answering Easy on the first learning step."
warnings={[goodExceedsEasy]}
defaultValue={defaults.graduatingIntervalEasy}
bind:value={$config.graduatingIntervalEasy} />
<SpinBoxFloat
label={tr.schedulingStartingEase()}
tooltip="The default multiplier when a review is answered Good."
min={1.31}
max={5}
defaultValue={defaults.initialEase}
value={$config.initialEase}
on:changed={(evt) => ($config.initialEase = evt.detail.value)} />
<CheckBox
label={tr.schedulingBuryRelatedNewCardsUntilThe()}
defaultValue={defaults.buryNew}
bind:value={$config.buryNew} />
</div>
<EnumSelector
label={tr.schedulingOrder()}
choices={newOrderChoices}
defaultValue={defaults.newCardOrder}
bind:value={$config.newCardOrder} />

View File

@ -3,9 +3,23 @@ Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import * as tr from "lib/i18n";
import { revertIcon } from "./icons";
import { createEventDispatcher } from "svelte";
import { isEqual, cloneDeep } from "lodash-es";
// import { onMount } from "svelte";
// import Tooltip from "bootstrap/js/dist/tooltip";
let ref: HTMLDivElement;
// fixme: figure out why this breaks halfway down the page
// onMount(() => {
// new Tooltip(ref, {
// placement: "bottom",
// html: true,
// offset: [0, 20],
// });
// });
export let value: any;
export let defaultValue: any;
@ -35,7 +49,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</style>
{#if modified}
<div class="img-div" on:click={revert}>
<div
class="img-div"
on:click={revert}
bind:this={ref}
title={tr.deckConfigRevertButtonTooltip()}>
{@html revertIcon}
</div>
{/if}

View File

@ -1,59 +0,0 @@
<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import * as tr from "lib/i18n";
import SpinBox from "./SpinBox.svelte";
import SpinBoxFloat from "./SpinBoxFloat.svelte";
import CheckBox from "./CheckBox.svelte";
import type { DeckOptionsState } from "./lib";
export let state: DeckOptionsState;
let config = state.currentConfig;
let defaults = state.defaults;
</script>
<div>
<h2>Reviews</h2>
<SpinBoxFloat
label={tr.schedulingEasyBonus()}
tooltip="Extra multiplier applied when answering Easy on a review card."
min={1}
max={3}
defaultValue={defaults.easyMultiplier}
value={$config.easyMultiplier}
on:changed={(evt) => ($config.easyMultiplier = evt.detail.value)} />
<SpinBoxFloat
label={tr.schedulingIntervalModifier()}
tooltip="Multiplier applied to all reviews."
min={0.5}
max={2}
defaultValue={defaults.intervalMultiplier}
value={$config.intervalMultiplier}
on:changed={(evt) => ($config.intervalMultiplier = evt.detail.value)} />
<SpinBox
label={tr.schedulingMaximumInterval()}
tooltip="The longest number of days a review card will wait."
min={1}
max={365 * 100}
defaultValue={defaults.maximumReviewInterval}
bind:value={$config.maximumReviewInterval} />
<SpinBoxFloat
label={tr.schedulingHardInterval()}
tooltip="Multiplier applied to review interval when Hard is pressed."
min={0.5}
max={1.3}
defaultValue={defaults.hardMultiplier}
value={$config.hardMultiplier}
on:changed={(evt) => ($config.hardMultiplier = evt.detail.value)} />
<CheckBox
label={tr.schedulingBuryRelatedReviewsUntilTheNext()}
defaultValue={defaults.buryReviews}
bind:value={$config.buryReviews} />
</div>