mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 21:29:35 +00:00
i18n: Bulgarian translates status and error messages
Bulgarian joins COMPLETE_MESSAGES. bg.tsv gets 987 new message rows (982 @msg, 5 @msgplural) for the keys the other complete-message languages translate, plus the liquify and variable context rows the list tests read. Nine existing Bulgarian @msg rows began with a space, so those status messages were shown with a leading space. They are fixed, and the new test message_translations_keep_their_english_edges checks every catalog for a translation that adds whitespace at either end. Docs: docs/localization-parity.md, docs/target-app-parity.md and docs/development.md list Bulgarian with the other complete-message languages.
This commit is contained in:
+1022
-9
File diff suppressed because it is too large
Load Diff
@@ -1374,6 +1374,30 @@ fn bundled_catalogs_are_consistent() {
|
||||
}
|
||||
}
|
||||
|
||||
/// A translated message starts and ends with whitespace only where its English does, so a status
|
||||
/// message is not shown with a stray space.
|
||||
#[test]
|
||||
fn message_translations_keep_their_english_edges() {
|
||||
let mut wrong = Vec::new();
|
||||
for l in &LANGUAGES {
|
||||
let (entries, _) = parse_entries(l.source);
|
||||
for (ctx, src, tr) in entries.iter().filter(|(ctx, _, _)| ctx == "@msg" || ctx == "@msgplural") {
|
||||
let plural = ctx == "@msgplural";
|
||||
let sources: Vec<&str> = if plural { src.split('|').collect() } else { vec![src.as_str()] };
|
||||
let forms: Vec<&str> = if plural { tr.split('|').collect() } else { vec![tr.as_str()] };
|
||||
for (i, form) in forms.into_iter().enumerate() {
|
||||
let english = sources.get(i).or(sources.last()).copied().unwrap_or_default();
|
||||
let lead = form.starts_with(char::is_whitespace) && !english.starts_with(char::is_whitespace);
|
||||
let trail = form.ends_with(char::is_whitespace) && !english.ends_with(char::is_whitespace);
|
||||
if lead || trail {
|
||||
wrong.push(format!("{}: {src:?} -> {form:?}", l.code));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
assert!(wrong.is_empty(), "{} message translations add whitespace at an edge:\n{}", wrong.len(), wrong.join("\n"));
|
||||
}
|
||||
|
||||
/// A catalog that doesn't claim complete menus may still only hold strings the UI shows (menu
|
||||
/// labels, command labels, `tl!` literals), so labels from other apps don't creep in.
|
||||
#[test]
|
||||
@@ -6859,7 +6883,7 @@ fn translated_messages_keep_the_field_names_and_values_their_english_lists() {
|
||||
/// the messages each one lacks.
|
||||
const COMPLETE_MESSAGES: &[&str] = &[
|
||||
"cs", "de", "el", "es", "fr", "hi", "hu", "it", "ja", "ka", "ko", "pl", "pt-br", "ru", "sv", "uk", "vi", "zh-hans", "zh-hant", "fi", "tr", "ca",
|
||||
"nl", "da", "id",
|
||||
"nl", "da", "id", "bg",
|
||||
];
|
||||
|
||||
/// Crates whose error and status messages reach the status bar, the crates whose errors the
|
||||
|
||||
+1
-1
@@ -308,7 +308,7 @@ other `sv-*` locale resolve to it), Georgian (`ka`, complete; `ka-GE` and `ka_GE
|
||||
``[{j}] `{_1}`: {why}``, so its reason is translated while a JSON array stays as it is. A literal brace in a
|
||||
row is written `{{` or `}}`, in the English and in the translation: a message made with `format!` keeps the
|
||||
doubled braces of its format string, and a plain string literal has each of its braces doubled, so the row for
|
||||
`"expected {\"objects\": [...]}"` is `expected {{"objects": [...]}}`. Czech, German, Greek, Spanish, French, Georgian, Hindi, Hungarian, Italian, Japanese, Korean, Polish, Brazilian Portuguese, Russian, Simplified Chinese, Traditional Chinese, Swedish, Ukrainian, Vietnamese, Finnish, Turkish, Catalan, Dutch, Danish and Indonesian
|
||||
`"expected {\"objects\": [...]}"` is `expected {{"objects": [...]}}`. Czech, German, Greek, Spanish, French, Georgian, Hindi, Hungarian, Italian, Japanese, Korean, Polish, Brazilian Portuguese, Russian, Simplified Chinese, Traditional Chinese, Swedish, Ukrainian, Vietnamese, Finnish, Turkish, Catalan, Dutch, Danish, Indonesian and Bulgarian
|
||||
translate status and error messages (`COMPLETE_MESSAGES` in `i18n::tests`); the untranslated report lists the
|
||||
message literals the scan finds, and the phrases a parameter schema's error builds at run time
|
||||
(`SCHEMA_PHRASES`), that one of them has no row for. The scan covers the crates in `MESSAGE_CRATES`, the
|
||||
|
||||
@@ -17,7 +17,7 @@ translation never fails a test or a build: the interface shows the English text
|
||||
`cargo xtask ci` prints the untranslated report (`cargo xtask i18n-report` alone), which lists per language the
|
||||
strings missing from each catalog with the `complete_menus` flag and the messages missing from each language in
|
||||
the `COMPLETE_MESSAGES` list. Every non-English language marked "full" has the flag, and all of them except
|
||||
Bosnian and Bulgarian are in the list. No language has help content: there is no translated (or
|
||||
Bosnian are in the list. No language has help content: there is no translated (or
|
||||
English) in-app help, and the docs are English.
|
||||
|
||||
**Native review:** every catalog was written clean-room from the English meaning, most of it by agents
|
||||
@@ -66,7 +66,7 @@ plus review. Native-speaker review is human work and isn't in the hours.
|
||||
| Czech | `cs` | 9,761 rows, 3,742 of them `@msg` and 51 `@msgplural` (counted 2026-11-17 on `main` at `ee60c51fd9`): the untranslated report lists 222 missing Czech messages, and 15 messages that no checked language has a row for | catalog complete; render-site gaps reduced; native review pending |
|
||||
| Bosnian | `bs` | 7,227 rows, 1,205 of them `@msg` and 47 `@msgplural` (counted 2026-11-17 on `main` at `ee60c51fd9`): the untranslated report lists 113 missing menu strings, 66 `tl!` literals and 30 undo labels for it; not in `COMPLETE_MESSAGES`, so the report does not check its messages; one/few/other plurals | full; AI-assisted, native review pending |
|
||||
| Swedish | `sv` | 9,498 rows, 3,311 of them `@msg` and 51 `@msgplural` (counted 2026-11-17 on `main` at `ee60c51fd9`): the untranslated report lists 647 missing messages for it, and 31 menu strings, 14 `tl!` literals and 6 undo labels; one/other plurals | full; native review welcome |
|
||||
| Bulgarian | `bg` | 7,133 rows, 1,111 of them `@msg` and 47 `@msgplural` (counted 2026-11-17 on `main` at `ee60c51fd9`): the untranslated report lists 76 menu strings, 48 `tl!` literals, 16 undo labels and 45 swatch names for it; its messages are partial | full; AI-drafted, native review pending |
|
||||
| Bulgarian | `bg` | 8,939 rows, 2,143 of them `@msg` and 56 `@msgplural` (counted 2026-11-20 on `main` at `5b52369187`): in `COMPLETE_MESSAGES`, and the untranslated report lists 71 menu strings, 43 `tl!` literals, 13 undo labels, 45 swatch names and 1,947 messages for it; its messages are partial | full; AI-drafted, native review pending |
|
||||
| Greek | `el` | 8,003 rows, 1,972 of them `@msg` and 51 `@msgplural` (counted 2026-11-17 on `main` at `ee60c51fd9`): the untranslated report lists 1,974 missing messages for it | full; native review welcome |
|
||||
| Georgian | `ka` | 9,758 rows, 3,740 of them `@msg` and 49 `@msgplural` (counted 2026-11-15): menus, panels, dialogs and plurals (one count-neutral form); the untranslated report lists 1 missing Georgian message; reviewed by a native speaker | full |
|
||||
| Turkish | `tr` | 9,784 rows, 3,746 of them `@msg` and 51 `@msgplural` (counted 2026-11-17 on `main` at `ee60c51fd9`); 235 messages, 79 menu strings, 39 `tl!` literals, 16 undo labels and the default swatch names still fall back to English | full |
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user