bs: Bosnian language support (#5445)

* Add Bosnian (bs) to the interface languages

bs.tsv: Bosnian (Latin script, Ijekavian) catalog covering every key of
PdfCraft's other catalogs, its wording shared with storytold/craft-i18n
locales/bs/ and the strings craft-i18n lacks translated new. Every bs-*
locale selects it; counts use one/few/other. Locale and plural tests,
localization docs and an attribution entry (AI-assisted, not yet
reviewed by a native speaker).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Tayw8nmxoLLmKv13jK93z

* Bosnian: date-format language, English picker name, word-count ellipsis

Preferences > Date format offers exactly the interface languages, so
Bosnian gets its month and day names there; the picker falls back to
"Bosnian" when no face can draw the native name; Word Count keeps the
command label's trailing ellipsis.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Tayw8nmxoLLmKv13jK93z

* bs: wording from the craft-i18n catalog review

The Bosnian catalog review (storytold/craft-i18n#72) asked for one word
per concept; this catalog follows: pan is "pomjeranje" (not
"pomicanje"), a spreadsheet is "proračunska tabela", Greek & Cyrillic
reads "Grčko pismo i ćirilica". Placeholders and ellipses are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Tayw8nmxoLLmKv13jK93z

* bs: take the catalog from craft-i18n, keep only PdfCraft's code

PdfCraft now reads its translations from storytold/craft-i18n (#6055),
and this PR's Bosnian rows are there (storytold/craft-i18n#141, in the
pinned commit), so crates/ui-egui/src/i18n/bs.tsv goes. What stays is
PdfCraft's part, redone against the new registry: the bs row in
LANGUAGES, "Bosnian" as its English picker name, Bosnian date names,
locale, persistence and one/few/other plural tests (Bosnian follows the
Russian rule in the legacy rule table), and the docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Tayw8nmxoLLmKv13jK93z

* docs: Bosnian revision row in the revision history; language totals

The 2026-11-04 Bosnian row had landed in the key-languages table instead
of the revision history; it is now the history's first row. The summary
counts 21 other languages, 35 catalogs plus English, 36 in Preferences,
as LANGUAGES lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Tayw8nmxoLLmKv13jK93z

* Docs: list bs as a ui.set / ui.state language value

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
NineandClaude Opus 5.5 authored and GitHub committed 2026-11-16 08:59:35 +01:00
1 parent 923dd9f593
commit 799fdd14b9
6 files changed
+59 -7

No files matched your search

+10 -1
View File
@@ -63,7 +63,7 @@ const CKB_DAYS: [&str; 7] = ["یەکشەممە", "دووشەممە", "سێشەم
/// The languages month and weekday names can be written in (Preferences ▸ Date format ▸ Language):
/// the interface languages, in the same order and with the same names.
pub static DATE_LANGUAGES: [DateLanguage; 35] = [
pub static DATE_LANGUAGES: [DateLanguage; 36] = [
DateLanguage {
code: "en",
name: "English",
@@ -322,6 +322,15 @@ pub static DATE_LANGUAGES: [DateLanguage; 35] = [
days: ["nedelja", "ponedeljek", "torek", "sreda", "četrtek", "petek", "sobota"],
days_short: ["ned.", "pon.", "tor.", "sre.", "čet.", "pet.", "sob."],
},
DateLanguage {
code: "bs",
name: "Bosanski",
months: ["januar", "februar", "mart", "april", "maj", "juni", "juli", "august", "septembar", "oktobar", "novembar", "decembar"],
months_with_day: None,
months_short: ["jan.", "feb.", "mar.", "apr.", "maj", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec."],
days: ["nedjelja", "ponedjeljak", "utorak", "srijeda", "četvrtak", "petak", "subota"],
days_short: ["ned.", "pon.", "uto.", "sri.", "čet.", "pet.", "sub."],
},
DateLanguage {
code: "el",
name: "Ελληνικά",
+5 -1
View File
@@ -66,7 +66,7 @@ pub struct LangInfo {
}
/// How many languages [`LANGUAGES`] lists.
const LANGUAGE_COUNT: usize = 35;
const LANGUAGE_COUNT: usize = 36;
/// The languages PdfCraft offers. English first: it is the fallback and the source language.
pub static LANGUAGES: [LangInfo; LANGUAGE_COUNT] = [
@@ -114,6 +114,9 @@ pub static LANGUAGES: [LangInfo; LANGUAGE_COUNT] = [
LangInfo { code: "pl", rtl: false },
// Slovene; every `sl-*` locale (`sl-SI`) resolves here. Four plural forms (one, two, few, other).
LangInfo { code: "sl", rtl: false },
// Bosnian (Latin script, Ijekavian); every `bs-*` locale (`bs-BA`, `bs_BA.UTF-8`, `bs-Latn-BA`)
// resolves here. Three plural forms (one, few, other).
LangInfo { code: "bs", rtl: false },
LangInfo { code: "el", rtl: false },
// Turkish; every `tr-*` locale (`tr-TR`, `tr_TR.UTF-8`) resolves here. CLDR `tr` has two forms
// (one, other); the catalog's counted nouns read the same in both, so its `@plural` rows repeat
@@ -263,6 +266,7 @@ impl Lang {
"fa" => "Persian",
"pl" => "Polish",
"sl" => "Slovenian",
"bs" => "Bosnian",
"el" => "Greek",
"tr" => "Turkish",
"lt" => "Lithuanian",
+37 -1
View File
@@ -596,7 +596,7 @@ fn pdfcraft_plural_rule(code: &str) -> fn(u64) -> usize {
"ja" | "zh-hans" | "zh-hant" | "tr" | "id" | "vi" | "th" | "lo" | "hi" | "ko" => none,
"cs" => cs,
"pt-br" | "fr" | "fa" => zero_one_other,
"ru" | "uk" => ru_uk,
"ru" | "uk" | "bs" => ru_uk,
"ar" => ar,
"pl" => pl,
"sl" => sl,
@@ -1069,6 +1069,42 @@ fn catalan_is_registered_and_persists() {
assert_eq!(restored.language, "ca");
}
/// Bosnian locales select it, its picker falls back to "Bosnian", and the choice persists.
#[test]
fn bosnian_is_registered_and_persists() {
needs_catalogs!();
let bs = Lang::from_code("bs").expect("bs registered");
assert_eq!(bs.name(), "Bosanski");
assert_eq!(bs.picker_name(|_| false), "Bosnian");
assert_eq!(normalize_pref("BS"), Some("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!(first_supported("bs-BA\r\nen-US"), Some(bs));
let mut app = crate::PdfCraftApp::default();
app.set_option("language", "BS").unwrap();
assert_eq!(app.language, "bs");
let mut restored = crate::PdfCraftApp::default();
restored.restore(&app.persist());
assert_eq!(restored.language, "bs");
}
/// Bosnian counts (CLDR `bs`): one for 1, 21, 101 but not 11; few for 2–4, 22–24 but not 12–14;
/// other for the rest.
#[test]
fn bosnian_plurals_cover_teens_and_compound_counts() {
let form = plural_fixture("bs", 3);
for (counts, f) in [
(vec![1, 21, 31, 101, 1001], 0),
(vec![2, 3, 4, 22, 24, 102, 104], 1),
(vec![0, 5, 10, 11, 12, 13, 14, 15, 20, 25, 100, 111, 112, 114, 1000], 2),
] {
for n in counts {
assert_eq!(form(n), f, "{n}");
}
}
}
#[test]
fn slovene_is_registered_and_persists() {
needs_catalogs!();
+4 -2
View File
@@ -1,6 +1,6 @@
# Localization parity
> **Last reviewed:** 2026-11-03 · **Last updated:** 2026-11-03 · **Change:** minor (every catalog restated from `cargo xtask i18n-report` on `main` at `14ae839a`: 2,897 strings in the report's denominator; Hindi, Indonesian, Korean, Thai, Lao and Central Kurdish listed with their catalogs. Scores and estimates unchanged) · **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
> **Last reviewed:** 2026-11-03 · **Last updated:** 2026-11-15 · **Change:** minor (Bosnian (`bs`) offered, its catalog from craft-i18n); previously minor (every catalog restated from `cargo xtask i18n-report` on `main` at `14ae839a`: 2,897 strings in the report's denominator; Hindi, Indonesian, Korean, Thai, Lao and Central Kurdish listed with their catalogs. Scores and estimates unchanged) · **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
Per-language status of PdfCraft's interface against Acrobat Pro's. How translations work and how to
add a language: [localization.md](localization.md). Summary in [ROADMAP.md](../ROADMAP.md).
@@ -83,6 +83,7 @@ help/docs polish: their script work is done, and each catalog lacks 46 strings o
| Kazakh | `kk` | 2,609 (90.1%) | partial | no |
| Polish | `pl` | 2,681 (92.5%) | partial | yes |
| Slovenian | `sl` | 2,618 (90.4%) | partial | no |
| Bosnian | `bs` | 2,495 entries (craft-i18n `locales/bs/pdfcraft.tsv`; not in the `14ae839a` report, which predates it) | partial; AI-assisted (storytold/craft-i18n#72, #141), not yet reviewed by a native speaker | no |
| Greek | `el` | 2,615 (90.3%) | partial | no |
| Turkish | `tr` | 2,895 (99.9%) | partial; AI-assisted, judgement calls reviewed by a native speaker, full proofreading pending | yes |
| Lithuanian | `lt` | 2,851 (98.4%) | partial; community native-speaker review ([#1401](https://github.com/storytold/pdfcraft/pull/1401)) | no |
@@ -96,7 +97,7 @@ help/docs polish: their script work is done, and each catalog lacks 46 strings o
| Thai | `th` | 2,751 (95.0%) | partial | no |
| Lao | `lo` | 2,504 (86.4%) | partial | no |
**23 other languages** ship (34 catalogs plus English = **35** interface languages in Preferences).
**24 other languages** ship (35 catalogs plus English = **36** interface languages in Preferences).
Their presence does not imply a detailed linguistic or runtime review.
Acrobat languages PdfCraft lacks: Danish, Dutch, Swedish, Hebrew. Vietnamese is shipped here but not by Acrobat.
@@ -104,6 +105,7 @@ Acrobat languages PdfCraft lacks: Danish, Dutch, Swedish, Hebrew. Vietnamese is
| Date | Change | Summary |
|---|---|---|
| 2026-11-04 | minor | Bosnian (`bs`, Latin, Ijekavian) offered: `LANGUAGES` row, `bs-*` locales, Bosnian date names, one/few/other plurals; the catalog is craft-i18n's (#141) |
| 2026-11-03 | minor | Every catalog restated from `cargo xtask i18n-report` on `14ae839a` (of the 2,897 strings in the report's denominator), replacing the catalog-union measure, which had reached 2,895 keys and left rows "100%" that were 44 short (#5805). Hindi, Indonesian and Korean restated from 0 to their catalogs, and Thai, Lao and Central Kurdish added to the table. The ≈ 68% score is not re-scored |
| 2026-10-25 | minor | Arabic current state corrected: catalogs stay logical, Arabic/Kurdish labels take an explicit RTL direction, and stock chrome mirrors; native/browser RTL input, IME and complex workflows remain unqualified. Native Simplified Chinese uses LXGW WenKai Lite; the web build still has no Hans face and the release-pinned craft-fonts still has no Telugu face. Scores and estimates unchanged |
| 2026-10-25 | minor | Added Persian (`fa`, 2,785 entries, all but 13 of the current 2,798-key union); right-to-left like Arabic and Kurdish, with logical entries reordered by egui 0.37's epaint; AI-assisted, not yet native-reviewed |
+2 -2
View File
@@ -1,6 +1,6 @@
# Interface language
Choose **Menu > Edit > Preferences…** (Command-comma on macOS, Ctrl-comma elsewhere) **> Interface language** and select **Auto**, **English**, **日本語**, **简体中文**, **繁體中文**, **Čeština**, **Português (Brasil)**, **Deutsch**, **Español**, **Français**, **Русский**, **Қазақша**, **Български**, **తెలుగు**, **Magyar**, **Українська**, **Italiano**, **العربية**, **کوردیی ناوەندی**, **فارسی**, **Polski**, **Slovenščina**, **Ελληνικά**, **Türkçe**, **Lietuvių**, **Tiếng Việt**, **Suomi**, **Shqip**, **Català**, **Română** or **Norsk bokmål**. The change applies immediately and persists between launches. Command ids, document contents and file names are unchanged. The status caption PdfCraft draws into a named-layer signature appearance ("Signature valid" and its siblings) follows it too, on screen, in exports and in print; it is never saved. It is drawn in Helvetica, or shaped in embedded Inter, or shaped in a craft-fonts face for Arabic, Japanese, Telugu, Thai and Devanagari when the build has one (drawn as outlines), and otherwise in English, as Chinese always is; saving never writes it.
Choose **Menu > Edit > Preferences…** (Command-comma on macOS, Ctrl-comma elsewhere) **> Interface language** and select **Auto**, **English**, **日本語**, **简体中文**, **繁體中文**, **Čeština**, **Português (Brasil)**, **Deutsch**, **Español**, **Français**, **Русский**, **Қазақша**, **Български**, **తెలుగు**, **Magyar**, **Українська**, **Italiano**, **العربية**, **کوردیی ناوەندی**, **فارسی**, **Polski**, **Slovenščina**, **Bosanski**, **Ελληνικά**, **Türkçe**, **Lietuvių**, **Tiếng Việt**, **Suomi**, **Shqip**, **Català**, **Română** or **Norsk bokmål**. The change applies immediately and persists between launches. Command ids, document contents and file names are unchanged. The status caption PdfCraft draws into a named-layer signature appearance ("Signature valid" and its siblings) follows it too, on screen, in exports and in print; it is never saved. It is drawn in Helvetica, or shaped in embedded Inter, or shaped in a craft-fonts face for Arabic, Japanese, Telugu, Thai and Devanagari when the build has one (drawn as outlines), and otherwise in English, as Chinese always is; saving never writes it.
Displayed keyboard shortcuts use the same active interface language. For example, German shows `Strg+K` and `Strg+Umschalt+S` in the toolbar, menus, command palette, tooltips and Keyboard shortcuts dialog; macOS keeps its modifier symbols (`⌘`, `⇧`, `⌃`). Key names have their own `key` catalog context, so the Delete key can read `Entf` while the command remains `Löschen`. A missing key-name entry falls back to the English key name. Actual bindings and machine-facing command ids remain stable.
@@ -12,7 +12,7 @@ The control channel exposes the setting through `ui.set`:
{"method":"ui.set","params":{"key":"language","value":"ja"}}
```
The value is `auto` or a language code (`en`, `ja`, `zh-hans`, `zh-hant`, `cs`, `pt-br`, `de`, `es`, `fr`, `ru`, `kk`, `bg`, `te`, `hu`, `uk`, `it`, `ar`, `ckb`, `pl`, `sl`, `el`, `tr`, `lt`, `vi`, `fi`, `sq`, `ca`, `ro`, `fa` or `nb`), in any case. `ui.state` reports `language` as written in the preferences (`auto`, `en`, `ja`, `zh-hans`, `zh-hant`, `cs`, `pt-br`, `de`, `es`, `fr`, `ru`, `kk`, `bg`, `te`, `hu`, `uk`, `it`, `ar`, `ckb`, `pl`, `sl`, `el`, `tr`, `lt`, `vi`, `fi`, `sq`, `ca`, `ro`, `fa` or `nb`). Unknown values return an error without changing the current setting. Preferences saved before this setting existed follow the system language.
The value is `auto` or a language code (`en`, `ja`, `zh-hans`, `zh-hant`, `cs`, `pt-br`, `de`, `es`, `fr`, `ru`, `kk`, `bg`, `te`, `hu`, `uk`, `it`, `ar`, `ckb`, `pl`, `sl`, `bs`, `el`, `tr`, `lt`, `vi`, `fi`, `sq`, `ca`, `ro`, `fa` or `nb`), in any case. `ui.state` reports `language` as written in the preferences (`auto`, `en`, `ja`, `zh-hans`, `zh-hant`, `cs`, `pt-br`, `de`, `es`, `fr`, `ru`, `kk`, `bg`, `te`, `hu`, `uk`, `it`, `ar`, `ckb`, `pl`, `sl`, `bs`, `el`, `tr`, `lt`, `vi`, `fi`, `sq`, `ca`, `ro`, `fa` or `nb`). Unknown values return an error without changing the current setting. Preferences saved before this setting existed follow the system language.
Dialogs, panels, menus, notices and history labels go through the catalog (`tl!`). Most shipped catalogs carry most of the current localizable surface (roughly 2,400–2,800 entries each); Czech (2,794 entries) has all but four keys, and Finnish, Vietnamese, Catalan, Brazilian Portuguese, Spanish, Lithuanian and Romanian have all 2,798. Persian has 2,785. Untranslated labels use English. Error details that come from the engine or the operating system are shown as they are, inside a translated frame ("操作「…」に失敗しました: …"). The command palette matches the translated label, the English label and the command id. Vertical Japanese PDF rendering is an existing viewer feature; this change does not add vertical text editing. Document contents, filenames, CLI/MCP/control protocol strings and external help stay outside the catalog. Per-language coverage, script support and what each language still needs are in [localization-parity.md](localization-parity.md).
+1
View File
@@ -31,6 +31,7 @@
<string>fa</string>
<string>pl</string>
<string>sl</string>
<string>bs</string>
<string>el</string>
<string>tr</string>
<string>lt</string>