forked from 1b-agent/opencadstudio-upstream
feat(locale): localize full interface
This commit is contained in:
1 parent
b90b3e3ecf
commit
3e6693b93f
205 files changed
+32369
-3810
No files matched your search
@@ -1,4 +1,5 @@
|
||||
use glam::{DVec2, DVec3};
|
||||
use crate::t;
|
||||
|
||||
use crate::command::{CadCommand, CmdOption, CmdResult};
|
||||
|
||||
@@ -36,20 +37,23 @@ impl CadCommand for LimitsCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match self.step {
|
||||
LimitsStep::FirstCorner => format!(
|
||||
"LIMITS Specify first corner or [On / Off] <{:.4},{:.4}>:",
|
||||
self.current_min.x, self.current_min.y
|
||||
),
|
||||
LimitsStep::OppositeCorner(_) => format!(
|
||||
"LIMITS Specify opposite corner <{:.4},{:.4}>:",
|
||||
self.current_max.x, self.current_max.y
|
||||
),
|
||||
LimitsStep::FirstCorner => {
|
||||
let v = format!("{:.4},{:.4}", self.current_min.x, self.current_min.y);
|
||||
t!("LIMITS Specify first corner or [On / Off] <%{v}>:", v = v).into_owned()
|
||||
}
|
||||
LimitsStep::OppositeCorner(_) => {
|
||||
let v = format!("{:.4},{:.4}", self.current_max.x, self.current_max.y);
|
||||
t!("LIMITS Specify opposite corner <%{v}>:", v = v).into_owned()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn options(&self) -> Vec<CmdOption> {
|
||||
match self.step {
|
||||
LimitsStep::FirstCorner => vec![CmdOption::new("On", "ON"), CmdOption::new("Off", "OFF")],
|
||||
LimitsStep::FirstCorner => vec![
|
||||
CmdOption::new(t!("On").as_ref(), "ON"),
|
||||
CmdOption::new(t!("Off").as_ref(), "OFF"),
|
||||
],
|
||||
LimitsStep::OppositeCorner(_) => Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use glam::DVec3;
|
||||
use crate::t;
|
||||
|
||||
pub struct PlotWindowCommand {
|
||||
p1: Option<DVec3>,
|
||||
@@ -24,9 +25,9 @@ impl CadCommand for PlotWindowCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
if self.p1.is_none() {
|
||||
"PLOTWINDOW Specify first corner of plot window:".into()
|
||||
t!("PLOTWINDOW Specify first corner of plot window:").into_owned()
|
||||
} else {
|
||||
"PLOTWINDOW Specify opposite corner:".into()
|
||||
t!("PLOTWINDOW Specify opposite corner:").into_owned()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use acadrust::Handle;
|
||||
use glam::DVec3;
|
||||
use crate::t;
|
||||
|
||||
pub struct QuickPrintCommand {
|
||||
/// Latest selection set, refreshed on every selection action.
|
||||
@@ -23,12 +24,13 @@ impl CadCommand for QuickPrintCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
if self.handles.is_empty() {
|
||||
"QUICKPRINT Select objects to quick-print:".into()
|
||||
t!("QUICKPRINT Select objects to quick-print:").into_owned()
|
||||
} else {
|
||||
format!(
|
||||
"QUICKPRINT {} selected — Enter to plot, or keep selecting:",
|
||||
self.handles.len()
|
||||
t!(
|
||||
"QUICKPRINT %{count} selected — Enter to plot, or keep selecting:",
|
||||
count = self.handles.len()
|
||||
)
|
||||
.into_owned()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use glam::DVec3;
|
||||
use crate::t;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct UcsCommand {
|
||||
@@ -48,14 +49,16 @@ impl CadCommand for UcsCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match self.option.as_deref() {
|
||||
None => "UCS option [World/Z/X/Y/Origin/Save/Delete] or name:".into(),
|
||||
Some("Z") => "UCS rotation angle about Z (degrees):".into(),
|
||||
Some("X") => "UCS rotation angle about X (degrees):".into(),
|
||||
Some("Y") => "UCS rotation angle about Y (degrees):".into(),
|
||||
Some("ORIGIN") | Some("O") => "UCS new origin point:".into(),
|
||||
Some("SAVE") | Some("S") => "UCS name to save current UCS as:".into(),
|
||||
Some("DELETE") | Some("DEL") | Some("D") => "UCS name of UCS to delete:".into(),
|
||||
Some(_) => "UCS value:".into(),
|
||||
None => t!("UCS option [World/Z/X/Y/Origin/Save/Delete] or name:").into_owned(),
|
||||
Some("Z") => t!("UCS rotation angle about Z (degrees):").into_owned(),
|
||||
Some("X") => t!("UCS rotation angle about X (degrees):").into_owned(),
|
||||
Some("Y") => t!("UCS rotation angle about Y (degrees):").into_owned(),
|
||||
Some("ORIGIN") | Some("O") => t!("UCS new origin point:").into_owned(),
|
||||
Some("SAVE") | Some("S") => t!("UCS name to save current UCS as:").into_owned(),
|
||||
Some("DELETE") | Some("DEL") | Some("D") => {
|
||||
t!("UCS name of UCS to delete:").into_owned()
|
||||
}
|
||||
Some(_) => t!("UCS value:").into_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// ZOOM WINDOW command — pick two corners to define the zoom area.
|
||||
|
||||
use glam::{DVec3, Vec3};
|
||||
use crate::t;
|
||||
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
@@ -36,9 +37,9 @@ impl CadCommand for ZoomWindowCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
if self.first.is_none() {
|
||||
"ZOOM WINDOW Specify first corner:".into()
|
||||
t!("ZOOM WINDOW Specify first corner:").into_owned()
|
||||
} else {
|
||||
"ZOOM WINDOW Specify opposite corner:".into()
|
||||
t!("ZOOM WINDOW Specify opposite corner:").into_owned()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user