From 4e1a9017387c4963f5e5e4c1a5b2975a51614aa5 Mon Sep 17 00:00:00 2001 From: llama Date: Thu, 15 May 2025 14:26:51 +0800 Subject: [PATCH] Clarify field separator being a guess when importing csv (#3996) * clarify that the initially selected field separator is a guess * explain why the field seperator setting might be locked --- ftl/core/importing.ftl | 4 ++++ ts/routes/import-csv/FileOptions.svelte | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ftl/core/importing.ftl b/ftl/core/importing.ftl index c0bc724f3..70bc5f4d1 100644 --- a/ftl/core/importing.ftl +++ b/ftl/core/importing.ftl @@ -15,6 +15,7 @@ importing-colon = Colon importing-comma = Comma importing-empty-first-field = Empty first field: { $val } importing-field-separator = Field separator +importing-field-separator-guessed = Field separator (guessed) importing-field-mapping = Field mapping importing-field-of-file-is = Field { $val } of file is: importing-fields-separated-by = Fields separated by: { $val } @@ -217,6 +218,9 @@ importing-field-separator-help = Please note that if this character appears in any field itself, the field has to be quoted accordingly to the CSV standard. Spreadsheet programs like LibreOffice will do this automatically. + + It cannot be changed if the text file forces use of a specific separator via a file header. + If a file header is not present, Anki will try to guess what the separator is. importing-allow-html-in-fields-help = Enable this if the file contains HTML formatting. E.g. if the file contains the string '<br>', it will appear as a line break on your card. On the other hand, with this diff --git a/ts/routes/import-csv/FileOptions.svelte b/ts/routes/import-csv/FileOptions.svelte index 182083865..53a6c3790 100644 --- a/ts/routes/import-csv/FileOptions.svelte +++ b/ts/routes/import-csv/FileOptions.svelte @@ -65,7 +65,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html openHelpModal(Object.keys(settings).indexOf("delimiter"))} > - {settings.delimiter.title} + {$metadata.forceDelimiter + ? settings.delimiter.title + : tr.importingFieldSeparatorGuessed()}