diff --git a/README.md b/README.md index 908e8ec07b..42d0e27b82 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ Every screenshot below is WordCraft itself, rendered offscreen by its own UI tes | **References** | Table of contents, footnotes and endnotes, citations and bibliography (APA, MLA, Chicago, IEEE), captions, table of figures, cross-references, index, table of authorities | | **Review** | Spelling and grammar with suggestions (English and Polish, by each run's language), thesaurus, word count, comments in margin balloons or a pane, track changes, accept/reject, compare documents, restrict editing, accessibility checker, document inspector | | **Mailings** | Mail merge from CSV, merge fields, address block, greeting line, rules, preview, finish to a document; envelopes and labels | -| **View** | Print layout, web layout, draft, read mode, focus, zoom, one/multiple pages, page width, Navigation pane, rulers, gridlines, dark mode; interface in English, 简体中文, 繁體中文, 日本語, Português (Brasil), Español, Українська, Српски / Srpski, Eesti, Türkçe, Русский, Italiano, Deutsch, Polski, Čeština, Magyar, Français, Български, Tiếng Việt, 한국어, Svenska, Hrvatski, Nederlands, Dansk, Română, العربية (mirrored) or Slovenščina (follows the system language by default) | +| **View** | Print layout, web layout, draft, read mode, focus, zoom, one/multiple pages, page width, Navigation pane, rulers, gridlines, dark mode; interface in English, 简体中文, 繁體中文, 日本語, Português (Brasil), Español, Українська, Српски / Srpski, Eesti, Türkçe, Русский, Italiano, Deutsch, Polski, Čeština, Magyar, Français, Български, Tiếng Việt, 한국어, Svenska, Hrvatski, Nederlands, Dansk, Română, العربية (mirrored) Slovenščina or Bosanski (follows the system language by default) | | **Files** | .docx read/write, legacy 97-2003 .doc import, PDF export, .odt, .rtf, .html, .md, .tex, .txt import/export, page images | The honest picture, area by area, is in [ROADMAP.md](ROADMAP.md), the diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index 149de39efa..3e0026b2f1 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -70,7 +70,7 @@ pub struct LangInfo { /// The languages WordCraft offers, when their catalogs are embedded. English first: it is the /// fallback and the source language. -pub static LANGUAGES: [LangInfo; 28] = [ +pub static LANGUAGES: [LangInfo; 29] = [ LangInfo { code: "en", prefer_hans: false, editing_lang: None }, // Simplified Chinese; `zh`, `zh-CN`, `zh-SG` and `zh-Hans-*` resolve here (the crate's matching). LangInfo { code: "zh-hans", prefer_hans: true, editing_lang: None }, @@ -129,6 +129,9 @@ pub static LANGUAGES: [LangInfo; 28] = [ LangInfo { code: "ar", prefer_hans: false, editing_lang: None }, // Slovenian; `sl`, `sl-SI` and `sl_SI.UTF-8` resolve here. LangInfo { code: "sl", prefer_hans: false, editing_lang: None }, + // Bosnian, Latin script; `bs`, `bs-BA`, `bs_BA.UTF-8` and `bs-Latn-BA` resolve here. Cyrillic + // Bosnian (`bs-Cyrl-*`) has no catalog, so it stays in English. + LangInfo { code: "bs", prefer_hans: false, editing_lang: None }, ]; /// Interface languages written right to left. Their catalogs are written in typing order and diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index f891385d8d..adf6edd714 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -1143,6 +1143,75 @@ fn bundled_interface_fonts_cover_slovenian_letters() { assert!(!lang("sl").uses_cjk()); } +/// Bosnian (Latin script) follows `bs-BA` system locales and a saved choice, and choosing it leaves +/// the document as it was. Cyrillic Bosnian has no catalog: a script is never crossed. +#[test] +fn bosnian_locales_and_saved_preference_work_without_changing_the_document() { + needs_catalogs!(); + let bs = lang("bs"); + for tag in ["bs", "bs-BA", "bs_BA.UTF-8", "BS-ba", "bs-Latn-BA"] { + assert_eq!(lang_from_tag(tag), Some(bs), "{tag}"); + } + assert_eq!(lang_from_tag("bs-Cyrl-BA"), None, "Cyrillic Bosnian has no catalog"); + assert_eq!(first_supported([UNSUPPORTED, "bs-BA", "en-US"]), Some(bs)); + let mut app = crate::WordApp::new(wordcraft_engine::Session::new(wordcraft_doc::Document::new()), Default::default()); + let before = serde_json::to_value(&app.session.doc).unwrap(); + let result = app.run("ui.language", serde_json::json!({"value": "BS"})).unwrap(); + assert_eq!(result["effective"], "bs"); + assert_eq!(app.ui.language, "bs"); + assert!(result["available"].as_array().unwrap().iter().any(|l| l["code"] == "bs" && l["name"] == "Bosanski")); + assert_eq!(serde_json::to_value(&app.session.doc).unwrap(), before); + let saved = serde_json::to_string(&app.ui).unwrap(); + let restored: crate::UiState = serde_json::from_str(&saved).unwrap(); + assert_eq!(Lang::from_pref(&restored.language), bs); + assert_eq!(bs.editing_lang(), None, "WordCraft doesn't proof Bosnian, so documents stay in its default"); + assert!(!bs.uses_cjk()); +} + +/// Bosnian counts take CLDR's three forms through the embedded catalog: `one` for 1, 21, 101 (not +/// 11), `few` for 2–4, 22–24 (not 12–14) and `other` for the rest. +#[test] +fn bosnian_plurals_take_one_few_other() { + needs_catalogs!(); + let bs = lang("bs"); + let count = |n| I18N.trn_plain(bs.lang, n, "{n} item", "{n} items"); + for (n, want) in [ + (1, "1 stavka"), + (21, "21 stavka"), + (101, "101 stavka"), + (2, "2 stavke"), + (4, "4 stavke"), + (22, "22 stavke"), + (0, "0 stavki"), + (5, "5 stavki"), + (11, "11 stavki"), + (12, "12 stavki"), + (14, "14 stavki"), + (111, "111 stavki"), + ] { + assert_eq!(count(n), want, "{n}"); + } +} + +/// The bundled interface faces draw every Bosnian letter (č ć đ š ž), every other accented letter +/// the catalog uses, and its punctuation, without a system fallback. +#[test] +fn bundled_interface_fonts_cover_bosnian_letters() { + let db = wordcraft_fonts::FontDb::with_font_dirs(Vec::new()); + needs_catalogs!(); + let extra = ['č', 'ć', 'đ', 'š', 'ž', 'Č', 'Ć', 'Đ', 'Š', 'Ž', '„', '”', '–', '…']; + // Every accented Latin letter the catalog uses (Latin-1 and Latin Extended-A), and the above. + let accented = |c: &char| ('\u{C0}'..='\u{17F}').contains(c) && c.is_alphabetic(); + let chars: std::collections::HashSet = translations("bs").iter().flat_map(|e| e.chars()).filter(accented).chain(extra).collect(); + for (family, style) in [("Inter", "Regular"), ("Inter", "Medium"), ("Inter", "SemiBold"), ("JetBrains Mono", "Regular")] { + let face = db.face(family, style); + assert_eq!(face.family, family, "must use the bundled interface face"); + for ch in &chars { + assert_ne!(face.glyph_for(*ch), 0, "{family} {style} lacks {ch}"); + } + } +} + /// The "Open" paragraph-spacing preset is roomy spacing, not the file verb: only a `spacing` row /// translates it. #[test] diff --git a/docs/localization-bs.md b/docs/localization-bs.md new file mode 100644 index 0000000000..8ddafcbd16 --- /dev/null +++ b/docs/localization-bs.md @@ -0,0 +1,67 @@ +# Bosnian interface + +> **Last reviewed:** 2026-10-29 · **Last updated:** 2026-10-29 · **Change:** major (first version) · **Target:** WordCraft 0.7.0 + +Choose **File › Options › Interface language › Bosanski**, or follow a Bosnian system display +language (`bs-BA`, `bs_BA.UTF-8`, `bs-Latn-BA`). The catalog code is `bs`; `ui.language` with +`{"value":"bs"}` selects it explicitly, and `WORDCRAFT_LANGUAGE=bs-BA` does the same for a headless +screenshot or a launch while the preference is `auto`. Document text, command ids, CLI/MCP/control +responses and file paths do not change. + +The catalog is craft-i18n's `locales/bs/wordcraft.tsv` (storytold/craft-i18n, 2,508 entries) over the +shared `locales/bs/common.tsv`. Both are embedded from the +craft-i18n commit pinned in `craft-i18n.rev` (1e51542…), which includes them. The +catalog is written from the meaning of the English labels; no proprietary translation resources were +consulted. It is an AI-assisted draft that a native speaker has not yet reviewed. + +## Conventions + +- Latin script, ijekavian, standard Bosnian vocabulary where the neighbouring languages differ: + *historija*, *sačuvaj*, *tačka*, *hiljada*, *sedmica*, *datoteka*, *postavke*. Cyrillic Bosnian + (`bs-Cyrl-*`) has no catalog and stays in English. +- Commands and buttons use the imperative (`Sačuvaj`, `Umetni fusnotu`, `Prihvati`); ribbon groups + and panes are nouns (`Pasus`, `Stilovi`, `Navigacijsko okno`). +- Messages address the user with the polite plural (`Unesite lozinku`). +- Only the first word of a label is capitalised. +- `@plural` rows use Bosnian's three CLDR forms, `one|few|other` (`{n} stavka|{n} stavke|{n} + stavki`); the `craft-i18n` crate picks the form from CLDR's rules. +- Quotation marks „…”; placeholders, a trailing `…` and the spaces around joined fragments match the + English. + +## Terminology + +| Source | Bosnian | +|---|---| +| File / Home / Insert / Draw / Design / Layout | Datoteka / Početna / Umetni / Crtaj / Dizajn / Raspored | +| References / Mailings / Review / View / Help | Reference / Pošiljke / Pregled izmjena / Prikaz / Pomoć | +| Font / Paragraph / Styles | Font / Pasus / Stilovi | +| Header / Footer / Heading | Zaglavlje / Podnožje / Naslov | +| Footnotes / Endnotes / Caption | Fusnote / Krajnje bilješke / Natpis | +| Table of Contents / Index | Sadržaj / Indeks | +| Citations / Citation Style / Bibliography | Citati / Stil citiranja / Bibliografija | +| Track Changes / Accept / Reject | Praćenje promjena / Prihvati / Odbij | +| Comment / Show Markup | Komentar / Prikaži oznake | +| Mail Merge | Spajanje pošte | +| Sections / Section Break | Odjeljci / Prelom odjeljka | +| Undo / Redo | Poništi / Ponovi | +| Ribbon / Navigation Pane / Quick Access Toolbar | Traka / Navigacijsko okno / Traka za brzi pristup | +| Bold / Italic / Underline / Strikethrough | Podebljano / Kurziv / Podvučeno / Precrtano | +| Hyphenation | Rastavljanje riječi | +| Watermark | Vodeni žig | +| Save / Save As / Open / Print | Sačuvaj / Sačuvaj kao / Otvori / Štampaj | +| Read Mode | Način čitanja | +| Text Box | Okvir za tekst | + +## Verification and remaining scope + +Tests in `crates/ui-egui/src/i18n/tests.rs` check locale selection (Cyrillic Bosnian excluded), the +saved preference, that choosing Bosnian leaves the document unchanged, and the bundled fonts' +coverage of č, ć, đ, š, ž and the catalog's punctuation. The shared checks (catalog validation and +the missing-translation report, `cargo xtask i18n-report`) include Bosnian automatically. Bosnian +spelling, grammar and hyphenation are not included. Native speaker review is welcome. + +## Revision history + +| Date | Change | Summary | +|---|---|---| +| 2026-10-29 | major | First version: Bosnian (`bs`) interface language, conventions and terminology | diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 64b934a50e..41605232c3 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -1,6 +1,6 @@ # Localization parity with Microsoft Word -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** trivial (Arabic: the Home tab's Styles gallery reads from the right, its arrows at the left (#5566); readiness unchanged); previously trivial (table sort and formulas read the Panamanian balboa's `B/.` around a number (`B/. 1,250.50`, `1,250.50 B/.`), as Word does, matched only at the ends of the text so `1/.5` stays a fraction); previously trivial (Arabic: the dialogs of the mirrored Arabic interface read right to left: label-and-field rows, tables (list columns, the Models table), tile galleries and the Add/Remove arrows follow the reading direction, through one `rtl::Table` helper that draws exactly as before in English; no ranked gap closed, readiness estimates unchanged); previously minor (Options › Language redesign: Your languages, Add a language…, Set as default; the Dictionaries folder moved from Proofing); previously trivial (Language packs: the missing-pack bar works on a fresh install and counts the caret's language); previously trivial (Language lists: every installed and available Language pack's language can be chosen in Set Proofing Language, installed ones in Review › Language and the status bar; craft-i18n.rev at 9d6d54d: region names and the Language (Region) template in 35 locales, craft-i18n#145); previously trivial (craft-i18n.rev at cde4900: rows for Options › Language, the missing-pack bar and 28 Language pack language names in 35 locales, craft-i18n#136); previously trivial (craft-proof pin: French elision suggestions first, ca-ES-valencia reads the ca-valencia pack); previously minor (Arabic `ar` interface: craft-i18n catalog, mirrored shell, font fallback, #1195; 28 languages); previously trivial (Language packs: language-packs-2 is published and pinned: 75 packs, adding Danish, German (Germany, Austria, Switzerland), Esperanto, Estonian, Persian, Croatian, Hungarian, Norwegian (Bokmål, Nynorsk), Dutch and Swedish (Sweden, Finland)); previously trivial (Language packs: language-packs-1 is published and pinned, 61 packs; the language requests it covers); previously minor (Language packs: languages beyond English install their spelling dictionary and hyphenation as a pack from File › Options › Language or the missing-pack bar; the default build embeds English Language data only) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (Bosnian interface: `bs` in the language list, `bs-BA` system locales, catalog in storytold/craft-i18n); previously trivial (Arabic: the Home tab's Styles gallery reads from the right, its arrows at the left (#5566); readiness unchanged); previously trivial (table sort and formulas read the Panamanian balboa's `B/.` around a number (`B/. 1,250.50`, `1,250.50 B/.`), as Word does, matched only at the ends of the text so `1/.5` stays a fraction); previously trivial (Arabic: the dialogs of the mirrored Arabic interface read right to left: label-and-field rows, tables (list columns, the Models table), tile galleries and the Add/Remove arrows follow the reading direction, through one `rtl::Table` helper that draws exactly as before in English; no ranked gap closed, readiness estimates unchanged); previously minor (Options › Language redesign: Your languages, Add a language…, Set as default; the Dictionaries folder moved from Proofing); previously trivial (Language packs: the missing-pack bar works on a fresh install and counts the caret's language); previously trivial (Language lists: every installed and available Language pack's language can be chosen in Set Proofing Language, installed ones in Review › Language and the status bar; craft-i18n.rev at 9d6d54d: region names and the Language (Region) template in 35 locales, craft-i18n#145); previously trivial (craft-i18n.rev at cde4900: rows for Options › Language, the missing-pack bar and 28 Language pack language names in 35 locales, craft-i18n#136); previously trivial (craft-proof pin: French elision suggestions first, ca-ES-valencia reads the ca-valencia pack); previously minor (Arabic `ar` interface: craft-i18n catalog, mirrored shell, font fallback, #1195; 28 languages); previously trivial (Language packs: language-packs-2 is published and pinned: 75 packs, adding Danish, German (Germany, Austria, Switzerland), Esperanto, Estonian, Persian, Croatian, Hungarian, Norwegian (Bokmål, Nynorsk), Dutch and Swedish (Sweden, Finland)); previously trivial (Language packs: language-packs-1 is published and pinned, 61 packs; the language requests it covers); previously minor (Language packs: languages beyond English install their spelling dictionary and hyphenation as a pack from File › Options › Language or the missing-pack bar; the default build embeds English Language data only) · **Target:** Microsoft Word (Microsoft 365) for Mac 16.113.4 Interface languages, script support and proofing per language. How translation works (adding a language, the embedded catalogs): `crates/ui-egui/src/i18n.rs`. The catalogs, their format and @@ -21,8 +21,8 @@ native-speaker review (human). ## What WordCraft ships (measured) -- **28 interface languages**: English plus `zh-hans`, `zh-hant`, `ja`, Korean `ko` (#1216), `uk`, `es`, `pt-br`, - Serbian `sr`/`sr-latn` (#250), Estonian `et`, Turkish `tr`, Russian `ru`, Italian `it` (#594), German `de` (#574), Polish `pl`, Czech `cs`, Hungarian `hu`, French `fr`, Bulgarian `bg`, Vietnamese `vi` (#1434), Swedish `sv` (#1219), Croatian `hr` (#1271), Romanian `ro`, Slovenian `sl`, Dutch `nl`, Danish `da` (#2722) and Arabic `ar` (#1195). Catalogs have 2,061–2,730 entries +- **29 interface languages**: English plus `zh-hans`, `zh-hant`, `ja`, Korean `ko` (#1216), `uk`, `es`, `pt-br`, + Serbian `sr`/`sr-latn` (#250), Estonian `et`, Turkish `tr`, Russian `ru`, Italian `it` (#594), German `de` (#574), Polish `pl`, Czech `cs`, Hungarian `hu`, French `fr`, Bulgarian `bg`, Vietnamese `vi` (#1434), Swedish `sv` (#1219), Croatian `hr` (#1271), Romanian `ro`, Slovenian `sl`, Dutch `nl`, Danish `da` (#2722) Arabic `ar` (#1195) and Bosnian `bs`. Catalogs have 2,061–2,730 entries each; Polish has every key of every other catalog, including the built-in style names and the equation gallery, except the citation style names only Hungarian, Bulgarian, Swedish, Romanian and Slovenian translate so far. A missing translation falls back to English and never fails a test or build. `cargo xtask i18n-report`, part of `cargo xtask ci`, prints per language the interface strings its catalog lacks: everything the interface audit saw looked up, the ribbon tabs, command @@ -72,8 +72,8 @@ shared items below. | Vietnamese | vi | 2,448 entries; every key of the reference catalogs (#1434); 98% of extracted, ~95% of visible | most | Latin ✅ | no | partial | 0–1 (review) | | Romanian | ro | 2,674 entries; every key of the other catalogs; AI-assisted draft | most | Latin ✅ (ă â î ș ț in the bundled faces) | no | partial | 0–1 (review) | -Other shipped languages: **20** — Traditional Chinese (`zh-hant`), Ukrainian (`uk`), Serbian -Cyrillic and Latin (`sr`, `sr-latn`, #250), Estonian (`et`), Turkish (`tr`), Russian (`ru`), Italian (`it`, #594), Polish (`pl`), Czech (`cs`), Hungarian (`hu`), French (`fr`), Bulgarian (`bg`), Vietnamese (`vi`, #1434), Swedish (`sv`, #1219), Croatian (`hr`, #1271), Romanian (`ro`), Slovenian (`sl`), Dutch (`nl`) and Danish (`da`, #2722), all partial. +Other shipped languages: **21** — Traditional Chinese (`zh-hant`), Ukrainian (`uk`), Serbian +Cyrillic and Latin (`sr`, `sr-latn`, #250), Estonian (`et`), Turkish (`tr`), Russian (`ru`), Italian (`it`, #594), Polish (`pl`), Czech (`cs`), Hungarian (`hu`), French (`fr`), Bulgarian (`bg`), Vietnamese (`vi`, #1434), Swedish (`sv`, #1219), Croatian (`hr`, #1271), Romanian (`ro`), Slovenian (`sl`), Dutch (`nl`), Danish (`da`, #2722) and Bosnian (`bs`), all partial. Swedish (`sv-SE` and `sv-FI` system locales, `{"value":"sv"}`) has 2,504 entries. Counts use count-neutral wording (`{words} ord`: the noun is the same in the singular and the plural). The catalog is an AI-assisted draft whose terminology and running app were reviewed by a native @@ -97,6 +97,7 @@ hyphenated by the Bulgarian syllable rules (#826); Bulgarian spelling and gramma Slovenian (`sl-SI` system locales, `{"value":"sl"}`) has 2,614 entries: every key of every other catalog. Counts use count-neutral wording (`Besede: 21`); terminology: [`localization-sl.md`](localization-sl.md). Slovenian proofing is not included. +Bosnian (`bs-BA` system locales, `{"value":"bs"}`) is Latin script; Cyrillic Bosnian stays in English. Its craft-i18n catalog has 2,508 WordCraft entries plus the shared catalog, with `one|few|other` plural rows. The catalog is an AI-assisted draft not yet reviewed by a native speaker; Bosnian proofing is not included; terminology: [`localization-bs.md`](localization-bs.md). Hungarian follows `hu-HU` system locales and `{"value":"hu"}`, with a complete catalog of 2,419 entries: every key of the Russian catalog, built-in style names shown translated, plus the citation style names. Hungarian proofing is not included; terminology and conventions: [`localization-hu.md`](localization-hu.md). @@ -275,6 +276,7 @@ WordCraft keeps 2,54 cm). | Date | Change | Summary | |---|---|---| +| 2026-10-29 | minor | Bosnian interface (`bs`, Latin script): listed in `LANGUAGES`, `bs-BA` system locales, saved preference and bundled-font tests; catalog in storytold/craft-i18n (`locales/bs/wordcraft.tsv`); no Bosnian proofing | | 2026-11-06 | trivial | Arabic: the Home tab's Styles gallery reads from the right: Normal is the rightmost tile and the scroll arrows and More sit at the gallery's left end, as the rest of the mirrored ribbon (#5566); left to right is unchanged; regression test `the_styles_gallery_reads_from_the_right_in_a_right_to_left_interface` | | 2026-11-05 | trivial | Arabic letters join across a change of formatting and past hidden or deleted text (#4093) | | 2026-11-04 | trivial | Table sort and formulas read the Panamanian balboa's `B/.` around a number (`B/. 1,250.50`, `1,250.50 B/.`), as Word does; `B/.1,250.50` and `B/ 1,250.50` stay text, matching Word 16.0, and the sign is matched only at the ends of the text, so `1/.5` is unchanged |