diff --git a/assets/locales/pending/thread-dialog-labels.json b/assets/locales/pending/thread-dialog-labels.json new file mode 100644 index 000000000..2895ef09a --- /dev/null +++ b/assets/locales/pending/thread-dialog-labels.json @@ -0,0 +1,42 @@ +{ + "en": { + "thread.fits_the_face": "fits the face, e.g. {example}", + "ui.chamfer_angle": "Chamfer Angle", + "ui.chamfer_depth": "Chamfer Depth", + "ui.ends": "Ends", + "ui.extent": "Extent", + "ui.iso_4753": "ISO 4753" + }, + "ar": { + "thread.fits_the_face": "يناسب الوجه، مثلاً {example}", + "ui.chamfer_angle": "زاوية الشطف", + "ui.chamfer_depth": "عمق الشطف", + "ui.ends": "الطرفان", + "ui.extent": "الامتداد", + "ui.iso_4753": "ISO 4753" + }, + "he": { + "thread.fits_the_face": "מתאים לפאה, למשל {example}", + "ui.chamfer_angle": "זווית פאזה", + "ui.chamfer_depth": "עומק פאזה", + "ui.ends": "קצוות", + "ui.extent": "גבול", + "ui.iso_4753": "ISO 4753" + }, + "ja": { + "thread.fits_the_face": "面に合うサイズ。例: {example}", + "ui.chamfer_angle": "面取り角度", + "ui.chamfer_depth": "面取り深さ", + "ui.ends": "端部", + "ui.extent": "範囲", + "ui.iso_4753": "ISO 4753" + }, + "zh": { + "thread.fits_the_face": "适合该面,例如 {example}", + "ui.chamfer_angle": "倒角角度", + "ui.chamfer_depth": "倒角深度", + "ui.ends": "端部", + "ui.extent": "范围", + "ui.iso_4753": "ISO 4753" + } +} diff --git a/crates/ui-egui/src/dialogs_thread.rs b/crates/ui-egui/src/dialogs_thread.rs index 3b40db7d2..dd9311243 100644 --- a/crates/ui-egui/src/dialogs_thread.rs +++ b/crates/ui-egui/src/dialogs_thread.rs @@ -374,7 +374,7 @@ pub(crate) fn rows( if !f.sizes().is_empty() { size_rows(ui, f, designation, suggested); } - let hint = format!("{}{}", tr("fits the face, e.g. "), example(f)); + let hint = crate::i18n::format("thread.fits_the_face", &[("example", &example(f))]); let (submitted, changed) = text_row(ui, "Designation", designation, &hint); enter |= submitted; if let Some(at) = crate::scenario::handle_at("dialog:Designation") { @@ -405,8 +405,8 @@ pub(crate) fn rows( enter |= ease_rows(ui, "Ease Out", "thread_ease_out", &mut o.ease_out); pick(ui, "Tip", "thread_tip", &mut o.tip, TIPS); if o.tip == ThreadTip::Chamfer { - enter |= hint_row(ui, "Chamfer Angle", &mut o.chamfer_angle, tr("ISO 4753")); - enter |= hint_row(ui, "Chamfer Depth", &mut o.chamfer_depth, tr("ISO 4753")); + enter |= hint_row(ui, "Chamfer Angle", &mut o.chamfer_angle, tr("ui.iso_4753")); + enter |= hint_row(ui, "Chamfer Depth", &mut o.chamfer_depth, tr("ui.iso_4753")); } }); (enter, reset) diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index 146e15efa..166c9ca62 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -326,7 +326,8 @@ mod tests { let pending: BTreeMap = serde_json::from_str(&std::fs::read_to_string(entry.path()).unwrap()).unwrap(); for (locale, messages) in pending { for (id, text) in messages { - assert_eq!(Locale::for_language(&locale).text(&id), text, "{locale}: {id}"); + // Right-to-left catalogs keep their messages in display order. + assert_eq!(Locale::for_language(&locale).text(&id), crate::bidi::visual_template(&text), "{locale}: {id}"); } } }