feat(app): import flashcards from text

Import content gains Flashcards: pasted, or from a CSV or TSV file, one
card per line, split at its first tab, comma or semicolon (a .csv picks
commas), lines without both sides left out. Quoted fields are read as
spreadsheets write them, and a UTF-8 byte order mark is ignored. The
cards come in at the studyset's end with the origin "text", so the
dashboard doesn't count them as written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-08 14:43:49 +02:00
commit 18c1370bf6
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -884,6 +884,71 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get studysetImportAnkiHint => 'From an .apkg or .colpkg file';
@override
String get studysetImportCards => 'Flashcards';
@override
String get studysetImportCardsHint => 'Pasted, or from a CSV or TSV file';
@override
String get cardTextImportTitle => 'Import flashcards';
@override
String get cardTextImportDescription =>
'One card per line: its front, a separator, then its back. Each line is split at its first separator; lines without one are left out.';
@override
String get cardTextImportHint => 'Paste the cards here';
@override
String get cardTextImportLoadFile => 'Load a CSV or TSV file';
@override
String get cardTextImportFileType => 'CSV or TSV files';
@override
String get cardTextImportUnreadable => 'This file isn\'t text in UTF-8.';
@override
String get cardTextImportSeparator => 'Separator';
@override
String get cardTextSeparatorTab => 'Tab';
@override
String get cardTextSeparatorComma => 'Comma';
@override
String get cardTextSeparatorSemicolon => 'Semicolon';
@override
String get cardTextImportNone => 'No cards found yet.';
@override
String cardTextImportReady(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count cards ready to import.',
one: '1 card ready to import.',
);
return '$_temp0';
}
@override
String get cardTextImportSubmit => 'Import';
@override
String cardTextImported(int count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'Imported $count flashcards.',
one: 'Imported 1 flashcard.',
);
return '$_temp0';
}
@override
String get studysetReorder => 'Reorder';