From d961e61f2b7371ff70f6adb0bc89b798989f44d4 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Thu, 21 Jan 2021 18:56:56 +0100 Subject: [PATCH] Revert "Make weekday labels localizable" This reverts commit 8e39ebb2f5d3a334dfea9e0e7c7cabf46d5e5414. --- ftl/core/statistics.ftl | 7 ------- ts/graphs/CalendarGraph.svelte | 2 +- ts/graphs/calendar.ts | 12 ++---------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/ftl/core/statistics.ftl b/ftl/core/statistics.ftl index 5c4353717..0b5fc5eb5 100644 --- a/ftl/core/statistics.ftl +++ b/ftl/core/statistics.ftl @@ -156,13 +156,6 @@ statistics-hours-subtitle = Review success rate for each hour of the day. # shown when graph is empty statistics-no-data = NO DATA statistics-calendar-title = Calendar -statistics-calendar-label-sunday = S -statistics-calendar-label-monday = M -statistics-calendar-label-tuesday = T -statistics-calendar-label-wednesday = W -statistics-calendar-label-thursday = T -statistics-calendar-label-friday = F -statistics-calendar-label-saturday = S ## An amount of elapsed time, used in the graphs to show the amount of ## time spent studying. For example, English would show "5s" for 5 seconds, diff --git a/ts/graphs/CalendarGraph.svelte b/ts/graphs/CalendarGraph.svelte index 910ed6565..c11606c09 100644 --- a/ts/graphs/CalendarGraph.svelte +++ b/ts/graphs/CalendarGraph.svelte @@ -25,7 +25,7 @@ let targetYear = maxYear; $: if (sourceData) { - graphData = gatherData(sourceData, i18n); + graphData = gatherData(sourceData); } $: { diff --git a/ts/graphs/calendar.ts b/ts/graphs/calendar.ts index 4c70ab012..c8823fe0b 100644 --- a/ts/graphs/calendar.ts +++ b/ts/graphs/calendar.ts @@ -41,7 +41,7 @@ interface DayDatum { date: Date; } -export function gatherData(data: pb.BackendProto.GraphsOut, i18n: I18n): GraphData { +export function gatherData(data: pb.BackendProto.GraphsOut): GraphData { const reviewCount = new Map(); for (const review of data.revlog as pb.BackendProto.RevlogEntry[]) { @@ -64,15 +64,7 @@ export function gatherData(data: pb.BackendProto.GraphsOut, i18n: I18n): GraphDa ? timeSaturday : timeSunday; - const weekdayLabels = [ - i18n.tr(i18n.TR.STATISTICS_CALENDAR_LABEL_SUNDAY), - i18n.tr(i18n.TR.STATISTICS_CALENDAR_LABEL_MONDAY), - i18n.tr(i18n.TR.STATISTICS_CALENDAR_LABEL_TUESDAY), - i18n.tr(i18n.TR.STATISTICS_CALENDAR_LABEL_WEDNESDAY), - i18n.tr(i18n.TR.STATISTICS_CALENDAR_LABEL_THURSDAY), - i18n.tr(i18n.TR.STATISTICS_CALENDAR_LABEL_FRIDAY), - i18n.tr(i18n.TR.STATISTICS_CALENDAR_LABEL_SATURDAY), - ]; + const weekdayLabels = ["S", "M", "T", "W", "T", "F", "S"]; for (let i = 0; i < data.firstWeekday; i++) { const shifted = weekdayLabels.shift() as string;