mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-14 05:24:44 +00:00
Merge pull request #7298 from dotCooCoo/fix/hi-message-rows
i18n: Hindi rows no longer keep English words or garble their sentences
This commit is contained in:
+264
-264
File diff suppressed because it is too large
Load Diff
@@ -113,6 +113,59 @@ fn hindi_rows_keep_the_meaning_of_their_english() {
|
||||
assert!(all.contains("3 आर्टबोर्ड में से 1") && all.contains("सभी आर्टबोर्ड रखने के लिए"), "{all}");
|
||||
let left_out = message(hi, "the file was read up to an error (bad xref): what follows it was left out");
|
||||
assert!(left_out.contains("उसके बाद का हिस्सा छोड़ दिया गया"), "{left_out}");
|
||||
assert_eq!(message(hi, "unknown align `left`"), "अज्ञात संरेखण `left`");
|
||||
assert_eq!(tr(hi, "Delete Library Group"), "लाइब्रेरी ग्रुप हटाएँ");
|
||||
assert_eq!(message(hi, "not editing an opacity mask"), "ओपेसिटी मास्क संपादित नहीं किया जा रहा है");
|
||||
assert_eq!(
|
||||
message(hi, "a page thumbnail must be RGB pixels, 1 to 256 a side (got 0 × 4)"),
|
||||
"पेज थंबनेल RGB पिक्सल का होना चाहिए, हर तरफ़ 1 से 256 (मिला 0 × 4)"
|
||||
);
|
||||
assert_eq!(message(hi, "invalid angle"), "अमान्य कोण");
|
||||
}
|
||||
|
||||
/// Hindi messages keep every `a|b|c` list of accepted values exactly as their English writes it.
|
||||
#[test]
|
||||
fn hindi_messages_keep_their_lists_of_accepted_values() {
|
||||
let hi = Lang::from_code("hi").expect("hi registered");
|
||||
let (entries, _) = parse_entries(hi.0.source);
|
||||
let mut wrong = Vec::new();
|
||||
for (_, src, translation) in entries.iter().filter(|(ctx, _, _)| ctx == "@msg") {
|
||||
let lists = src.split(|c: char| !(c.is_ascii_alphabetic() || c == '|')).filter(|w| w.contains('|') && w.split('|').all(|v| !v.is_empty()));
|
||||
for list in lists.filter(|list| !translation.contains(*list)) {
|
||||
wrong.push(format!("{list} in {src:?} -> {translation:?}"));
|
||||
}
|
||||
}
|
||||
assert!(wrong.is_empty(), "{} Hindi messages change a list of values:\n{}", wrong.len(), wrong.join("\n"));
|
||||
}
|
||||
|
||||
/// Hindi rows leave no English connecting word in their sentences. Text in backticks, quotes,
|
||||
/// braces and brackets is a name, value or placeholder and keeps its English.
|
||||
#[test]
|
||||
fn hindi_rows_keep_no_english_words_in_their_sentences() {
|
||||
const ENGLISH: [&str; 13] = ["or", "and", "the", "must", "give", "see", "use", "most", "is", "of", "be", "not", "an"];
|
||||
let hi = Lang::from_code("hi").expect("hi registered");
|
||||
let (entries, _) = parse_entries(hi.0.source);
|
||||
let mut wrong = Vec::new();
|
||||
for (_, src, translation) in &entries {
|
||||
let mut prose = String::new();
|
||||
let mut close = None;
|
||||
for c in translation.chars() {
|
||||
match (close, c) {
|
||||
(Some(end), _) if c == end => close = None,
|
||||
(Some(_), _) => {}
|
||||
(None, '`') => close = Some('`'),
|
||||
(None, '"') => close = Some('"'),
|
||||
(None, '“') => close = Some('”'),
|
||||
(None, '{') => close = Some('}'),
|
||||
(None, '[') => close = Some(']'),
|
||||
(None, _) => prose.push(c),
|
||||
}
|
||||
}
|
||||
if let Some(word) = prose.split(|c: char| !c.is_ascii_alphabetic()).find(|w| ENGLISH.contains(w)) {
|
||||
wrong.push(format!("{word} in {src:?} -> {translation:?}"));
|
||||
}
|
||||
}
|
||||
assert!(wrong.is_empty(), "{} Hindi rows keep an English word:\n{}", wrong.len(), wrong.join("\n"));
|
||||
}
|
||||
|
||||
/// Locale tags name their language by region or script (in either case, with an encoding or
|
||||
|
||||
@@ -40,6 +40,13 @@ community. The stroke corner names (Bevel Join, Miter Join, Round Join) and the
|
||||
जॉइन. `hindi_rows_use_one_term_for_a_variable_and_for_joining_paths` checks both terms in every
|
||||
row.
|
||||
|
||||
A sentence keeps no English connecting word such as "or", "must" or "give": write या, होना
|
||||
चाहिए and दें. Parameter names, enum values and command IDs stay in English, and a list of
|
||||
accepted values such as `(left|right|top|bottom)` keeps the English's spelling and its `|`
|
||||
separators. `hindi_rows_keep_no_english_words_in_their_sentences` checks every row outside
|
||||
backticks, quotes, braces and brackets, and `hindi_messages_keep_their_lists_of_accepted_values`
|
||||
checks every `@msg` row's lists.
|
||||
|
||||
## Terminology
|
||||
|
||||
| English | Hindi |
|
||||
|
||||
@@ -875,6 +875,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- Hindi (2026-11-06): Hindi (`hi`): 7,877-row machine-assisted catalog, zero/one singular plurals, desktop font fallback and optional Devanagari craft-fonts fallback; all 55 translation tests pass; native review and a web font remain; scores and estimates unchanged. [Terminology and limitations](localization-hi.md).
|
||||
- Hindi wording (2026-11-13): rows outside the plug-in messages keep their English's meaning, quantities and clauses, and use the catalog's save, swatch, crop, resolution, path and type terms; a test checks those terms and the point unit in every row; native review remains; scores and estimates unchanged.
|
||||
- Hindi terms (2026-11-13): every row that names a variable (data merge, variable fonts and widths, environment variables) says वेरिएबल, and joining paths, anchor points, point type and lines says जोड़ें instead of शामिल हों, which stays for joining the community; a test checks both terms in every row; scores and estimates unchanged.
|
||||
- Hindi English words (2026-11-13): 264 rows no longer keep English words in their sentences, repeat a parameter's name in Hindi or garble them, among them "unknown align", which now names the alignment; lists of accepted values such as `(left|right|top|bottom)` stay as their English writes them; two tests check every row; native review remains; scores and estimates unchanged.
|
||||
- Window › Help Bar shows or hides the tool-help strip at the bottom of the window apart from the status bar (`window.helpBar`). Each setting is kept with the UI preferences and in saved workspaces, and Presentation Mode hides both bars. Layouts saved before the setting existed show the Help Bar where they show the status bar (`help_bar_toggle_is_independent_and_saved_in_workspaces`, `help_bar_and_status_bar_render_independently`, `legacy_help_bar_visibility_follows_each_layouts_status_bar`, `a_help_bar_setting_the_file_lacks_is_saved`).
|
||||
- Czech render-site labels: desktop/web file filters, diagnostics, suggested preset names and contributor tooltips/plurals now use catalog lookups; gradients have Czech adjective agreement and printer marks have a separate context (PDF/Print and Summary). Search, Home, toolbar/panel tooltips and Preferences already look up their labels. Every complete catalog has rows for these labels and for the Roman and Japanese printer mark styles. Evidence: `i18n::tests::czech_render_site_follow_up`, `i18n::tests::complete_catalogs_translate_render_site_labels`, `dialogs::tests_modal::printer_mark_labels_are_distinct_from_language_names`; see [localization-parity.md](localization-parity.md).
|
||||
- The History panel, Edit › Undo and Edit › Redo translate the names of the steps that apply or redefine a character or paragraph style and of the step that redefines a graphic style: each such step keeps its template (`Apply {name}`, `Redefine {name}`, `Redefine Graphic Style “{name}”`) and the style's name, every complete catalog has a row for each template, and the panel and the menu show the style's name as the document holds it, except the Normal styles' names, which they show in the interface language (`steps_named_after_a_style_list_the_template_around_the_name`, `undo_and_redo_name_a_style_step_around_the_style_name`).
|
||||
|
||||
Reference in New Issue
Block a user