From 41b296e96c1ff83f9f26d38d40f18a6776a11145 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 28 Jun 2020 19:34:19 +1000 Subject: [PATCH] i18n some tooltips --- rslib/ftl/statistics.ftl | 21 ++++++++++++ ts/src/i18n.ts | 3 +- ts/src/stats/FutureDue.svelte | 10 ++++-- ts/src/stats/ReviewsGraph.svelte | 3 +- ts/src/stats/future-due.ts | 46 +++++++++++++++---------- ts/src/stats/reviews.ts | 59 ++++++++++++++++++++++++++------ ts/src/time.ts | 23 +++++++++++++ 7 files changed, 131 insertions(+), 34 deletions(-) diff --git a/rslib/ftl/statistics.ftl b/rslib/ftl/statistics.ftl index 0b952488e..aee1109a5 100644 --- a/rslib/ftl/statistics.ftl +++ b/rslib/ftl/statistics.ftl @@ -83,6 +83,9 @@ statistics-counts-young-cards = Young statistics-counts-mature-cards = Mature statistics-counts-suspended-cards = Suspended statistics-counts-buried-cards = Buried +statistics-counts-early-cards = Early +statistics-counts-learning-cards = Learning +statistics-counts-relearning-cards = Relearning statistics-counts-title = Card Counts statistics-range-all-time = deck life statistics-range-deck = deck @@ -102,3 +105,21 @@ statistics-reviews-time-subtitle = The time taken to answer the questions. statistics-intervals-subtitle = Delays until reviews are shown again. statistics-answer-buttons-subtitle = The number of times you have pressed each button. statistics-hours-subtitle = Review success rate for each hour of the day. +statistics-reviews-time-checkbox = Time +statistics-in-days-single = { $days -> + [0] Today + [1] Tomorrow + *[other] In { $days } days + } +statistics-in-days-range = In { $daysStart }~{ $daysEnd } days +statistics-days-ago-single = { $days -> + [1] Yesterday + *[other] { $days } days ago + } +statistics-days-ago-range = { $daysStart }~{ $daysEnd } days ago +statistics-running-total = Running total +statistics-cards-due = { $cards -> + [one] 1 card due + *[other] { $cards } cards due + } +statistics-backlog-checkbox = Backlog diff --git a/ts/src/i18n.ts b/ts/src/i18n.ts index 78c36ccf6..30656bcd6 100644 --- a/ts/src/i18n.ts +++ b/ts/src/i18n.ts @@ -10,11 +10,10 @@ function formatNumbers(args?: Record): void { if (!args) { return; } - for (const key of Object.keys(args)) { if (typeof args[key] === "number") { args[key] = new FluentNumber(args[key] as number, { - maximumSignificantDigits: 2, + maximumFractionDigits: 2, }); } } diff --git a/ts/src/stats/FutureDue.svelte b/ts/src/stats/FutureDue.svelte index c0f32d67e..79cb24937 100644 --- a/ts/src/stats/FutureDue.svelte +++ b/ts/src/stats/FutureDue.svelte @@ -18,7 +18,7 @@ let graphData = null as GraphData | null; let histogramData = null as HistogramData | null; - + let backlog: boolean = true; let svg = null as HTMLElement | SVGElement | null; let range = FutureDueRange.Month; @@ -27,7 +27,7 @@ } $: if (graphData) { - histogramData = buildHistogram(graphData, range); + histogramData = buildHistogram(graphData, range, backlog, i18n); } const title = i18n.tr(i18n.TR.STATISTICS_FUTURE_DUE_TITLE); @@ -36,6 +36,7 @@ const year = timeSpan(i18n, 1 * YEAR); const all = i18n.tr(i18n.TR.STATISTICS_RANGE_ALL_TIME); const subtitle = i18n.tr(i18n.TR.STATISTICS_FUTURE_DUE_SUBTITLE); + const backlogLabel = i18n.tr(i18n.TR.STATISTICS_BACKLOG_CHECKBOX); {#if histogramData} @@ -44,6 +45,11 @@

{title}

+ +