Sketch: the status in the view and the browser's editing mark in the user's language (#8084)

* Sketch: the status in the view and the browser's editing mark in the user's language

While a sketch is edited, the view's corner said "Sketch1 — 2 degrees of
freedom" (or "fully constrained", "constraints conflict") and the
browser marked the sketch "(editing)" or "(attachment lost)", in
English whatever the language; one degree of freedom read "1 degrees of
freedom". They now take messages: the catalogs' existing degrees-of-
freedom ones and four new ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Sketch status and editing mark: the sketch's default name as shown elsewhere

The browser shows a default name in the user's language ("Skizze 1")
except on the edited sketch's row, whose mark made it a different text;
the view's status kept the stored name too. Both now use the name as the
browser shows it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
semmelrindeandClaude Opus 5.5 authored and GitHub committed 2026-10-28 12:13:38 +00:00
1 parent bf1886e90a
commit fed9605357
4 files changed
+94 -6

No files matched your search

@@ -0,0 +1,74 @@
{
"en": {
"browser.sketch_attachment_lost": "{name} (attachment lost)",
"browser.sketch_editing": "{name} (editing)",
"sketch.status_conflict": "constraints conflict",
"sketch.status_fully_constrained": "fully constrained"
},
"ar": {
"browser.sketch_attachment_lost": "{name} (فُقد الارتباط)",
"browser.sketch_editing": "{name} (قيد التحرير)",
"sketch.status_conflict": "تعارض القيود",
"sketch.status_fully_constrained": "مقيّد بالكامل"
},
"de": {
"browser.sketch_attachment_lost": "{name} (Bezug verloren)",
"browser.sketch_editing": "{name} (in Bearbeitung)",
"sketch.status_conflict": "Bedingungen widersprechen sich",
"sketch.status_fully_constrained": "vollständig bestimmt"
},
"es": {
"browser.sketch_attachment_lost": "{name} (fijación perdida)",
"browser.sketch_editing": "{name} (en edición)",
"sketch.status_conflict": "restricciones en conflicto",
"sketch.status_fully_constrained": "totalmente restringido"
},
"fr": {
"browser.sketch_attachment_lost": "{name} (attache perdue)",
"browser.sketch_editing": "{name} (en cours de modification)",
"sketch.status_conflict": "contraintes en conflit",
"sketch.status_fully_constrained": "entièrement contrainte"
},
"he": {
"browser.sketch_attachment_lost": "{name} (ההצמדה אבדה)",
"browser.sketch_editing": "{name} (בעריכה)",
"sketch.status_conflict": "אילוצים סותרים",
"sketch.status_fully_constrained": "מאולץ במלואו"
},
"it": {
"browser.sketch_attachment_lost": "{name} (aggancio perso)",
"browser.sketch_editing": "{name} (in modifica)",
"sketch.status_conflict": "vincoli in conflitto",
"sketch.status_fully_constrained": "completamente vincolato"
},
"ja": {
"browser.sketch_attachment_lost": "{name} (アタッチメント消失)",
"browser.sketch_editing": "{name} (編集中)",
"sketch.status_conflict": "拘束が競合しています",
"sketch.status_fully_constrained": "完全拘束"
},
"ko": {
"browser.sketch_attachment_lost": "{name} (부착 해제됨)",
"browser.sketch_editing": "{name} (편집 중)",
"sketch.status_conflict": "구속 조건 충돌",
"sketch.status_fully_constrained": "완전 구속"
},
"vi": {
"browser.sketch_attachment_lost": "{name} (mất liên kết)",
"browser.sketch_editing": "{name} (đang sửa)",
"sketch.status_conflict": "ràng buộc xung đột",
"sketch.status_fully_constrained": "ràng buộc hoàn toàn"
},
"zh": {
"browser.sketch_attachment_lost": "{name} (附着丢失)",
"browser.sketch_editing": "{name} (编辑中)",
"sketch.status_conflict": "约束冲突",
"sketch.status_fully_constrained": "完全约束"
},
"zh-TW": {
"browser.sketch_attachment_lost": "{name} (附著遺失)",
"browser.sketch_editing": "{name} (編輯中)",
"sketch.status_conflict": "拘束衝突",
"sketch.status_fully_constrained": "完全拘束"
}
}
+2 -2
View File
@@ -2032,9 +2032,9 @@ impl Entry {
thing: Thing::Sketch(f.id),
patterns: crate::sketch_pattern_tree::has_patterns(app, f.id).then(|| format!("s:{}/patterns", f.id)),
label: if lost {
format!("{} (attachment lost)", f.name)
crate::i18n::format("browser.sketch_attachment_lost", &[("name", &crate::i18n::tr_name(&f.name))])
} else if active {
format!("{} (editing)", f.name)
crate::i18n::format("browser.sketch_editing", &[("name", &crate::i18n::tr_name(&f.name))])
} else {
f.name.clone()
},
+11
View File
@@ -409,3 +409,14 @@ fn browser_rows_still_fold_or_select_when_move_copy_is_not_open() {
click(&mut h, "row:Bodies");
assert!(h.app.tree.collapsed.contains("c0/bodies"));
}
/// The sketch being edited is marked in the user's language, not with an English "(editing)",
/// and its default name reads as the browser shows it elsewhere.
#[test]
fn the_edited_sketch_is_marked_in_the_users_language() {
let mut h = crate::scenario::Harness::new();
h.app.run("sketch.create", json!({"plane":"XY","name":"Sketch1"})).unwrap();
let _japanese = crate::i18n::scope("ja");
let rows = super::entries(&h.app, 0, "sketches");
assert_eq!(rows.iter().map(|r| r.label.as_str()).collect::<Vec<_>>(), ["スケッチ1 (編集中)"]);
}
+7 -4
View File
@@ -5331,13 +5331,16 @@ fn overlays(app: &SolveApp, painter: &egui::Painter, proj: &Proj) {
loose_end_markers(sk, &ss.ends, &ss.plane, painter, proj, &v);
// Sketch status.
if let Some(r) = app.viewport.layout.as_ref().map(|l| l.content) {
let msg = if !ss.report.ok() {
format!("{} — constraints conflict", ss.name)
let status = if !ss.report.ok() {
crate::i18n::tr("sketch.status_conflict").to_string()
} else if ss.report.dof == 0 {
format!("{} — fully constrained", ss.name)
crate::i18n::tr("sketch.status_fully_constrained").to_string()
} else if ss.report.dof == 1 {
crate::i18n::tr("ui.1_degree_of_freedom").to_string()
} else {
format!("{} — {} degrees of freedom", ss.name, ss.report.dof)
crate::i18n::format("sketch.degrees_of_freedom", &[("count", &ss.report.dof.to_string())])
};
let msg = format!("{} — {status}", crate::i18n::tr_name(&ss.name));
let c = if ss.report.ok() { v.sketch_accent } else { v.error };
painter.text(pos2(r.left() + 12.0, r.top() + 12.0), Align2::LEFT_TOP, msg, FontId::proportional(t.font_button), c);
}