Variables: Export Data Sets refuses more data sets or variables than Import Data Sets reads

dataset.export checked only the 1 MiB size, so a document with more than
1000 data sets or 256 variables exported a CSV that dataset.import then
refused. Export now refuses such a document with a message naming the
limit, and the messages have rows in every complete-message catalog.
This commit is contained in:
dotCooCoo
2026-11-02 12:03:37 +07:00
committed by bflatastic
parent adb446049b
commit 1be658c88c
25 changed files with 111 additions and 1 deletions
+1 -1
View File
@@ -740,7 +740,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Export Data Sets…",
["Window", "Variables"],
None,
"{path?} write every dataset as CSV (header: name, then variables); without path → {csv, datasets}",
"{path?} write every dataset as CSV (header: name, then variables); without path → {csv, datasets}. Refused when the document has more than 1000 data sets or 256 variables, the most dataset.import reads",
has_doc,
dataset_export
),
@@ -341,12 +341,20 @@ pub(super) fn dataset_import(s: &mut Session, p: &Value) -> Result<Value> {
}
/// Export every dataset as CSV (`name` then variables). With `path`, write the file; else return `{csv}`.
/// A document with more data sets or variables than [`dataset_import`] reads is refused.
pub(super) fn dataset_export(s: &mut Session, p: &Value) -> Result<Value> {
const C: &str = "dataset.export";
let st = s.doc()?;
if st.doc.variables.variables.is_empty() {
return Err(bad(C, "define a variable first"));
}
if st.doc.variables.datasets.len() > MAX_CSV_ROWS {
return Err(bad(C, format!("more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS}")));
}
// The name column comes first, so the import's column cap leaves room for this many variables.
if st.doc.variables.variables.len() > MAX_CSV_COLS {
return Err(bad(C, format!("more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS}")));
}
let csv = datasets_to_csv(&st.doc.variables);
if csv.len() > MAX_CSV_BYTES {
return Err(bad(C, format!("CSV would be larger than {MAX_CSV_BYTES} bytes")));
+27
View File
@@ -1325,6 +1325,33 @@ fn datasets_csv_keeps_spaces_in_quoted_cells() {
assert_eq!(value("C"), text_value(" quoted "));
}
/// Export refuses a document with more data sets or variables than `dataset.import` reads, so
/// every file it writes imports back: 1,000 data sets and 256 variables export and import, and
/// one more of either is refused.
#[test]
fn datasets_export_refuses_more_than_import_reads() {
let mut s = session();
let header: Vec<String> = (1..=256).map(|i| format!("V{i}")).collect();
let rows: String = (1..=1000).map(|i| format!("Set {i},x\n")).collect();
s.execute("dataset.import", &json!({"csv": format!("name,{}\n{rows}", header.join(","))})).unwrap();
let csv = s.execute("dataset.export", &json!({})).unwrap()["csv"].as_str().unwrap().to_string();
s.execute("dataset.import", &json!({"csv": csv})).unwrap();
s.execute("dataset.new", &json!({"name": "Set 1001"})).unwrap();
let err = s.execute("dataset.export", &json!({})).unwrap_err().to_string();
assert!(err.contains("more than 1000 data sets"), "{err}");
s.execute("dataset.delete", &json!({"names": ["Set 1001"]})).unwrap();
s.execute("dataset.export", &json!({})).unwrap();
s.execute("variable.define", &json!({"name": "V257", "kind": "text"})).unwrap();
let err = s.execute("dataset.export", &json!({})).unwrap_err().to_string();
assert!(err.contains("more than 256 variables"), "{err}");
let dir = Folder::new("vars-csv-caps");
let out = dir.file("sets.csv");
assert!(s.execute("dataset.export", &json!({"path": out})).is_err());
assert!(!std::path::Path::new(&out).exists(), "no file is written");
}
/// A header row with a tab and no comma outside quotes makes tabs the separator; a quoted cell
/// may then hold tabs and commas. A header row with a comma outside quotes keeps commas, even
/// when a cell holds a tab. A tab-separated header with an unclosed quote fails with the reason.
+2
View File
@@ -5597,6 +5597,8 @@ digits Malayalam Malaiàlam
@msg unsupported native docking operation operació d’acoblament nadiua no compatible
@msg unsupported: {0} no compatible: {0}
@msg variables are locked les variables estan blocades
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} més de {MAX_CSV_ROWS} conjunts de dades: Importa conjunts de dades en llegeix com a màxim {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} més de {MAX_CSV_COLS} variables: Importa conjunts de dades en llegeix com a màxim {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} les variables que no són text s’han omès: {kinds}
@msg VectorCraft doesn't search other apps' or the system's folders: {path} VectorCraft no cerca a les carpetes d’altres aplicacions ni del sistema: {path}
@msg VectorCraft doesn't search the Shared or Public folder in Users: {path} VectorCraft no cerca a la carpeta Shared o Public d’Usuaris: {path}
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4786,6 +4786,8 @@ imageTrace Outline Obrys
@msg unknown workspace (one of {_1}) neznámý pracovní prostor (jeden z {_1})
@msg unsupported: {0} nepodporováno: {0}
@msg variables are locked proměnné jsou zamčené
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} více než {MAX_CSV_ROWS} sad dat: Importovat sady dat načte nejvýše {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} více než {MAX_CSV_COLS} proměnných: Importovat sady dat načte nejvýše {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} proměnné, které nejsou textové, byly vynechány: {kinds}
@msg `{key}: {top}` and `options.{key}: {inner}` disagree: give the option once `{key}: {top}` a `options.{key}: {inner}` si odporují: zadejte volbu jen jednou
@msg version {0} files can't be compressed: only version {COMPRESSED_SINCE} and later open compressed files soubory verze {0} nelze komprimovat: komprimované soubory otevírá až verze {COMPRESSED_SINCE} a novější
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4395,6 +4395,8 @@ theme Appearance Erscheinungsbild
@msg unknown workspace (one of {_1}) unbekannter Arbeitsbereich (einer von {_1})
@msg unsupported: {0} nicht unterstützt: {0}
@msg variables are locked die Variablen sind gesperrt
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} mehr als {MAX_CSV_ROWS} Datensätze: „Datensätze importieren“ liest höchstens {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} mehr als {MAX_CSV_COLS} Variablen: „Datensätze importieren“ liest höchstens {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} die Variablen, die kein Text sind, wurden ausgelassen: {kinds}
@msg `{key}: {top}` and `options.{key}: {inner}` disagree: give the option once `{key}: {top}` und `options.{key}: {inner}` widersprechen sich: Option nur einmal angeben
@msg version {0} files can't be compressed: only version {COMPRESSED_SINCE} and later open compressed files Dateien der Version {0} können nicht komprimiert werden: Erst Version {COMPRESSED_SINCE} und neuer öffnen komprimierte Dateien
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4428,6 +4428,8 @@ digits Malayalam Μαλαγιάλαμ
@msg unknown workspace (one of {_1}) άγνωστος χώρος εργασίας (ένας από τους {_1})
@msg unsupported: {0} δεν υποστηρίζεται: {0}
@msg variables are locked οι μεταβλητές είναι κλειδωμένες
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} περισσότερα από {MAX_CSV_ROWS} σύνολα δεδομένων: η Εισαγωγή συνόλων δεδομένων διαβάζει έως {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} περισσότερες από {MAX_CSV_COLS} μεταβλητές: η Εισαγωγή συνόλων δεδομένων διαβάζει έως {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} οι μεταβλητές που δεν είναι κειμένου παραλείφθηκαν: {kinds}
@msg `{key}: {top}` and `options.{key}: {inner}` disagree: give the option once τα `{key}: {top}` και `options.{key}: {inner}` διαφέρουν: δώστε την επιλογή μόνο μία φορά
@msg version {0} files can't be compressed: only version {COMPRESSED_SINCE} and later open compressed files τα αρχεία έκδοσης {0} δεν μπορούν να συμπιεστούν: μόνο η έκδοση {COMPRESSED_SINCE} και νεότερες ανοίγουν συμπιεσμένα αρχεία
Can't render this file because it contains an unexpected character in line 164 and column 5.
+2
View File
@@ -4480,6 +4480,8 @@ axis Both Ambos
@msg unknown workspace (one of {_1}) espacio de trabajo desconocido (uno de estos: {_1})
@msg unsupported: {0} no compatible: {0}
@msg variables are locked las variables están bloqueadas
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} más de {MAX_CSV_ROWS} conjuntos de datos: Importar conjuntos de datos lee como máximo {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} más de {MAX_CSV_COLS} variables: Importar conjuntos de datos lee como máximo {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} se omitieron las variables que no son de texto: {kinds}
@msg `{key}: {top}` and `options.{key}: {inner}` disagree: give the option once `{key}: {top}` y `options.{key}: {inner}` no coinciden: indique la opción una sola vez
@msg version {0} files can't be compressed: only version {COMPRESSED_SINCE} and later open compressed files los archivos de la versión {0} no se pueden comprimir: solo la versión {COMPRESSED_SINCE} y posteriores abren archivos comprimidos
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4688,6 +4688,8 @@ imageTrace Outline Ääriviiva
@msg unknown workspace (one of {_1}) tuntematon työtila (jokin seuraavista: {_1})
@msg unsupported: {0} ei tuettu: {0}
@msg variables are locked muuttujat on lukittu
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} yli {MAX_CSV_ROWS} tietojoukkoa: Tuo tietojoukot lukee enintään {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} yli {MAX_CSV_COLS} muuttujaa: Tuo tietojoukot lukee enintään {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} muut kuin tekstimuuttujat jätettiin pois: {kinds}
@msg `{key}: {top}` and `options.{key}: {inner}` disagree: give the option once `{key}: {top}` ja `options.{key}: {inner}` ovat ristiriidassa: anna asetus vain kerran
@msg version {0} files can't be compressed: only version {COMPRESSED_SINCE} and later open compressed files version {0} tiedostoja ei voi pakata: pakattuja tiedostoja voi avata vain versiosta {COMPRESSED_SINCE} alkaen
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4470,6 +4470,8 @@ axis Both Les deux
@msg unknown workspace (one of {_1}) espace de travail inconnu (valeurs possibles : {_1})
@msg unsupported: {0} non pris en charge : {0}
@msg variables are locked les variables sont verrouillées
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} plus de {MAX_CSV_ROWS} jeux de données : Importer des jeux de données en lit au plus {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} plus de {MAX_CSV_COLS} variables : Importer des jeux de données en lit au plus {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} les variables qui ne sont pas du texte ({kinds}) ont été ignorées
@msg `{key}: {top}` and `options.{key}: {inner}` disagree: give the option once `{key}: {top}` et `options.{key}: {inner}` ne concordent pas. Indiquez l’option une seule fois
@msg version {0} files can't be compressed: only version {COMPRESSED_SINCE} and later open compressed files les fichiers de version {0} ne peuvent pas être compressés : seules les versions {COMPRESSED_SINCE} et ultérieures ouvrent les fichiers compressés
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -5250,6 +5250,8 @@ imageTrace Outline Körvonal
@msg unsupported native docking operation nem támogatott natív dokkolási művelet
@msg unsupported: {0} nem támogatott: {0}
@msg variables are locked a változók zárolva vannak
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} több mint {MAX_CSV_ROWS} adatkészlet: az Adatkészletek importálása legfeljebb {MAX_CSV_ROWS} adatkészletet olvas be
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} több mint {MAX_CSV_COLS} változó: az Adatkészletek importálása legfeljebb {MAX_CSV_COLS} változót olvas be
@msg variables that aren't text were left out: {kinds} a nem szöveges változók kimaradtak: {kinds}
@msg VectorCraft doesn't search other apps' or the system's folders: {path} a VectorCraft nem keres más alkalmazások és a rendszer mappáiban: {path}
@msg VectorCraft doesn't search the Shared or Public folder in Users: {path} a VectorCraft nem keres a Users alatti Shared és Public mappában: {path}
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4521,6 +4521,8 @@ axis Both Entrambi
@msg unknown workspace (one of {_1}) area di lavoro sconosciuta (una delle seguenti: {_1})
@msg unsupported: {0} non supportato: {0}
@msg variables are locked le variabili sono bloccate
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} più di {MAX_CSV_ROWS} set di dati: Importa set di dati ne legge al massimo {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} più di {MAX_CSV_COLS} variabili: Importa set di dati ne legge al massimo {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} le variabili che non sono di testo sono state escluse: {kinds}
@msg `{key}: {top}` and `options.{key}: {inner}` disagree: give the option once `{key}: {top}` e `options.{key}: {inner}` non coincidono: indicare l'opzione una sola volta
@msg version {0} files can't be compressed: only version {COMPRESSED_SINCE} and later open compressed files i file della versione {0} non possono essere compressi: solo la versione {COMPRESSED_SINCE} e successive aprono file compressi
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4076,6 +4076,8 @@ swatch Bright Violet ビビッドバイオレット
@msg Make Guides: select paths ガイドを作成: パスを選択してください
@msg Release Guides: no guides ガイドを解除: ガイドがありません
@msg variables are locked 変数がロックされています
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} データセットが {MAX_CSV_ROWS} 個を超えています: 「データセットを読み込み」が読み込めるのは {MAX_CSV_ROWS} 個までです
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} 変数が {MAX_CSV_COLS} 個を超えています: 「データセットを読み込み」が読み込めるのは {MAX_CSV_COLS} 個までです
@msg variables that aren't text were left out: {kinds} テキスト以外の変数は除外されました: {kinds}
@msg guides are locked ガイドがロックされています
@msg handle must be in or out handle には in または out を指定してください
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -5417,6 +5417,8 @@ imageTrace Outline კონტური
@msg too many changed shortcuts ზედმეტად ბევრი შეცვლილი მალსახმობი
@msg too many library panels were opened in this session ამ სესიაში ზედმეტად ბევრი ბიბლიოთეკის პანელი გაიხსნა
@msg variables are locked ცვლადები ჩაკეტილია
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} {MAX_CSV_ROWS}-ზე მეტი მონაცემთა ნაკრები: მონაცემთა ნაკრებების იმპორტი კითხულობს მაქსიმუმ {MAX_CSV_ROWS}-ს
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} {MAX_CSV_COLS}-ზე მეტი ცვლადი: მონაცემთა ნაკრებების იმპორტი კითხულობს მაქსიმუმ {MAX_CSV_COLS}-ს
@msg variables that aren't text were left out: {kinds} ცვლადები, რომლებიც ტექსტი არ არის, გამოტოვებულია: {kinds}
@msg x and y must be finite x და y სასრული უნდა იყოს
@msg {id} opens another app: only the person at the keyboard can run it {id} სხვა აპს ხსნის: მისი გაშვება მხოლოდ კლავიატურასთან მყოფ ადამიანს შეუძლია
Can't render this file because it is too large.
+2
View File
@@ -4003,6 +4003,8 @@ theme Appearance 외관
@msg Make Guides: select paths 안내선 만들기: 패스를 선택하세요
@msg Release Guides: no guides 안내선 해제: 안내선이 없습니다
@msg variables are locked 변수가 잠겨 있습니다
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} 데이터 세트가 {MAX_CSV_ROWS}개보다 많습니다: 데이터 세트 가져오기는 최대 {MAX_CSV_ROWS}개를 읽습니다
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} 변수가 {MAX_CSV_COLS}개보다 많습니다: 데이터 세트 가져오기는 최대 {MAX_CSV_COLS}개를 읽습니다
@msg variables that aren't text were left out: {kinds} 텍스트가 아닌 변수는 제외되었습니다: {kinds}
@msg guides are locked 안내선이 잠겨 있습니다
@msg handle must be in or out handle은 in 또는 out이어야 합니다
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4612,6 +4612,8 @@ imageTrace Outline Kontur
@msg unknown workspace (one of {_1}) nieznany obszar roboczy (jeden z: {_1})
@msg unsupported: {0} nieobsługiwane: {0}
@msg variables are locked zmienne są zablokowane
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} więcej niż {MAX_CSV_ROWS} zestawów danych: Importuj zestawy danych odczytuje najwyżej {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} więcej niż {MAX_CSV_COLS} zmiennych: Importuj zestawy danych odczytuje najwyżej {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} pominięto zmienne, które nie są tekstowe: {kinds}
@msg `{key}: {top}` and `options.{key}: {inner}` disagree: give the option once `{key}: {top}` i `options.{key}: {inner}` są sprzeczne: podaj opcję tylko raz
@msg version {0} files can't be compressed: only version {COMPRESSED_SINCE} and later open compressed files plików w wersji {0} nie można kompresować: skompresowane pliki otwierają tylko wersje {COMPRESSED_SINCE} i nowsze
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4052,6 +4052,8 @@ axis Both Ambos
@msg unknown workspace (one of {_1}) espaço de trabalho desconhecido (um de {_1})
@msg unsupported: {0} não suportado: {0}
@msg variables are locked as variáveis estão bloqueadas
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} mais de {MAX_CSV_ROWS} conjuntos de dados: Importar Conjuntos de Dados lê no máximo {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} mais de {MAX_CSV_COLS} variáveis: Importar Conjuntos de Dados lê no máximo {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} as variáveis que não são de texto foram omitidas: {kinds}
@msg `{key}: {top}` and `options.{key}: {inner}` disagree: give the option once `{key}: {top}` e `options.{key}: {inner}` não coincidem: informe a opção uma só vez
@msg version {0} files can't be compressed: only version {COMPRESSED_SINCE} and later open compressed files arquivos da versão {0} não podem ser compactados: somente a versão {COMPRESSED_SINCE} e posteriores abrem arquivos compactados
Can't render this file because it contains an unexpected character in line 6 and column 47.
+2
View File
@@ -4516,6 +4516,8 @@ axis Both Оба
@msg unknown workspace (one of {_1}) неизвестная рабочая среда (одна из: {_1})
@msg unsupported: {0} не поддерживается: {0}
@msg variables are locked переменные заблокированы
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} больше {MAX_CSV_ROWS} наборов данных: «Импортировать наборы данных» читает не более {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} больше {MAX_CSV_COLS} переменных: «Импортировать наборы данных» читает не более {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} переменные, которые не являются текстовыми, пропущены: {kinds}
@msg `{key}: {top}` and `options.{key}: {inner}` disagree: give the option once `{key}: {top}` и `options.{key}: {inner}` противоречат друг другу: укажите параметр только один раз
@msg version {0} files can't be compressed: only version {COMPRESSED_SINCE} and later open compressed files файлы версии {0} не могут быть сжаты: только версия {COMPRESSED_SINCE} и новее открывают сжатые файлы
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4379,6 +4379,8 @@ axis Both Båda
@msg unknown workspace (one of {_1}) okänd arbetslayout (en av {_1})
@msg unsupported: {0} stöds inte: {0}
@msg variables are locked variablerna är låsta
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} fler än {MAX_CSV_ROWS} datauppsättningar: Importera datauppsättningar läser högst {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} fler än {MAX_CSV_COLS} variabler: Importera datauppsättningar läser högst {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} variabler som inte är text utelämnades: {kinds}
@msg `{key}: {top}` and `options.{key}: {inner}` disagree: give the option once `{key}: {top}` och `options.{key}: {inner}` stämmer inte överens: ange alternativet bara en gång
@msg version {0} files can't be compressed: only version {COMPRESSED_SINCE} and later open compressed files filer i version {0} kan inte komprimeras: endast version {COMPRESSED_SINCE} och senare kan öppna komprimerade filer
Can't render this file because it contains an unexpected character in line 5 and column 25.
+33
View File
@@ -1736,6 +1736,39 @@ fn saved_tracing_preset_errors_are_translated() {
}
}
/// Export Data Sets' refusals of more data sets or variables than Import Data Sets reads are
/// translated in every language that translates every message.
#[test]
fn dataset_export_limit_errors_are_translated() {
use serde_json::json;
use vectorcraft_engine::{EngineError, Session};
let mut s = Session::new();
s.execute("file.new", &json!({})).unwrap();
let rows: String = (1..=1000).map(|i| format!("Set {i},x\n")).collect();
s.execute("dataset.import", &json!({"csv": format!("name,V1\n{rows}")})).unwrap();
s.execute("dataset.new", &json!({"name": "Set 1001"})).unwrap();
let mut errors = vec![];
let e = s.execute("dataset.export", &json!({})).unwrap_err();
let want = "more than 1000 data sets: Import Data Sets reads at most 1000";
assert!(matches!(&e, EngineError::BadParams { msg, .. } if msg == want), "{e}");
errors.push((e.to_string(), want));
s.execute("dataset.delete", &json!({"names": ["Set 1001"]})).unwrap();
for i in 2..=257 {
s.execute("variable.define", &json!({"name": format!("V{i}"), "kind": "text"})).unwrap();
}
let e = s.execute("dataset.export", &json!({})).unwrap_err();
let want = "more than 256 variables: Import Data Sets reads at most 256";
assert!(matches!(&e, EngineError::BadParams { msg, .. } if msg == want), "{e}");
errors.push((e.to_string(), want));
for code in COMPLETE_MESSAGES {
let lang = Lang::from_code(code).expect("registered");
for (e, want) in &errors {
let shown = message(lang, e);
assert!(!shown.contains(want), "{code}: {shown}");
}
}
}
/// The status bar's line for an EPS file whose PostScript stops on an error, opened partly or
/// refused, and the refusal's dialog keep the error's name as PostScript spells it and its meaning,
/// which each language shows as its catalog translates the meaning.
+2
View File
@@ -5334,6 +5334,8 @@ theme Appearance Görünüm
@msg the spine has no segments omurganın segmenti yok
@msg too many library panels were opened in this session bu oturumda çok fazla kütüphane paneli açıldı
@msg variables are locked değişkenler kilitli
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} {MAX_CSV_ROWS} veri setinden fazla: Veri Kümelerini İçe Aktar en fazla {MAX_CSV_ROWS} tane okur
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} {MAX_CSV_COLS} değişkenden fazla: Veri Kümelerini İçe Aktar en fazla {MAX_CSV_COLS} tane okur
@msg x and y must be finite x ve y sonlu olmalıdır
@msg aiVersion 7 writes legacy .ai files; a .ait template is always PDF-compatible aiVersion 7 eski .ai dosyalarını yazar; bir .ait şablonu her zaman PDF uyumludur
@msg Edit Original opens image and document files only; “{name}” is not one Özgünü Düzenle yalnızca görüntü ve belge dosyalarını açar; “{name}” bunlardan biri değil
Can't render this file because it contains an unexpected character in line 5 and column 25.
+2
View File
@@ -4505,6 +4505,8 @@ axis Both Обидві
@msg unknown workspace (one of {_1}) невідоме робоче середовище (одна з: {_1})
@msg unsupported: {0} не підтримується: {0}
@msg variables are locked змінні заблоковані
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} більше ніж {MAX_CSV_ROWS} наборів даних: «Імпортувати набори даних» читає не більше {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} більше ніж {MAX_CSV_COLS} змінних: «Імпортувати набори даних» читає не більше {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} змінні, що не є текстовими, пропущено: {kinds}
@msg `{key}: {top}` and `options.{key}: {inner}` disagree: give the option once `{key}: {top}` і `options.{key}: {inner}` суперечать одне одному: вкажіть параметр лише один раз
@msg version {0} files can't be compressed: only version {COMPRESSED_SINCE} and later open compressed files файли версії {0} не можуть бути стиснуті: тільки версія {COMPRESSED_SINCE} і новіші відкривають стислі файли
Can't render this file because it contains an unexpected character in line 178 and column 5.
+2
View File
@@ -4912,6 +4912,8 @@ theme Appearance Giao diện
@msg unsupported native docking operation thao tác neo gốc không được hỗ trợ
@msg unsupported: {0} không được hỗ trợ: {0}
@msg variables are locked biến số bị khóa
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} hơn {MAX_CSV_ROWS} tập dữ liệu: Nhập tập dữ liệu chỉ đọc tối đa {MAX_CSV_ROWS}
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} hơn {MAX_CSV_COLS} biến số: Nhập tập dữ liệu chỉ đọc tối đa {MAX_CSV_COLS}
@msg variables that aren't text were left out: {kinds} các biến số không phải văn bản đã bị bỏ qua: {kinds}
@msg VectorCraft doesn't search other apps' or the system's folders: {path} VectorCraft không tìm kiếm trong thư mục của ứng dụng khác hoặc hệ thống: {path}
@msg VectorCraft doesn't search the Shared or Public folder in Users: {path} VectorCraft không tìm kiếm thư mục Shared hoặc Public trong Users: {path}
Can't render this file because it contains an unexpected character in line 200 and column 5.
+2
View File
@@ -3471,6 +3471,8 @@ digits Malayalam 马拉雅拉姆数字
Lock Variables 锁定变量
Unlock Variables 解锁变量
@msg variables are locked 变量已锁定
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} 数据集超过 {MAX_CSV_ROWS} 个:“导入数据集”最多读取 {MAX_CSV_ROWS} 个
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} 变量超过 {MAX_CSV_COLS} 个:“导入数据集”最多读取 {MAX_CSV_COLS} 个
@msg variables that aren't text were left out: {kinds} 已省略非文本变量:{kinds}
List Variables 列出变量
Bind Variable 绑定变量
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -4459,6 +4459,8 @@ digits Malayalam 馬來亞拉姆數字
Lock Variables 鎖定變數
Unlock Variables 解除鎖定變數
@msg variables are locked 變數已鎖定
@msg more than {MAX_CSV_ROWS} data sets: Import Data Sets reads at most {MAX_CSV_ROWS} 資料集超過 {MAX_CSV_ROWS} 個:「匯入資料集」最多讀取 {MAX_CSV_ROWS} 個
@msg more than {MAX_CSV_COLS} variables: Import Data Sets reads at most {MAX_CSV_COLS} 變數超過 {MAX_CSV_COLS} 個:「匯入資料集」最多讀取 {MAX_CSV_COLS} 個
@msg variables that aren't text were left out: {kinds} 已略過非文字變數:{kinds}
List Variables 列出變數
Bind Variable 綁定變數
Can't render this file because it contains an unexpected character in line 6 and column 47.