From 28086016fe2743e1f42db5634d40cd67d84e7944 Mon Sep 17 00:00:00 2001 From: nihilist-narwhal <240798405+nihilist-narwhal@users.noreply.github.com> Date: Mon, 26 Oct 2026 09:21:43 -0500 Subject: [PATCH 1/2] i18n: Paste Special's Add and Text to Columns' Comma get their own keys "Add" is both a Paste Special operation and the Solver's Add button, and "Comma" both the Text to Columns delimiter and the Comma cell style. One translation can't fit both (Spanish Excel: Sumar vs Agregar, Coma vs Millares), and open PRs are about to translate the Solver button and the cell-style gallery. The two dialog options now use `Paste Special|Add` and `Text to Columns|Comma`; English shows the same labels and every catalog carries its current translation onto the new key, so nothing visible changes. A test checks both. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/dialogs.rs | 10 ++++++++-- crates/ui-egui/src/i18n.rs | 17 +++++++++++++++++ crates/ui-egui/src/i18n/el.rs | 2 ++ crates/ui-egui/src/i18n/it.rs | 2 ++ crates/ui-egui/src/i18n/ja.rs | 2 ++ crates/ui-egui/src/i18n/pl.rs | 2 ++ crates/ui-egui/src/i18n/pt.rs | 2 ++ crates/ui-egui/src/i18n/ro.rs | 2 ++ crates/ui-egui/src/i18n/uk.rs | 2 ++ docs/localization-parity.md | 3 ++- 10 files changed, 41 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 47b215302e..2513c1e112 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -506,7 +506,13 @@ impl Dialog { Choice { key: "operation", label: "Operation", - options: vec![("none", "None"), ("add", "Add"), ("subtract", "Subtract"), ("multiply", "Multiply"), ("divide", "Divide")], + options: vec![ + ("none", "None"), + ("add", "Paste Special|Add"), + ("subtract", "Subtract"), + ("multiply", "Multiply"), + ("divide", "Divide"), + ], }, Check { key: "skipBlanks", label: "Skip blanks" }, Check { key: "transpose", label: "Transpose (E)" }, @@ -648,7 +654,7 @@ impl Dialog { vec![ Check { key: "tab", label: "Tab" }, Check { key: "semicolon", label: "Semicolon" }, - Check { key: "comma", label: "Comma" }, + Check { key: "comma", label: "Text to Columns|Comma" }, Check { key: "space", label: "Space" }, Text { key: "other", label: "Other:" }, Check { key: "treatConsecutive", label: "Treat consecutive delimiters as one" }, diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index 0ffd0ad09c..6e4b7c052b 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -418,6 +418,23 @@ mod tests { } } + #[test] + fn paste_special_add_and_text_to_columns_comma_have_their_own_keys() { + // "Add" is also the Solver button and "Comma" also the cell style (Spanish Excel: Sumar + // vs Agregar, Coma vs Millares), so the two dialog options are keyed by context. English + // shows the plain label, and every catalog shows what it showed before the split. + for (keyed, plain) in [("Paste Special|Add", "Add"), ("Text to Columns|Comma", "Comma")] { + assert_eq!(Language::En.tr(keyed), plain); + for language in Language::ALL { + let shown = language.tr(keyed); + assert!(!shown.contains('|'), "{} shows a context prefix for {keyed}: {shown}", language.code()); + if language.tr(plain) != plain { + assert_eq!(shown, language.tr(plain), "{}: {keyed}", language.code()); + } + } + } + } + #[test] fn translations_never_show_the_context_prefix() { // `tr` returns a found translation as it is, so a catalog that keeps `context|` in its diff --git a/crates/ui-egui/src/i18n/el.rs b/crates/ui-egui/src/i18n/el.rs index 2a7449fd66..d30bd20e09 100644 --- a/crates/ui-egui/src/i18n/el.rs +++ b/crates/ui-egui/src/i18n/el.rs @@ -667,6 +667,7 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Values and number formats" => "Τιμές και μορφές αριθμών", "Operation" => "Πράξη", "Add" => "Πρόσθεση", + "Paste Special|Add" => "Πρόσθεση", "Subtract" => "Αφαίρεση", "Multiply" => "Πολλαπλασιασμός", "Divide" => "Διαίρεση", @@ -704,6 +705,7 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Tab" => "Στηλοθέτης", "Semicolon" => "Ερωτηματικό (;)", "Comma" => "Κόμμα", + "Text to Columns|Comma" => "Κόμμα", "Space" => "Διάστημα", "Other:" => "Άλλο:", "Treat consecutive delimiters as one" => "Αντιμετώπιση διαδοχικών διαχωριστικών ως ενός", diff --git a/crates/ui-egui/src/i18n/it.rs b/crates/ui-egui/src/i18n/it.rs index 24fa45c959..631c7cf070 100644 --- a/crates/ui-egui/src/i18n/it.rs +++ b/crates/ui-egui/src/i18n/it.rs @@ -549,6 +549,7 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Values and number formats" => "Valori e formati numero", "Operation" => "Operazione", "Add" => "Aggiungi", + "Paste Special|Add" => "Aggiungi", "Subtract" => "Sottrai", "Multiply" => "Moltiplica", "Divide" => "Dividi", @@ -588,6 +589,7 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Tab" => "Tabulazione", "Semicolon" => "Punto e virgola", "Comma" => "Virgola", + "Text to Columns|Comma" => "Virgola", "Space" => "Spazio", "Other:" => "Altro:", "Treat consecutive delimiters as one" => "Considera delimitatori consecutivi come uno solo", diff --git a/crates/ui-egui/src/i18n/ja.rs b/crates/ui-egui/src/i18n/ja.rs index a659da7442..d6fb4352db 100644 --- a/crates/ui-egui/src/i18n/ja.rs +++ b/crates/ui-egui/src/i18n/ja.rs @@ -566,6 +566,7 @@ pub(super) const DIALOGS: &[(&str, &str)] = &[ ("Values and number formats", "値と数値の書式"), ("Operation", "演算"), ("Add", "加算"), + ("Paste Special|Add", "加算"), ("Subtract", "減算"), ("Multiply", "乗算"), ("Divide", "除算"), @@ -605,6 +606,7 @@ pub(super) const DIALOGS: &[(&str, &str)] = &[ ("Tab", "タブ"), ("Semicolon", "セミコロン"), ("Comma", "コンマ"), + ("Text to Columns|Comma", "コンマ"), ("Space", "スペース"), ("Other:", "その他:"), ("Treat consecutive delimiters as one", "連続した区切り文字は 1 文字として扱う"), diff --git a/crates/ui-egui/src/i18n/pl.rs b/crates/ui-egui/src/i18n/pl.rs index d232a6e0de..279bb1e576 100644 --- a/crates/ui-egui/src/i18n/pl.rs +++ b/crates/ui-egui/src/i18n/pl.rs @@ -540,6 +540,7 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Values and number formats" => "Wartości i formaty liczb", "Operation" => "Operacja", "Add" => "Dodaj", + "Paste Special|Add" => "Dodaj", "Subtract" => "Odejmij", "Multiply" => "Pomnóż", "Divide" => "Podziel", @@ -579,6 +580,7 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Tab" => "Tabulator", "Semicolon" => "Średnik", "Comma" => "Przecinek", + "Text to Columns|Comma" => "Przecinek", "Space" => "Spacja", "Other:" => "Inny:", "Treat consecutive delimiters as one" => "Traktuj kolejne ograniczniki jako jeden", diff --git a/crates/ui-egui/src/i18n/pt.rs b/crates/ui-egui/src/i18n/pt.rs index d930543099..4f6c0f4f77 100644 --- a/crates/ui-egui/src/i18n/pt.rs +++ b/crates/ui-egui/src/i18n/pt.rs @@ -574,6 +574,7 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Values and number formats" => "Valores e formatos de número", "Operation" => "Operação", "Add" => "Adicionar", + "Paste Special|Add" => "Adicionar", "Subtract" => "Subtrair", "Multiply" => "Multiplicar", "Divide" => "Dividir", @@ -613,6 +614,7 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Tab" => "Tabulação", "Semicolon" => "Ponto e vírgula", "Comma" => "Vírgula", + "Text to Columns|Comma" => "Vírgula", "Space" => "Espaço", "Other:" => "Outros:", "Treat consecutive delimiters as one" => "Considerar delimitadores consecutivos como um só", diff --git a/crates/ui-egui/src/i18n/ro.rs b/crates/ui-egui/src/i18n/ro.rs index 0876ac50f5..f2c7395cba 100644 --- a/crates/ui-egui/src/i18n/ro.rs +++ b/crates/ui-egui/src/i18n/ro.rs @@ -546,6 +546,7 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Values and number formats" => "Valori și formate de număr", "Operation" => "Operație", "Add" => "Adăugare", + "Paste Special|Add" => "Adăugare", "Subtract" => "Scădere", "Multiply" => "Înmulțire", "Divide" => "Împărțire", @@ -585,6 +586,7 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Tab" => "Tab", "Semicolon" => "Punct și virgulă", "Comma" => "Virgulă", + "Text to Columns|Comma" => "Virgulă", "Space" => "Spațiu", "Other:" => "Altele:", "Treat consecutive delimiters as one" => "Delimitatorii consecutivi se tratează ca unul singur", diff --git a/crates/ui-egui/src/i18n/uk.rs b/crates/ui-egui/src/i18n/uk.rs index 4374cc1359..53cd57f76c 100644 --- a/crates/ui-egui/src/i18n/uk.rs +++ b/crates/ui-egui/src/i18n/uk.rs @@ -544,6 +544,7 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Values and number formats" => "Values and number formats", "Operation" => "Operation", "Add" => "Add", + "Paste Special|Add" => "Add", "Subtract" => "Subtract", "Multiply" => "Multiply", "Divide" => "Divide", @@ -583,6 +584,7 @@ pub(super) fn translate(text: &str) -> Option<&'static str> { "Tab" => "Tab", "Semicolon" => "Semicolon", "Comma" => "Comma", + "Text to Columns|Comma" => "Comma", "Space" => "Space", "Other:" => "Other:", "Treat consecutive delimiters as one" => "Treat consecutive delimiters as one", diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 1de2927ac6..eef37d88af 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,6 +1,6 @@ # Localization parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-10 · **Change:** minor (Ukrainian Chart is Діаграма); previously minor (Diagram and Decorative Text labels, Diagram distinct from Chart); previously minor (CJK fallback baseline alignment); previously minor (Arabic bidi display, editing and cell reading direction; missing translations are listed by `cargo xtask i18n-report` and never fail a check); previously minor (Arabic font fallback; missing translations are listed by `cargo xtask i18n-report` and never fail a check); previously minor (number formats honour the `B1`/`B2` calendar prefixes, checked against Excel; earlier: missing translations are listed by `cargo xtask i18n-report` and never fail a check; Arabic text sorts by its letters, not its vowel marks); previously minor (AutoFit estimates Arabic text width from measured glyph widths); previously minor (missing translations are listed by `cargo xtask i18n-report` and never fail a check; Arabic text sorts by its letters, not its vowel marks) · **Target:** Microsoft Excel (Microsoft 365), Excel for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-14 · **Change:** minor (Paste Special's Add and Text to Columns' Comma get their own keys); previously minor (Ukrainian Chart is Діаграма); previously minor (Diagram and Decorative Text labels, Diagram distinct from Chart); previously minor (CJK fallback baseline alignment); previously minor (Arabic bidi display, editing and cell reading direction; missing translations are listed by `cargo xtask i18n-report` and never fail a check); previously minor (Arabic font fallback; missing translations are listed by `cargo xtask i18n-report` and never fail a check); previously minor (number formats honour the `B1`/`B2` calendar prefixes, checked against Excel; earlier: missing translations are listed by `cargo xtask i18n-report` and never fail a check; Arabic text sorts by its letters, not its vowel marks); previously minor (AutoFit estimates Arabic text width from measured glyph widths); previously minor (missing translations are listed by `cargo xtask i18n-report` and never fail a check; Arabic text sorts by its letters, not its vowel marks) · **Target:** Microsoft Excel (Microsoft 365), Excel for Mac 16.113.4 Per-language status against Excel, which ships its UI in dozens of languages (Windows language packs cover 100+), with localized function names, argument separators, number and date formats, @@ -140,6 +140,7 @@ language (none so far) and of localized function names. | 2026-10-26 | minor | Arabic text renders in cells and the interface: a system Arabic face (Tahoma, Arial or Segoe UI on Windows, Geeza Pro on macOS, Noto Sans or Naskh Arabic on Linux) joins the script fallbacks, fontconfig's Arabic choice, when it has Arabic letters, leads the Arabic fallbacks and draws Arabic wherever the UI or cell font has none, such as the default cell fonts (part of #229; a UI font with Arabic of its own, such as DejaVu Sans in the Flatpak, still draws interface Arabic, left for a follow-up), and craft-fonts' Noto Sans Arabic is a required face allowed on the web. Workbook fonts without Arabic keep every script fallback. Shaping and bidirectional layout remain separate work | | 2026-10-27 | minor | Number formats honour the `B1`/`B2` calendar prefixes: never shown; `B2` renders year, month, day and Arabic month and weekday names in the tabular Hijri calendar (1 Jan 2001 = 6 Shawwal 1421; leap years 2, 5, 7, 10, 13, 15, 18, 21, 24, 26 and 29 of the 30-year cycle, which is what Excel shows). Checked against Excel 16.0 (build 20527, en-US) on every serial and about 1,700 format/value pairs: a locale or currency tag before `B2` keeps the date Gregorian, a misplaced `B` and digit or a prefix before a number format is rejected, serial 60 has no Hijri date, serial 0 shows as serial 1, two-word month names use a no-break space. Not matched: Excel's weekday/month-name mix-ups in one `B2` section and its weekday-only quirks | | 2026-10-27 | minor | AutoFit column width, wrapped-row height and PivotTable column fit estimate Arabic letters at ~0.48 em (measured 0.36–0.53 em shaped, Noto Sans/Naskh Arabic and DejaVu Sans) instead of 1 em, Arabic-Indic digits as wide as ASCII digits, and give vowel marks and direction marks no width; vowelled Arabic no longer fits ~3.5× too wide | +| 2026-10-26 | minor | Paste Special's Add operation and Text to Columns' Comma delimiter are keyed `Paste Special|Add` and `Text to Columns|Comma`, so they can be translated apart from the Solver's Add button and the Comma cell style (Spanish: Sumar vs Agregar, Coma vs Millares); every catalog keeps the text it showed | | 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`) | From ad7ec8d775166adb622ccd36879ab56123c06d65 Mon Sep 17 00:00:00 2001 From: nihilist-narwhal <240798405+nihilist-narwhal@users.noreply.github.com> Date: Mon, 26 Oct 2026 09:23:49 -0500 Subject: [PATCH 2/2] i18n: the key-split test lets a catalog translate the two uses differently The test required `Paste Special|Add` and `Text to Columns|Comma` to show the same text as the plain keys, which forbids the very split it guards (Spanish: Sumar vs Agregar). It now checks that a catalog translating the plain label also translates the keyed one. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/i18n.rs | 5 +++-- docs/localization-parity.md | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index 6e4b7c052b..4453a14465 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -422,14 +422,15 @@ mod tests { fn paste_special_add_and_text_to_columns_comma_have_their_own_keys() { // "Add" is also the Solver button and "Comma" also the cell style (Spanish Excel: Sumar // vs Agregar, Coma vs Millares), so the two dialog options are keyed by context. English - // shows the plain label, and every catalog shows what it showed before the split. + // shows the plain label, and a catalog that translates the plain label translates the + // keyed one too, so the dialog option doesn't fall back to English. for (keyed, plain) in [("Paste Special|Add", "Add"), ("Text to Columns|Comma", "Comma")] { assert_eq!(Language::En.tr(keyed), plain); for language in Language::ALL { let shown = language.tr(keyed); assert!(!shown.contains('|'), "{} shows a context prefix for {keyed}: {shown}", language.code()); if language.tr(plain) != plain { - assert_eq!(shown, language.tr(plain), "{}: {keyed}", language.code()); + assert_ne!(shown, plain, "{} translates {plain:?} but not {keyed:?}", language.code()); } } } diff --git a/docs/localization-parity.md b/docs/localization-parity.md index eef37d88af..759c813e1c 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -140,7 +140,7 @@ language (none so far) and of localized function names. | 2026-10-26 | minor | Arabic text renders in cells and the interface: a system Arabic face (Tahoma, Arial or Segoe UI on Windows, Geeza Pro on macOS, Noto Sans or Naskh Arabic on Linux) joins the script fallbacks, fontconfig's Arabic choice, when it has Arabic letters, leads the Arabic fallbacks and draws Arabic wherever the UI or cell font has none, such as the default cell fonts (part of #229; a UI font with Arabic of its own, such as DejaVu Sans in the Flatpak, still draws interface Arabic, left for a follow-up), and craft-fonts' Noto Sans Arabic is a required face allowed on the web. Workbook fonts without Arabic keep every script fallback. Shaping and bidirectional layout remain separate work | | 2026-10-27 | minor | Number formats honour the `B1`/`B2` calendar prefixes: never shown; `B2` renders year, month, day and Arabic month and weekday names in the tabular Hijri calendar (1 Jan 2001 = 6 Shawwal 1421; leap years 2, 5, 7, 10, 13, 15, 18, 21, 24, 26 and 29 of the 30-year cycle, which is what Excel shows). Checked against Excel 16.0 (build 20527, en-US) on every serial and about 1,700 format/value pairs: a locale or currency tag before `B2` keeps the date Gregorian, a misplaced `B` and digit or a prefix before a number format is rejected, serial 60 has no Hijri date, serial 0 shows as serial 1, two-word month names use a no-break space. Not matched: Excel's weekday/month-name mix-ups in one `B2` section and its weekday-only quirks | | 2026-10-27 | minor | AutoFit column width, wrapped-row height and PivotTable column fit estimate Arabic letters at ~0.48 em (measured 0.36–0.53 em shaped, Noto Sans/Naskh Arabic and DejaVu Sans) instead of 1 em, Arabic-Indic digits as wide as ASCII digits, and give vowel marks and direction marks no width; vowelled Arabic no longer fits ~3.5× too wide | -| 2026-10-26 | minor | Paste Special's Add operation and Text to Columns' Comma delimiter are keyed `Paste Special|Add` and `Text to Columns|Comma`, so they can be translated apart from the Solver's Add button and the Comma cell style (Spanish: Sumar vs Agregar, Coma vs Millares); every catalog keeps the text it showed | +| 2026-10-26 | minor | Paste Special's Add operation and Text to Columns' Comma delimiter are keyed `Paste Special\|Add` and `Text to Columns\|Comma`, so they can be translated apart from the Solver's Add button and the Comma cell style (Spanish: Sumar vs Agregar, Coma vs Millares); every catalog keeps the text it showed | | 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`) |