mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
i18n today section
This commit is contained in:
parent
41d77b0255
commit
01f3a71f0a
4 changed files with 99 additions and 95 deletions
|
@ -3,60 +3,57 @@ statistics-due-date = Due
|
||||||
# The count of cards waiting to be reviewed
|
# The count of cards waiting to be reviewed
|
||||||
statistics-due-count = Due
|
statistics-due-count = Due
|
||||||
# Shown in the Due column of the Browse screen when the card is a new card
|
# Shown in the Due column of the Browse screen when the card is a new card
|
||||||
statistics-due-for-new-card = New #{$number}
|
statistics-due-for-new-card = New #{ $number }
|
||||||
|
|
||||||
|
|
||||||
## eg 16.8s (3.6 cards/minute)
|
## eg 16.8s (3.6 cards/minute)
|
||||||
|
|
||||||
statistics-cards-per-min = {$cards-per-minute} cards/minute
|
statistics-cards-per-min = { $cards-per-minute } cards/minute
|
||||||
statistics-average-answer-time = {$average-seconds}s ({ statistics-cards-per-min })
|
statistics-average-answer-time = { $average-seconds }s ({ statistics-cards-per-min })
|
||||||
|
|
||||||
## A span of time studying took place in, for example
|
## A span of time studying took place in, for example
|
||||||
## "(studied 30 cards) in 3 minutes"
|
## "(studied 30 cards) in 3 minutes"
|
||||||
|
|
||||||
statistics-in-time-span-seconds = { $amount ->
|
statistics-in-time-span-seconds =
|
||||||
[one] in {$amount} second
|
{ $amount ->
|
||||||
*[other] in {$amount} seconds
|
[one] in { $amount } second
|
||||||
|
*[other] in { $amount } seconds
|
||||||
}
|
}
|
||||||
|
statistics-in-time-span-minutes =
|
||||||
statistics-in-time-span-minutes = { $amount ->
|
{ $amount ->
|
||||||
[one] in {$amount} minute
|
[one] in { $amount } minute
|
||||||
*[other] in {$amount} minutes
|
*[other] in { $amount } minutes
|
||||||
}
|
}
|
||||||
|
statistics-in-time-span-hours =
|
||||||
statistics-in-time-span-hours = { $amount ->
|
{ $amount ->
|
||||||
[one] in {$amount} hour
|
[one] in { $amount } hour
|
||||||
*[other] in {$amount} hours
|
*[other] in { $amount } hours
|
||||||
}
|
}
|
||||||
|
statistics-in-time-span-days =
|
||||||
statistics-in-time-span-days = { $amount ->
|
{ $amount ->
|
||||||
[one] in {$amount} day
|
[one] in { $amount } day
|
||||||
*[other] in {$amount} days
|
*[other] in { $amount } days
|
||||||
}
|
}
|
||||||
|
statistics-in-time-span-months =
|
||||||
statistics-in-time-span-months = { $amount ->
|
{ $amount ->
|
||||||
[one] in {$amount} month
|
[one] in { $amount } month
|
||||||
*[other] in {$amount} months
|
*[other] in { $amount } months
|
||||||
}
|
}
|
||||||
|
statistics-in-time-span-years =
|
||||||
statistics-in-time-span-years = { $amount ->
|
{ $amount ->
|
||||||
[one] in {$amount} year
|
[one] in { $amount } year
|
||||||
*[other] in {$amount} years
|
*[other] in { $amount } years
|
||||||
}
|
}
|
||||||
|
statistics-cards =
|
||||||
##
|
{ $cards ->
|
||||||
|
[one] { $cards } card
|
||||||
statistics-cards = { $cards ->
|
*[other] { $cards } cards
|
||||||
[one] {$cards} card
|
|
||||||
*[other] {$cards} cards
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# a count of how many cards have been answered, eg "Total: 34 reviews"
|
# a count of how many cards have been answered, eg "Total: 34 reviews"
|
||||||
statistics-reviews = { $reviews ->
|
statistics-reviews =
|
||||||
|
{ $reviews ->
|
||||||
[one] 1 review
|
[one] 1 review
|
||||||
*[other] {$reviews} reviews
|
*[other] { $reviews } reviews
|
||||||
}
|
}
|
||||||
|
|
||||||
# Shown at the bottom of the deck list, and in the statistics screen.
|
# Shown at the bottom of the deck list, and in the statistics screen.
|
||||||
# eg "Studied 3 cards in 13 seconds today (4.33s/card)."
|
# eg "Studied 3 cards in 13 seconds today (4.33s/card)."
|
||||||
# The { statistics-in-time-span-seconds } part should be pasted in from the English
|
# The { statistics-in-time-span-seconds } part should be pasted in from the English
|
||||||
|
@ -71,7 +68,12 @@ statistics-studied-today =
|
||||||
[months] { statistics-in-time-span-months }
|
[months] { statistics-in-time-span-months }
|
||||||
*[years] { statistics-in-time-span-years }
|
*[years] { statistics-in-time-span-years }
|
||||||
} today
|
} today
|
||||||
({$secs-per-card}s/card)
|
({ $secs-per-card }s/card)
|
||||||
|
|
||||||
# eg, "Time taken to review card: 5s"
|
# eg, "Time taken to review card: 5s"
|
||||||
statistics-seconds-taken = { $seconds }s
|
statistics-seconds-taken = { $seconds }s
|
||||||
|
statistics-today-title = Today
|
||||||
|
statistics-today-again-count = Again count:
|
||||||
|
statistics-today-type-counts = Learn: { $learnCount }, Review: { $reviewCount }, Relearn: { $relearnCount }, Filtered: { $filteredCount }
|
||||||
|
statistics-today-no-cards = No cards have been studied today.
|
||||||
|
statistics-today-no-mature-cards = No mature cards were studied today.
|
||||||
|
statistics-today-correct-mature = Correct answers on mature cards: { $correct }/{ $total } ({ $percent }%)
|
||||||
|
|
|
@ -9,16 +9,18 @@
|
||||||
|
|
||||||
let todayData: TodayData | null = null;
|
let todayData: TodayData | null = null;
|
||||||
$: if (sourceData) {
|
$: if (sourceData) {
|
||||||
console.log("gathering data");
|
|
||||||
todayData = gatherData(sourceData, i18n);
|
todayData = gatherData(sourceData, i18n);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if todayData}
|
{#if todayData}
|
||||||
<div class="graph">
|
<div class="graph">
|
||||||
<h1>Today</h1>
|
<h1>{todayData.title}</h1>
|
||||||
|
|
||||||
<div>{todayData.studiedToday}</div>
|
<div class="legend-outer">
|
||||||
{JSON.stringify(todayData)}
|
{#each todayData.lines as line}
|
||||||
|
<div>{line}</div>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -115,21 +115,6 @@
|
||||||
transition: opacity 1s;
|
transition: opacity 1s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tooltip-area {
|
|
||||||
height: 4em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tooltip-area > * {
|
|
||||||
flex: 1 100%;
|
|
||||||
justify-content: center;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.legend-outer {
|
.legend-outer {
|
||||||
display: flex;
|
text-align: center;
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.legend-outer div {
|
|
||||||
padding-left: 1em;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,15 +6,8 @@ import { studiedToday } from "../time";
|
||||||
import { I18n } from "../i18n";
|
import { I18n } from "../i18n";
|
||||||
|
|
||||||
export interface TodayData {
|
export interface TodayData {
|
||||||
correctCount: number;
|
title: string;
|
||||||
matureCorrect: number;
|
lines: string[];
|
||||||
matureCount: number;
|
|
||||||
learnCount: number;
|
|
||||||
reviewCount: number;
|
|
||||||
relearnCount: number;
|
|
||||||
earlyReviewCount: number;
|
|
||||||
|
|
||||||
studiedToday: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const ReviewKind = pb.BackendProto.RevlogEntry.ReviewKind;
|
const ReviewKind = pb.BackendProto.RevlogEntry.ReviewKind;
|
||||||
|
@ -71,16 +64,38 @@ export function gatherData(data: pb.BackendProto.GraphsOut, i18n: I18n): TodayDa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let lines: string[];
|
||||||
|
if (answerCount) {
|
||||||
const studiedTodayText = studiedToday(i18n, answerCount, answerMillis / 1000);
|
const studiedTodayText = studiedToday(i18n, answerCount, answerMillis / 1000);
|
||||||
|
const againCount = answerCount - correctCount;
|
||||||
return {
|
let againCountText = i18n.tr(i18n.TR.STATISTICS_TODAY_AGAIN_COUNT);
|
||||||
studiedToday: studiedTodayText,
|
againCountText += ` ${againCount} (${((againCount / answerCount) * 100).toFixed(
|
||||||
correctCount,
|
2
|
||||||
matureCorrect,
|
)}%)`;
|
||||||
matureCount,
|
const typeCounts = i18n.tr(i18n.TR.STATISTICS_TODAY_TYPE_COUNTS, {
|
||||||
learnCount,
|
learnCount,
|
||||||
reviewCount,
|
reviewCount,
|
||||||
relearnCount,
|
relearnCount,
|
||||||
earlyReviewCount,
|
filteredCount: earlyReviewCount,
|
||||||
|
});
|
||||||
|
let matureText: string;
|
||||||
|
if (matureCount) {
|
||||||
|
matureText = i18n.tr(i18n.TR.STATISTICS_TODAY_CORRECT_MATURE, {
|
||||||
|
correct: matureCorrect,
|
||||||
|
total: matureCount,
|
||||||
|
percent: (matureCorrect / matureCount) * 100,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
matureText = i18n.tr(i18n.TR.STATISTICS_TODAY_NO_MATURE_CARDS);
|
||||||
|
}
|
||||||
|
|
||||||
|
lines = [studiedTodayText, againCountText, typeCounts, matureText];
|
||||||
|
} else {
|
||||||
|
lines = [i18n.tr(i18n.TR.STATISTICS_TODAY_NO_CARDS)];
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
title: i18n.tr(i18n.TR.STATISTICS_TODAY_TITLE),
|
||||||
|
lines,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue