feat(locale): localize full interface

This commit is contained in:
Hakan Seven committed 2026-08-02 22:09:25 +03:00
1 parent b90b3e3ecf
commit 3e6693b93f
205 files changed
+32369 -3810

No files matched your search

+31 -31
View File
@@ -85,7 +85,7 @@ impl OpenCADStudio {
.collect();
if handles.is_empty() {
self.command_line
.push_error("JUSTIFYTEXT: select text objects first.");
.push_error(crate::t!("JUSTIFYTEXT: select text objects first.").as_ref());
return Some(Task::none());
}
if opt.is_empty() {
@@ -130,7 +130,7 @@ impl OpenCADStudio {
};
if text_align.is_none() && mtext_ap.is_none() {
self.command_line
.push_error("JUSTIFYTEXT: unknown justification option.");
.push_error(crate::t!("JUSTIFYTEXT: unknown justification option.").as_ref());
return Some(Task::none());
}
self.push_undo_snapshot(i, "JUSTIFYTEXT");
@@ -175,7 +175,7 @@ impl OpenCADStudio {
.collect();
self.tabs[i].scene.bump_entities(&changes);
self.command_line
.push_output(&format!("JUSTIFYTEXT: updated {n} text object(s)."));
.push_output(crate::tf!("JUSTIFYTEXT: updated {n} text object(s).").as_ref());
}
// TCASE <Upper|Lower|Sentence|Title> — change the case of the text in
@@ -207,7 +207,7 @@ impl OpenCADStudio {
.collect();
if handles.is_empty() {
self.command_line
.push_error("TCASE: select text objects first.");
.push_error(crate::t!("TCASE: select text objects first.").as_ref());
return Some(Task::none());
}
if !matches!(
@@ -223,7 +223,7 @@ impl OpenCADStudio {
| "TITLE"
) {
self.command_line
.push_info("Usage: TCASE <Upper|Lower|Sentence|Title>");
.push_info(crate::t!("Usage: TCASE <Upper|Lower|Sentence|Title>").as_ref());
return Some(Task::none());
}
let conv = move |s: &str| -> String {
@@ -263,7 +263,7 @@ impl OpenCADStudio {
.collect();
self.tabs[i].scene.bump_entities(&changes);
self.command_line
.push_output(&format!("TCASE: updated {n} text object(s)."));
.push_output(crate::tf!("TCASE: updated {n} text object(s).").as_ref());
}
// TEXTMASK — place a wipeout mask sized to each selected text object's
@@ -296,7 +296,7 @@ impl OpenCADStudio {
.collect();
if handles.is_empty() {
self.command_line
.push_error("TEXTMASK: select text objects first.");
.push_error(crate::t!("TEXTMASK: select text objects first.").as_ref());
return Some(Task::none());
}
self.push_undo_snapshot(i, "TEXTMASK");
@@ -339,7 +339,7 @@ impl OpenCADStudio {
.replace_selection(handles.iter().cloned().collect());
self.tabs[i].dirty = true;
self.command_line
.push_output(&format!("TEXTMASK: masked {n} text object(s)."));
.push_output(crate::tf!("TEXTMASK: masked {n} text object(s).").as_ref());
return self.dispatch_view("DRAWORDER FRONT", i);
}
@@ -373,7 +373,7 @@ impl OpenCADStudio {
.collect();
if handles.is_empty() {
self.command_line
.push_error("TEXTFIT: select single-line text first.");
.push_error(crate::t!("TEXTFIT: select single-line text first.").as_ref());
return Some(Task::none());
}
self.push_undo_snapshot(i, "TEXTFIT");
@@ -412,9 +412,9 @@ impl OpenCADStudio {
.map(|handle| (handle, crate::scene::ChangeKind::Modified))
.collect();
self.tabs[i].scene.bump_entities(&changes);
self.command_line.push_output(&format!(
self.command_line.push_output(crate::tf!(
"TEXTFIT: fitted {n} text object(s) to width {target}."
));
).as_ref());
}
// (text sequential numbering)
@@ -450,7 +450,7 @@ impl OpenCADStudio {
.collect();
if texts.is_empty() {
self.command_line
.push_error("TCOUNT: select single-line text first.");
.push_error(crate::t!("TCOUNT: select single-line text first.").as_ref());
return Some(Task::none());
}
// Reading order: higher Y first, then smaller X.
@@ -478,10 +478,10 @@ impl OpenCADStudio {
.map(|(handle, _, _)| (*handle, crate::scene::ChangeKind::Modified))
.collect();
self.tabs[i].scene.bump_entities(&changes);
self.command_line.push_output(&format!(
self.command_line.push_output(crate::tf!(
"TCOUNT: numbered {} text object(s) from {start}.",
texts.len()
));
).as_ref());
}
"MLEADER" => {
@@ -575,7 +575,7 @@ impl OpenCADStudio {
}
if pts.len() < 2 {
self.command_line
.push_error("QDIM: no dimensionable endpoints in the selection.");
.push_error(crate::t!("QDIM: no dimensionable endpoints in the selection.").as_ref());
return Some(Task::none());
}
// Choose the dimension axis from the points' spread: a wider X
@@ -596,7 +596,7 @@ impl OpenCADStudio {
}
if pts.len() < 2 {
self.command_line
.push_error("QDIM: endpoints collapse to a single position.");
.push_error(crate::t!("QDIM: endpoints collapse to a single position.").as_ref());
return Some(Task::none());
}
self.push_undo_snapshot(i, "QDIM");
@@ -628,7 +628,7 @@ impl OpenCADStudio {
}
self.tabs[i].dirty = true;
self.command_line
.push_output(&format!("QDIM {made} dimensions created."));
.push_output(crate::tf!("QDIM {made} dimensions created.").as_ref());
return Some(Task::none());
}
@@ -697,28 +697,28 @@ impl OpenCADStudio {
"ZOOM EXTENTS ALL" | "ZOOM EXTENTS ALL VIEWPORTS" | "ZEA" => {
self.tabs[i].scene.fit_all_model_viewports();
self.command_line.push_output("Zoom Extents — All Viewports");
self.command_line.push_output(crate::t!("Zoom Extents — All Viewports").as_ref());
}
"ZOOM EXTENTS" | "ZOOMEXTENTS" | "ZE" => {
self.tabs[i].scene.fit_all();
self.command_line.push_output("Zoom Extents");
self.command_line.push_output(crate::t!("Zoom Extents").as_ref());
}
"ZOOM IN" | "ZI" => {
self.tabs[i].scene.zoom_camera(1.0 / 1.5);
self.command_line.push_output("Zoom In");
self.command_line.push_output(crate::t!("Zoom In").as_ref());
}
"ZOOM OUT" | "ZO" => {
self.tabs[i].scene.zoom_camera(1.5);
self.command_line.push_output("Zoom Out");
self.command_line.push_output(crate::t!("Zoom Out").as_ref());
}
// ZOOM ALL — fit the configured drawing limits.
"ZOOM ALL" | "ZOOM A" | "ZA" => {
self.tabs[i].scene.fit_all_with_limits();
self.command_line.push_output("Zoom All");
self.command_line.push_output(crate::t!("Zoom All").as_ref());
}
// ZOOM SCALE — set zoom factor (e.g. "ZOOM SCALE 2" or "ZS 0.5")
@@ -731,7 +731,7 @@ impl OpenCADStudio {
if factor > 0.0 {
self.tabs[i].scene.zoom_camera(1.0 / factor);
self.command_line
.push_output(&format!("Zoom Scale ×{factor:.3}"));
.push_output(crate::tf!("Zoom Scale ×{factor:.3}").as_ref());
}
}
}
@@ -992,10 +992,10 @@ impl OpenCADStudio {
self.tabs[i].dirty = true;
self.refresh_properties();
self.command_line
.push_output(&format!("{exploded} object(s) exploded."));
.push_output(crate::tf!("{exploded} object(s) exploded.").as_ref());
} else {
self.command_line
.push_info("EXPLODE: no explodable objects selected.");
.push_info(crate::t!("EXPLODE: no explodable objects selected.").as_ref());
}
}
}
@@ -1108,11 +1108,11 @@ impl OpenCADStudio {
});
let Some((center, radius)) = found else {
self.command_line
.push_error("DIMJOGGED: select an arc or circle first.");
.push_error(crate::t!("DIMJOGGED: select an arc or circle first.").as_ref());
return None;
};
if radius <= 0.0 {
self.command_line.push_error("DIMJOGGED: invalid radius.");
self.command_line.push_error(crate::t!("DIMJOGGED: invalid radius.").as_ref());
return None;
}
let k = std::f64::consts::FRAC_1_SQRT_2;
@@ -1129,7 +1129,7 @@ impl OpenCADStudio {
.add_entity(acadrust::EntityType::Dimension(Dimension::Radius(dim)));
self.tabs[i].dirty = true;
self.command_line
.push_output("DIMJOGGED: created a jogged radius dimension.");
.push_output(crate::t!("DIMJOGGED: created a jogged radius dimension.").as_ref());
}
// ARCTEXT <text> — lay the text out as one Text entity per character
@@ -1166,12 +1166,12 @@ impl OpenCADStudio {
});
let Some(arc) = arc else {
self.command_line
.push_error("ARCTEXT: select an arc first.");
.push_error(crate::t!("ARCTEXT: select an arc first.").as_ref());
return None;
};
let chars: Vec<char> = text.chars().filter(|c| !c.is_control()).collect();
if chars.is_empty() {
self.command_line.push_error("ARCTEXT: no printable text.");
self.command_line.push_error(crate::t!("ARCTEXT: no printable text.").as_ref());
return None;
}
let n = chars.len();
@@ -1195,7 +1195,7 @@ impl OpenCADStudio {
}
self.tabs[i].dirty = true;
self.command_line
.push_output(&format!("ARCTEXT: placed {n} character(s) along the arc."));
.push_output(crate::tf!("ARCTEXT: placed {n} character(s) along the arc.").as_ref());
}
_ => return None,