diff --git a/crates/ui-egui/src/equation.rs b/crates/ui-egui/src/equation.rs index e412be107..087554d1c 100644 --- a/crates/ui-egui/src/equation.rs +++ b/crates/ui-egui/src/equation.rs @@ -519,6 +519,47 @@ mod tests { assert!(!want.starts_with("Error at character")); } + /// The equation checks' own messages (not RaTeX's syntax errors, which stay English) are + /// translated in every catalog. Each comes from the real check, and the expected English is + /// built from the limits, so a changed limit fails here instead of silently falling back to + /// English (the catalogs key the message with the number in it). + #[test] + fn equation_check_messages_are_translated_in_every_catalog() { + use crate::i18n::Language; + use gridcraft_engine::math::{MAX_CELLS, MAX_DEPTH, MAX_SOURCE_BYTES, layout}; + let cases = [ + ("\\def\\x{1} x".to_string(), "Macro definitions are not supported in equations.".to_string()), + ("50% \\href{https://example.com}{x}".to_string(), "A % can't be combined with a link in an equation.".to_string()), + (format!("{}x{}", "{".repeat(MAX_DEPTH + 1), "}".repeat(MAX_DEPTH + 1)), format!("Equations can nest at most {MAX_DEPTH} levels deep.")), + ("x".repeat(MAX_SOURCE_BYTES + 1), format!("An equation can be at most {MAX_SOURCE_BYTES} bytes long.")), + ( + "\\begin{alignedat}{99999999}a\\end{alignedat}".to_string(), + format!("An equation can have at most {MAX_CELLS} matrix cells (rows times the widest row)."), + ), + ("\\rule{99999999em}{1em}".to_string(), "This equation is too large to draw.".to_string()), + ]; + let mut messages = Vec::new(); + for (src, want) in cases { + let got = layout(&src).err().unwrap_or_else(|| panic!("{src:?} lays out")).message; + assert_eq!(got, want, "{src:?} hits another check"); + messages.push(got); + } + // Only a panic inside the layout reaches this one. + messages.push("This equation could not be laid out.".to_string()); + for message in &messages { + for language in Language::ALL { + let shown = parse_error_text(language, None, message); + assert!(!shown.contains('\n'), "{}: {message:?} => {shown:?}", language.code()); + if language != Language::En { + assert_ne!(&shown, message, "{} leaves {message:?} in English", language.code()); + } + } + } + let it = Language::It; + let want = it.tr("Error at character {position}: {message}").replace("{position}", "1").replace("{message}", it.tr(&messages[0])); + assert_eq!(parse_error_text(it, Some(1), &messages[0]), want); + } + #[test] fn ear_clipping_covers_a_concave_polygon() { // An L shape: area 3 unit squares. diff --git a/crates/ui-egui/src/i18n/cs.rs b/crates/ui-egui/src/i18n/cs.rs index 0064af99f..bd23a5566 100644 --- a/crates/ui-egui/src/i18n/cs.rs +++ b/crates/ui-egui/src/i18n/cs.rs @@ -605,6 +605,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Obrázek: {alt}", "Format Control: {name}" => "Formát ovládacího prvku: {name}", "Error at character {position}: {message}" => "Chyba na znaku {position}: {message}", + "Macro definitions are not supported in equations." => "Definice maker nejsou v rovnicích podporovány.", + "A % can't be combined with a link in an equation." => "Znak % nelze v rovnici kombinovat s odkazem.", + "Equations can nest at most 32 levels deep." => "Rovnice lze vnořit nejvýše do 32 úrovní.", + "An equation can be at most 4096 bytes long." => "Rovnice může mít nejvýše 4096 bajtů.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Rovnice může mít nejvýše 2500 buněk matice (řádky krát nejširší řádek)." + } + "This equation is too large to draw." => "Tato rovnice je příliš velká na vykreslení.", + "This equation could not be laid out." => "Tuto rovnici nelze vysázet.", "Saved macro “{name}” ({steps} step)" => "Makro „{name}“ uloženo ({steps} krok)", "Saved macro “{name}” ({steps} steps)" => "Makro „{name}“ uloženo (počet kroků: {steps})", "without {key}: another macro took it while recording" => "bez {key}: během záznamu ji převzalo jiné makro", diff --git a/crates/ui-egui/src/i18n/de.rs b/crates/ui-egui/src/i18n/de.rs index 816fb0e04..7a1602a0c 100644 --- a/crates/ui-egui/src/i18n/de.rs +++ b/crates/ui-egui/src/i18n/de.rs @@ -525,6 +525,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Bild: {alt}", "Format Control: {name}" => "Steuerelement formatieren: {name}", "Error at character {position}: {message}" => "Fehler bei Zeichen {position}: {message}", + "Macro definitions are not supported in equations." => "Makrodefinitionen werden in Formeln nicht unterstützt.", + "A % can't be combined with a link in an equation." => "Ein % kann in einer Formel nicht mit einem Link kombiniert werden.", + "Equations can nest at most 32 levels deep." => "Formeln können höchstens 32 Ebenen tief verschachtelt werden.", + "An equation can be at most 4096 bytes long." => "Eine Formel darf höchstens 4096 Byte lang sein.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Eine Formel darf höchstens 2500 Matrixzellen haben (Zeilen mal breiteste Zeile)." + } + "This equation is too large to draw." => "Diese Formel ist zu groß zum Zeichnen.", + "This equation could not be laid out." => "Diese Formel konnte nicht gesetzt werden.", "Saved macro “{name}” ({steps} step)" => "Makro „{name}“ gespeichert ({steps} Schritt)", "Saved macro “{name}” ({steps} steps)" => "Makro „{name}“ gespeichert ({steps} Schritte)", "without {key}: another macro took it while recording" => { diff --git a/crates/ui-egui/src/i18n/el.rs b/crates/ui-egui/src/i18n/el.rs index 415aea0a8..e10889eb0 100644 --- a/crates/ui-egui/src/i18n/el.rs +++ b/crates/ui-egui/src/i18n/el.rs @@ -1020,6 +1020,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Εικόνα: {alt}", "Format Control: {name}" => "Μορφοποίηση στοιχείου ελέγχου: {name}", "Error at character {position}: {message}" => "Σφάλμα στον χαρακτήρα {position}: {message}", + "Macro definitions are not supported in equations." => "Οι ορισμοί μακροεντολών δεν υποστηρίζονται στις εξισώσεις.", + "A % can't be combined with a link in an equation." => "Ένα % δεν μπορεί να συνδυαστεί με σύνδεσμο σε μια εξίσωση.", + "Equations can nest at most 32 levels deep." => "Οι εξισώσεις μπορούν να έχουν έως 32 επίπεδα ένθεσης.", + "An equation can be at most 4096 bytes long." => "Μια εξίσωση μπορεί να έχει έως 4096 byte.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Μια εξίσωση μπορεί να έχει έως 2500 κελιά πίνακα (γραμμές επί τη φαρδύτερη γραμμή)." + } + "This equation is too large to draw." => "Αυτή η εξίσωση είναι πολύ μεγάλη για να σχεδιαστεί.", + "This equation could not be laid out." => "Δεν ήταν δυνατή η στοιχειοθέτηση αυτής της εξίσωσης.", "Saved macro “{name}” ({steps} step)" => "Η μακροεντολή «{name}» αποθηκεύτηκε ({steps} βήμα)", "Saved macro “{name}” ({steps} steps)" => "Η μακροεντολή «{name}» αποθηκεύτηκε ({steps} βήματα)", "without {key}: another macro took it while recording" => "χωρίς {key}: το πήρε άλλη μακροεντολή κατά την καταγραφή", diff --git a/crates/ui-egui/src/i18n/es.rs b/crates/ui-egui/src/i18n/es.rs index dd2a6a18d..5cb65aa12 100644 --- a/crates/ui-egui/src/i18n/es.rs +++ b/crates/ui-egui/src/i18n/es.rs @@ -531,6 +531,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Imagen: {alt}", "Format Control: {name}" => "Formato de control: {name}", "Error at character {position}: {message}" => "Error en el carácter {position}: {message}", + "Macro definitions are not supported in equations." => "Las definiciones de macros no se admiten en las ecuaciones.", + "A % can't be combined with a link in an equation." => "Un % no se puede combinar con un vínculo en una ecuación.", + "Equations can nest at most 32 levels deep." => "Las ecuaciones pueden anidarse como máximo 32 niveles.", + "An equation can be at most 4096 bytes long." => "Una ecuación puede tener como máximo 4096 bytes.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Una ecuación puede tener como máximo 2500 celdas de matriz (filas por la fila más ancha)." + } + "This equation is too large to draw." => "Esta ecuación es demasiado grande para dibujarla.", + "This equation could not be laid out." => "No se pudo componer esta ecuación.", "Saved macro “{name}” ({steps} step)" => "Macro “{name}” guardada ({steps} paso)", "Saved macro “{name}” ({steps} steps)" => "Macro “{name}” guardada ({steps} pasos)", "without {key}: another macro took it while recording" => "sin {key}: otra macro lo tomó durante la grabación", diff --git a/crates/ui-egui/src/i18n/fr.rs b/crates/ui-egui/src/i18n/fr.rs index 7d881b4b4..ed84c6961 100644 --- a/crates/ui-egui/src/i18n/fr.rs +++ b/crates/ui-egui/src/i18n/fr.rs @@ -491,6 +491,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Image : {alt}", "Format Control: {name}" => "Format de contrôle : {name}", "Error at character {position}: {message}" => "Erreur au caractère {position} : {message}", + "Macro definitions are not supported in equations." => "Les définitions de macros ne sont pas prises en charge dans les équations.", + "A % can't be combined with a link in an equation." => "Un % ne peut pas être combiné avec un lien dans une équation.", + "Equations can nest at most 32 levels deep." => "Les équations peuvent comporter au plus 32 niveaux d’imbrication.", + "An equation can be at most 4096 bytes long." => "Une équation peut contenir au plus 4096 octets.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Une équation peut contenir au plus 2500 cellules de matrice (lignes multipliées par la ligne la plus large)." + } + "This equation is too large to draw." => "Cette équation est trop grande pour être dessinée.", + "This equation could not be laid out." => "Impossible de mettre en page cette équation.", "Saved macro “{name}” ({steps} step)" => "Macro « {name} » enregistrée ({steps} étape)", "Saved macro “{name}” ({steps} steps)" => "Macro « {name} » enregistrée ({steps} étapes)", "without {key}: another macro took it while recording" => "sans {key} : une autre macro l’a pris pendant l’enregistrement", diff --git a/crates/ui-egui/src/i18n/it.rs b/crates/ui-egui/src/i18n/it.rs index fd2ffb3a6..74a9cb154 100644 --- a/crates/ui-egui/src/i18n/it.rs +++ b/crates/ui-egui/src/i18n/it.rs @@ -1026,6 +1026,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Immagine: {alt}", "Format Control: {name}" => "Formato controllo: {name}", "Error at character {position}: {message}" => "Errore al carattere {position}: {message}", + "Macro definitions are not supported in equations." => "Le definizioni di macro non sono supportate nelle equazioni.", + "A % can't be combined with a link in an equation." => "Un % non può essere combinato con un collegamento in un'equazione.", + "Equations can nest at most 32 levels deep." => "Le equazioni possono essere annidate al massimo su 32 livelli.", + "An equation can be at most 4096 bytes long." => "Un'equazione può essere lunga al massimo 4096 byte.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Un'equazione può avere al massimo 2500 celle di matrice (righe per la riga più larga)." + } + "This equation is too large to draw." => "Questa equazione è troppo grande per essere disegnata.", + "This equation could not be laid out." => "Impossibile impaginare questa equazione.", "Saved macro “{name}” ({steps} step)" => "Macro “{name}” salvata ({steps} passaggio)", "Saved macro “{name}” ({steps} steps)" => "Macro “{name}” salvata ({steps} passaggi)", "without {key}: another macro took it while recording" => "senza {key}: un’altra macro l’ha preso durante la registrazione", diff --git a/crates/ui-egui/src/i18n/ja.rs b/crates/ui-egui/src/i18n/ja.rs index 321dc6206..39309d0c3 100644 --- a/crates/ui-egui/src/i18n/ja.rs +++ b/crates/ui-egui/src/i18n/ja.rs @@ -1026,6 +1026,13 @@ pub(super) const DIALOGS: &[(&str, &str)] = &[ ("Picture: {alt}", "画像: {alt}"), ("Format Control: {name}", "コントロールの書式設定: {name}"), ("Error at character {position}: {message}", "{position} 文字目でエラー: {message}"), + ("Macro definitions are not supported in equations.", "数式ではマクロ定義はサポートされていません。"), + ("A % can't be combined with a link in an equation.", "数式では % とリンクを組み合わせることはできません。"), + ("Equations can nest at most 32 levels deep.", "数式の入れ子は 32 レベルまでです。"), + ("An equation can be at most 4096 bytes long.", "数式の長さは 4096 バイトまでです。"), + ("An equation can have at most 2500 matrix cells (rows times the widest row).", "数式の行列セルは 2500 個まで (行数 × 最も長い行) です。"), + ("This equation is too large to draw.", "この数式は大きすぎて描画できません。"), + ("This equation could not be laid out.", "この数式をレイアウトできませんでした。"), ("Saved macro “{name}” ({steps} step)", "マクロ「{name}」を保存しました ({steps} ステップ)"), ("Saved macro “{name}” ({steps} steps)", "マクロ「{name}」を保存しました ({steps} ステップ)"), ("without {key}: another macro took it while recording", "{key} なし: 記録中に別のマクロに割り当てられました"), diff --git a/crates/ui-egui/src/i18n/ko.rs b/crates/ui-egui/src/i18n/ko.rs index 299216a93..a0a6d3789 100644 --- a/crates/ui-egui/src/i18n/ko.rs +++ b/crates/ui-egui/src/i18n/ko.rs @@ -495,6 +495,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "그림: {alt}", "Format Control: {name}" => "컨트롤 서식: {name}", "Error at character {position}: {message}" => "{position}번째 문자에서 오류: {message}", + "Macro definitions are not supported in equations." => "수식에서는 매크로 정의가 지원되지 않습니다.", + "A % can't be combined with a link in an equation." => "수식에서 %를 링크와 함께 사용할 수 없습니다.", + "Equations can nest at most 32 levels deep." => "수식은 최대 32단계까지 중첩할 수 있습니다.", + "An equation can be at most 4096 bytes long." => "수식은 최대 4096바이트까지 입력할 수 있습니다.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "수식에는 최대 2500개의 행렬 셀(행 수 × 가장 넓은 행)을 넣을 수 있습니다." + } + "This equation is too large to draw." => "이 수식은 너무 커서 그릴 수 없습니다.", + "This equation could not be laid out." => "이 수식을 배치할 수 없습니다.", "Saved macro “{name}” ({steps} step)" => "매크로 '{name}'을(를) 저장했습니다({steps}단계)", "Saved macro “{name}” ({steps} steps)" => "매크로 '{name}'을(를) 저장했습니다({steps}단계)", "without {key}: another macro took it while recording" => "{key} 없음: 기록 중에 다른 매크로가 사용했습니다", diff --git a/crates/ui-egui/src/i18n/nl.rs b/crates/ui-egui/src/i18n/nl.rs index 3786567c9..5fd1647af 100644 --- a/crates/ui-egui/src/i18n/nl.rs +++ b/crates/ui-egui/src/i18n/nl.rs @@ -566,6 +566,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Afbeelding: {alt}", "Format Control: {name}" => "Besturingselement opmaken: {name}", "Error at character {position}: {message}" => "Fout bij teken {position}: {message}", + "Macro definitions are not supported in equations." => "Macrodefinities worden niet ondersteund in vergelijkingen.", + "A % can't be combined with a link in an equation." => "Een % kan niet worden gecombineerd met een koppeling in een vergelijking.", + "Equations can nest at most 32 levels deep." => "Vergelijkingen kunnen maximaal 32 niveaus diep worden genest.", + "An equation can be at most 4096 bytes long." => "Een vergelijking kan maximaal 4096 bytes lang zijn.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Een vergelijking kan maximaal 2500 matrixcellen hebben (rijen maal de breedste rij)." + } + "This equation is too large to draw." => "Deze vergelijking is te groot om te tekenen.", + "This equation could not be laid out." => "Deze vergelijking kan niet worden opgemaakt.", "Saved macro “{name}” ({steps} step)" => "Macro ‘{name}’ opgeslagen ({steps} stap)", "Saved macro “{name}” ({steps} steps)" => "Macro ‘{name}’ opgeslagen ({steps} stappen)", "without {key}: another macro took it while recording" => "zonder {key}: een andere macro heeft deze tijdens het opnemen overgenomen", diff --git a/crates/ui-egui/src/i18n/pl.rs b/crates/ui-egui/src/i18n/pl.rs index dbd326f1e..56e2513a2 100644 --- a/crates/ui-egui/src/i18n/pl.rs +++ b/crates/ui-egui/src/i18n/pl.rs @@ -1014,6 +1014,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Obraz: {alt}", "Format Control: {name}" => "Formatuj formant: {name}", "Error at character {position}: {message}" => "Błąd przy znaku {position}: {message}", + "Macro definitions are not supported in equations." => "Definicje makr nie są obsługiwane w równaniach.", + "A % can't be combined with a link in an equation." => "Znaku % nie można łączyć z linkiem w równaniu.", + "Equations can nest at most 32 levels deep." => "Równania mogą być zagnieżdżone na co najwyżej 32 poziomach.", + "An equation can be at most 4096 bytes long." => "Równanie może mieć co najwyżej 4096 bajtów.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Równanie może mieć co najwyżej 2500 komórek macierzy (wiersze razy najszerszy wiersz)." + } + "This equation is too large to draw." => "To równanie jest za duże, aby je narysować.", + "This equation could not be laid out." => "Nie można złożyć tego równania.", "Saved macro “{name}” ({steps} step)" => "Zapisano makro „{name}” ({steps} krok)", "Saved macro “{name}” ({steps} steps)" => "Zapisano makro „{name}” (liczba kroków: {steps})", "without {key}: another macro took it while recording" => "bez {key}: inne makro zajęło go podczas nagrywania", diff --git a/crates/ui-egui/src/i18n/pt.rs b/crates/ui-egui/src/i18n/pt.rs index e2af5851e..d1bf9c355 100644 --- a/crates/ui-egui/src/i18n/pt.rs +++ b/crates/ui-egui/src/i18n/pt.rs @@ -1032,6 +1032,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Imagem: {alt}", "Format Control: {name}" => "Formatar Controle: {name}", "Error at character {position}: {message}" => "Erro no caractere {position}: {message}", + "Macro definitions are not supported in equations." => "Definições de macro não são compatíveis com equações.", + "A % can't be combined with a link in an equation." => "Um % não pode ser combinado com um link em uma equação.", + "Equations can nest at most 32 levels deep." => "As equações podem ter no máximo 32 níveis de aninhamento.", + "An equation can be at most 4096 bytes long." => "Uma equação pode ter no máximo 4096 bytes.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Uma equação pode ter no máximo 2500 células de matriz (linhas vezes a linha mais larga)." + } + "This equation is too large to draw." => "Esta equação é grande demais para ser desenhada.", + "This equation could not be laid out." => "Não foi possível diagramar esta equação.", "Saved macro “{name}” ({steps} step)" => "Macro “{name}” salva ({steps} etapa)", "Saved macro “{name}” ({steps} steps)" => "Macro “{name}” salva ({steps} etapas)", "without {key}: another macro took it while recording" => "sem {key}: outra macro o usou durante a gravação", diff --git a/crates/ui-egui/src/i18n/ro.rs b/crates/ui-egui/src/i18n/ro.rs index e3ea8fb49..4aea17112 100644 --- a/crates/ui-egui/src/i18n/ro.rs +++ b/crates/ui-egui/src/i18n/ro.rs @@ -1076,6 +1076,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Imagine: {alt}", "Format Control: {name}" => "Formatare control: {name}", "Error at character {position}: {message}" => "Eroare la caracterul {position}: {message}", + "Macro definitions are not supported in equations." => "Definițiile de macrocomenzi nu sunt acceptate în ecuații.", + "A % can't be combined with a link in an equation." => "Un % nu poate fi combinat cu un link într-o ecuație.", + "Equations can nest at most 32 levels deep." => "Ecuațiile pot fi imbricate pe cel mult 32 de niveluri.", + "An equation can be at most 4096 bytes long." => "O ecuație poate avea cel mult 4096 de octeți.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "O ecuație poate avea cel mult 2500 de celule de matrice (rânduri înmulțite cu cel mai lat rând)." + } + "This equation is too large to draw." => "Această ecuație este prea mare pentru a fi desenată.", + "This equation could not be laid out." => "Această ecuație nu a putut fi așezată în pagină.", "Saved macro “{name}” ({steps} step)" => "Macrocomanda „{name}” a fost salvată ({steps} pas)", "Saved macro “{name}” ({steps} steps)" => "Macrocomanda „{name}” a fost salvată (pași: {steps})", "without {key}: another macro took it while recording" => "fără {key}: altă macrocomandă l-a preluat în timpul înregistrării", diff --git a/crates/ui-egui/src/i18n/ru.rs b/crates/ui-egui/src/i18n/ru.rs index ad8cf07f8..30754503c 100644 --- a/crates/ui-egui/src/i18n/ru.rs +++ b/crates/ui-egui/src/i18n/ru.rs @@ -499,6 +499,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Изображение: {alt}", "Format Control: {name}" => "Формат элемента управления: {name}", "Error at character {position}: {message}" => "Ошибка в символе {position}: {message}", + "Macro definitions are not supported in equations." => "Определения макросов в формулах не поддерживаются.", + "A % can't be combined with a link in an equation." => "Знак % нельзя сочетать со ссылкой в формуле.", + "Equations can nest at most 32 levels deep." => "Формулы могут иметь не более 32 уровней вложенности.", + "An equation can be at most 4096 bytes long." => "Длина формулы не может превышать 4096 байт.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Формула может содержать не более 2500 ячеек матрицы (строки, умноженные на самую широкую строку)." + } + "This equation is too large to draw." => "Эта формула слишком велика для отрисовки.", + "This equation could not be laid out." => "Не удалось построить эту формулу.", "Saved macro “{name}” ({steps} step)" => "Макрос «{name}» сохранён ({steps} шаг)", "Saved macro “{name}” ({steps} steps)" => "Макрос «{name}» сохранён (шагов: {steps})", "without {key}: another macro took it while recording" => "без {key}: во время записи его занял другой макрос", diff --git a/crates/ui-egui/src/i18n/sr.rs b/crates/ui-egui/src/i18n/sr.rs index 152bed722..f247c4697 100644 --- a/crates/ui-egui/src/i18n/sr.rs +++ b/crates/ui-egui/src/i18n/sr.rs @@ -486,6 +486,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Slika: {alt}", "Format Control: {name}" => "Oblikuj kontrolu: {name}", "Error at character {position}: {message}" => "Greška kod znaka {position}: {message}", + "Macro definitions are not supported in equations." => "Definicije makroa nisu podržane u jednačinama.", + "A % can't be combined with a link in an equation." => "Znak % ne može da se kombinuje sa vezom u jednačini.", + "Equations can nest at most 32 levels deep." => "Jednačine mogu da budu ugnežđene najviše 32 nivoa.", + "An equation can be at most 4096 bytes long." => "Jednačina može da ima najviše 4096 bajtova.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Jednačina može da ima najviše 2500 ćelija matrice (redovi puta najširi red)." + } + "This equation is too large to draw." => "Ova jednačina je prevelika za crtanje.", + "This equation could not be laid out." => "Ova jednačina nije mogla da se složi.", "Saved macro “{name}” ({steps} step)" => "Makro „{name}“ je sačuvan ({steps} korak)", "Saved macro “{name}” ({steps} steps)" => "Makro „{name}“ je sačuvan (broj koraka: {steps})", "without {key}: another macro took it while recording" => "bez {key}: drugi makro ga je zauzeo tokom snimanja", diff --git a/crates/ui-egui/src/i18n/tr.rs b/crates/ui-egui/src/i18n/tr.rs index af2cdb060..2f0374e42 100644 --- a/crates/ui-egui/src/i18n/tr.rs +++ b/crates/ui-egui/src/i18n/tr.rs @@ -456,6 +456,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Resim: {alt}", "Format Control: {name}" => "Denetimi Biçimlendir: {name}", "Error at character {position}: {message}" => "{position}. karakterde hata: {message}", + "Macro definitions are not supported in equations." => "Denklemlerde makro tanımları desteklenmez.", + "A % can't be combined with a link in an equation." => "Bir denklemde % bir bağlantıyla birlikte kullanılamaz.", + "Equations can nest at most 32 levels deep." => "Denklemler en fazla 32 düzey iç içe olabilir.", + "An equation can be at most 4096 bytes long." => "Bir denklem en fazla 4096 bayt uzunluğunda olabilir.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Bir denklemde en fazla 2500 matris hücresi olabilir (satır sayısı çarpı en geniş satır)." + } + "This equation is too large to draw." => "Bu denklem çizilemeyecek kadar büyük.", + "This equation could not be laid out." => "Bu denklem dizilemedi.", "Saved macro “{name}” ({steps} step)" => "“{name}” makrosu kaydedildi ({steps} adım)", "Saved macro “{name}” ({steps} steps)" => "“{name}” makrosu kaydedildi ({steps} adım)", "without {key}: another macro took it while recording" => "{key} olmadan: kayıt sırasında başka bir makro aldı", diff --git a/crates/ui-egui/src/i18n/uk.rs b/crates/ui-egui/src/i18n/uk.rs index 1a70bd53c..2a2ad2624 100644 --- a/crates/ui-egui/src/i18n/uk.rs +++ b/crates/ui-egui/src/i18n/uk.rs @@ -1018,6 +1018,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Зображення: {alt}", "Format Control: {name}" => "Формат елемента керування: {name}", "Error at character {position}: {message}" => "Помилка в символі {position}: {message}", + "Macro definitions are not supported in equations." => "Визначення макросів у формулах не підтримуються.", + "A % can't be combined with a link in an equation." => "Знак % не можна поєднувати з посиланням у формулі.", + "Equations can nest at most 32 levels deep." => "Формули можуть мати не більше 32 рівнів вкладеності.", + "An equation can be at most 4096 bytes long." => "Довжина формули не може перевищувати 4096 байт.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Формула може містити не більше 2500 клітинок матриці (рядки, помножені на найширший рядок)." + } + "This equation is too large to draw." => "Ця формула завелика для відображення.", + "This equation could not be laid out." => "Не вдалося побудувати цю формулу.", "Saved macro “{name}” ({steps} step)" => "Макрос «{name}» збережено ({steps} крок)", "Saved macro “{name}” ({steps} steps)" => "Макрос «{name}» збережено (кроків: {steps})", "without {key}: another macro took it while recording" => "без {key}: під час запису його зайняв інший макрос", diff --git a/crates/ui-egui/src/i18n/vi.rs b/crates/ui-egui/src/i18n/vi.rs index f77b90860..8e1e9b704 100644 --- a/crates/ui-egui/src/i18n/vi.rs +++ b/crates/ui-egui/src/i18n/vi.rs @@ -456,6 +456,15 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "Ảnh: {alt}", "Format Control: {name}" => "Định dạng điều khiển: {name}", "Error at character {position}: {message}" => "Lỗi tại ký tự {position}: {message}", + "Macro definitions are not supported in equations." => "Định nghĩa macro không được hỗ trợ trong phương trình.", + "A % can't be combined with a link in an equation." => "Không thể kết hợp % với liên kết trong phương trình.", + "Equations can nest at most 32 levels deep." => "Phương trình chỉ có thể lồng nhau tối đa 32 cấp.", + "An equation can be at most 4096 bytes long." => "Phương trình chỉ có thể dài tối đa 4096 byte.", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => { + "Phương trình chỉ có thể có tối đa 2500 ô ma trận (số hàng nhân với hàng rộng nhất)." + } + "This equation is too large to draw." => "Phương trình này quá lớn để vẽ.", + "This equation could not be laid out." => "Không thể dàn trang phương trình này.", "Saved macro “{name}” ({steps} step)" => "Đã lưu macro “{name}” ({steps} bước)", "Saved macro “{name}” ({steps} steps)" => "Đã lưu macro “{name}” ({steps} bước)", "without {key}: another macro took it while recording" => "không có {key}: một macro khác đã dùng phím này khi đang ghi", diff --git a/crates/ui-egui/src/i18n/zh.rs b/crates/ui-egui/src/i18n/zh.rs index 8a8a01082..366e0f90f 100644 --- a/crates/ui-egui/src/i18n/zh.rs +++ b/crates/ui-egui/src/i18n/zh.rs @@ -487,6 +487,13 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Picture: {alt}" => "图片: {alt}", "Format Control: {name}" => "设置控件格式: {name}", "Error at character {position}: {message}" => "第 {position} 个字符处出错: {message}", + "Macro definitions are not supported in equations." => "公式中不支持宏定义。", + "A % can't be combined with a link in an equation." => "公式中的 % 不能与链接同时使用。", + "Equations can nest at most 32 levels deep." => "公式最多只能嵌套 32 层。", + "An equation can be at most 4096 bytes long." => "公式最长为 4096 字节。", + "An equation can have at most 2500 matrix cells (rows times the widest row)." => "公式最多只能有 2500 个矩阵单元格(行数乘以最宽的行)。", + "This equation is too large to draw." => "此公式太大,无法绘制。", + "This equation could not be laid out." => "无法排版此公式。", "Saved macro “{name}” ({steps} step)" => "已保存宏“{name}”({steps} 步)", "Saved macro “{name}” ({steps} steps)" => "已保存宏“{name}”({steps} 步)", "without {key}: another macro took it while recording" => "未使用 {key}: 录制时已被另一个宏占用", diff --git a/docs/localization-parity.md b/docs/localization-parity.md index ac4fd75b6..cf6d6321c 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -9,6 +9,13 @@ right-to-left sheets and full complex-script support. Part of ## Where we are (measured from source on `main`, after the 2026-10-10 merges) +- **Current state (2026-11-08).** The counts, labels and per-language rows in this section and in + the Languages table are a snapshot from the dates given there; every language since added a + catalog of its own (`crates/ui-egui/src/i18n/.rs`, 18 languages besides English), and + `cargo xtask i18n-report` lists what each one still lacks. The status bar statistics, resize + tips, sheet notes, Goal Seek and macro toasts and the equation editor's own error messages now + follow the interface language; error text from the RaTeX equation parser stays English. + Where an older bullet below says status messages are English literals, this one supersedes it. - **A first catalog exists, for the ribbon only.** `crates/ui-egui/src/i18n.rs` (merged 10-10 in #31, #104, #82; German added 10-11) adds an interface-language preference that defaults to the system language (closes #20) and a View-tab switcher, with English-keyed lookup tables: @@ -62,7 +69,9 @@ right-to-left sheets and full complex-script support. Part of ## Languages -UI strings translated are measured counts against the ~2,200 estimate. Estimates to `full` +UI strings translated are measured counts against the ~2,200 estimate, as a snapshot from when +each row was last measured (Spanish, French and Vietnamese have had catalogs since; see the current +state above and `cargo xtask i18n-report`). Estimates to `full` include the rest of the catalog work below (10–20 h, counted once), localized function names, separators, number/date formats, machine translation with agent review, and script work. @@ -110,7 +119,7 @@ language (none so far) and of localized function names. | Date | Change | Summary | |---|---|---| -| 2026-11-08 | minor | Strings built with `format!` in English now translate their template first and fill it in once (`Language::tr_fill`): status bar statistics and the circular-reference note, the column width / row height drag tip, the formula bar text for a picture in a cell, the Move or Copy and Unhide notes, the Format Control title, the equation editor's error prefix, and the Goal Seek and macro recorder/runner toasts (#3600, #3602, #3603, #3605, #3607–#3611). 17 new keys in every catalog; Average, Count, Sum and the three existing templates added to the 11 catalogs that lacked them, and Ukrainian's English placeholders for those six replaced. Numbers in these strings keep the `.` decimal point | +| 2026-11-08 | minor | Strings built with `format!` in English now translate their template first and fill it in once (`Language::tr_fill`): status bar statistics and the circular-reference note, the column width / row height drag tip, the formula bar text for a picture in a cell, the Move or Copy and Unhide notes, the Format Control title, the equation editor's error prefix and its own check messages (macro definitions, `%` with a link, nesting, length, matrix-cell and size limits; RaTeX parser errors stay English), and the Goal Seek and macro recorder/runner toasts (#3600, #3602, #3603, #3605, #3607–#3611). 24 new keys in every catalog; Average, Count, Sum and the three existing templates added to the 11 catalogs that lacked them, and Ukrainian's English placeholders for those six replaced. Numbers in these strings keep the `.` decimal point | | 2026-10-23 | minor | Missing translations are reported, never a failure: `cargo xtask i18n-report` prints, per language, the strings other catalogs translate and it lacks (plus Spanish function help rows keyed by English the function catalog no longer has) and always passes; `cargo xtask ci` runs it first. Coverage and per-language parity tests and tests of one language's exact wording are gone; UI tests take the expected text from the catalog. Duplicate-key, placeholder, context-prefix and line-shape checks stay | | 2026-10-21 | minor | Romanian interface (`ro`, Română): 970 labels covering every key of the other catalogs (`crates/ui-egui/src/i18n/ro.rs`), `ro-*` system locales, the View-tab switcher and `app.language.set`; context keys show no prefix (File › Options test). English formulas and formats; AI-assisted draft pending native-speaker review | | 2026-10-20 | minor | Japanese: furigana (`rPh` phonetic runs and `` in `xl/sharedStrings.xml`) is no longer deleted by an open + save; it is kept on the workbook and written back (a `` without runs is kept too, while duplicate texts with different readings keep only the first, reported on open). Display of the readings is still missing (`crates/xlsx/src/tests/phonetic_tests.rs`) |