From 7aaa2ac4d211d86309e2d4b05f16bf277c2d27be Mon Sep 17 00:00:00 2001 From: Martin Ball Date: Tue, 3 Nov 2026 17:45:34 +0000 Subject: [PATCH] =?UTF-8?q?CP4.3:=20review=20=E2=80=94=20Your=20languages?= =?UTF-8?q?=20picks=20the=20most=20specific=20pack,=20installed=20or=20off?= =?UTF-8?q?ered,=20as=20the=20bar=20does:=20with=20ca=20installed,=20Valen?= =?UTF-8?q?cian=20text=20still=20offers=20ca-valencia=20(CodeRabbit)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docs: the missing-pack bar is provisional before the list of packs is known; Belarusian's old label. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FypgCYmv6UJmY2QcuhfXco --- ROADMAP.md | 2 +- crates/engine/src/cmd/packs.rs | 8 +++++++- crates/engine/src/packs.rs | 5 +++-- docs/localization-parity.md | 5 ++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 498a6bc47b..96deda869b 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -143,7 +143,7 @@ Ranked, to beta (detail and remaining milestones in [docs/roadmap.md](docs/roadm - 2026-11-03: Security: `.doc` import keeps one width, shading, alignment and merge override per table cell, the last one winning as before, instead of a copy every time a paragraph's properties repeat the sprm, so a shared PAPX can't pile up copies on every paragraph mark. Readiness unchanged. - 2026-11-03: Security: `.doc` import attaches each section to the paragraph that ends it through an index of paragraph ends, instead of scanning every paragraph for every section, so a file with a thousand sections that end nowhere can't multiply the work over its paragraphs. Readiness unchanged. - 2026-11-03: Options › Language (CP4.3): **Your languages** lists English, every installed Language pack and the languages of the open document, each with where its proofing comes from (Built in, Installed, Your own dictionary, System dictionary, Grammar built in, Not available yet) and Install, Remove and Set as default; **Add a language…** opens a picker with search (dutch, nederlands, nl), sorted by name, and its first click is the consent to download. The folder of your own dictionaries moved here from Options › Proofing. Gap 8. -- 2026-11-03: Language lists (CP4.3): a language installed from a Language pack (Bulgarian, say) can now be chosen. Set Proofing Language lists every built-in language and every installed or available pack's, each once and sorted by name; Review › Language and the status bar's menu add the installed packs' languages to the short list, with one way of working out the check mark. A pack's language is stored as a tag that finds the pack again (`sr-Latn-RS` is proofed by the Latin `sr-latn` pack, not the Cyrillic one). Every pack in language-packs-2 has an English name (Belarusian showed as Беларуская). Readiness unchanged. +- 2026-11-03: Language lists (CP4.3): a language installed from a Language pack (Bulgarian, say) can now be chosen. Set Proofing Language lists every built-in language and every installed or available pack's, each once and sorted by name; Review › Language and the status bar's menu add the installed packs' languages to the short list, with one way of working out the check mark. A pack's language is stored as a tag that finds the pack again (`sr-Latn-RS` is proofed by the Latin `sr-latn` pack, not the Cyrillic one). Every pack in language-packs-2 now has an English name (Belarusian used to show its own name, Беларуская). Readiness unchanged. - 2026-11-03: Language packs (CP4.3): on a fresh install (or after an upgrade, with the list cached for an older pin) the missing-pack bar still offers a document language that has no dictionary, "Turkish proofing isn't installed. Install": the person's click turns on downloading, fetches the list and installs the pack if it lists one (if not, the bar goes). With downloading already on, a missing or stale list is fetched once in the background. Choosing a language with only the caret counts before anything is typed, and the spelling context menu's heading (Possible spelling mistake) is in the interface language, not the text's. Readiness unchanged. - 2026-11-03: Language packs: language-packs-2 is published and WordCraft pins its index: 75 languages, adding Danish, German (Germany, Austria, Switzerland), Esperanto, Estonian, Persian, Croatian, Hungarian, Norwegian (Bokmål, Nynorsk), Dutch (#4145, #2505) and Swedish (Sweden, Finland), which need craft-proof's flag-based compounding (storytold/craft-libs#497, pinned). English (Australia) is checked against SCOWL's en-AU list as well as en-GB's (storytold/craft-libs#496). Mongolian and Thai stay hidden. Readiness unchanged. - 2026-11-02: Language packs (CP4.4): craft-i18n's first pack release, language-packs-1, is published and WordCraft pins its index (sha256): 61 languages install from File › Options › Language, among them Lithuanian (#4707), Romanian (#3438), Catalan (#2895, #4947), French (#1325), Greek (#2561), Slovak (#3806), Serbian (#4968) and Latvian (#4438). Dutch (#4145, #2505), German and the other compounding languages wait on craft-proof engine support. Readiness unchanged. diff --git a/crates/engine/src/cmd/packs.rs b/crates/engine/src/cmd/packs.rs index 2921a37669..a3b3308adc 100644 --- a/crates/engine/src/cmd/packs.rs +++ b/crates/engine/src/cmd/packs.rs @@ -244,11 +244,17 @@ mod tests { v.locale = "ca-valencia".into(); v.size = 1_500_000; b.packs.push(v); - with_backend(b, |s, _| { + with_backend(b, |s, b| { s.run("document.setText", &json!({"text": "Bon dia"})).unwrap(); mark(s, 0, "ca-ES-valencia"); let rows = packs::your_languages_with(s, None, &none); assert_eq!(row(&rows, "ca-ES-valencia").pack.as_deref(), Some("ca-valencia"), "as the bar offers it"); + // Installing the Catalan pack doesn't make Valencian installed. + b.network.store(true, Ordering::Relaxed); + s.run("proof.installPack", &json!({"locale": "ca"})).unwrap(); + let rows = packs::your_languages_with(s, None, &none); + let v = row(&rows, "ca-ES-valencia"); + assert_eq!((v.pack.as_deref(), v.installed, v.proofing), (Some("ca-valencia"), false, Proofing::Install)); }); } diff --git a/crates/engine/src/packs.rs b/crates/engine/src/packs.rs index 1eb363dc91..607c7b2667 100644 --- a/crates/engine/src/packs.rs +++ b/crates/engine/src/packs.rs @@ -871,8 +871,9 @@ pub fn your_languages_with(s: &Session, folder: Option<&str>, dictionary: &dyn F if !proofable(t) { continue; } - let locale = - locale_for_tag(t, &|l| installed.iter().any(|i| i.locale == l)).or_else(|| locale_for_tag(t, &|l| index.iter().any(|p| p.locale == l))); + // The most specific pack, installed or offered, as the bar picks it ([`pack_for_tag`]): with + // `ca` installed, Valencian text is still the `ca-valencia` pack's row. + let locale = locale_for_tag(t, &|l| installed.iter().any(|i| i.locale == l) || index.iter().any(|p| p.locale == l)); add(Some(t), locale); } for i in &installed { diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 21e9fc441d..a487158c2b 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -178,7 +178,10 @@ pinned pack index and installed through the font store into `/langua `proof.removePack` for agents). A pack is read at once; the lookup order is the dictionaries folder, the installed pack, then the system's Hunspell dictionaries. - A document with text in a language whose pack is available but not installed shows a bar - offering it; it never shows for a language without a pack, and closes per document. + offering it, and closes per document. Once the list of packs is known it never shows for a + language without a pack; before then (a fresh install) it offers a language with no dictionary + provisionally: Install fetches the list, then installs the pack if there is one, and the bar goes + if there isn't. - Help › About › Language data shows the full licence texts of the embedded English data and the installed packs. - One language list: Set Proofing Language lists the built-in languages and every installed or