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
@@ -8,6 +8,7 @@ use glam::DVec3;
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/dim_aligned.svg"));
|
||||
|
||||
@@ -57,18 +58,18 @@ impl CadCommand for AlignedDimensionCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
if self.awaiting_text {
|
||||
return "DIMALIGNED Enter dimension text (blank = measured value):".into();
|
||||
return t!("DIMALIGNED Enter dimension text (blank = measured value):").into_owned();
|
||||
}
|
||||
if self.awaiting_angle {
|
||||
return "DIMALIGNED Specify text angle (degrees):".into();
|
||||
return t!("DIMALIGNED Specify text angle (degrees):").into_owned();
|
||||
}
|
||||
match self.step {
|
||||
Step::First => "DIMALIGNED Specify first extension line origin:".into(),
|
||||
Step::First => t!("DIMALIGNED Specify first extension line origin:").into_owned(),
|
||||
Step::Second(_) => {
|
||||
"DIMALIGNED Specify second extension line origin [Text/Angle]:".into()
|
||||
t!("DIMALIGNED Specify second extension line origin [Text/Angle]:").into_owned()
|
||||
}
|
||||
Step::DimLine { .. } => {
|
||||
"DIMALIGNED Specify dimension line location [Text/Angle]:".into()
|
||||
t!("DIMALIGNED Specify dimension line location [Text/Angle]:").into_owned()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use glam::{DVec3, Vec3};
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/dim_angular.svg"));
|
||||
|
||||
@@ -49,10 +50,14 @@ impl CadCommand for AngularDimensionCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match self.step {
|
||||
Step::Vertex => "DIMANGULAR Specify angle vertex:".into(),
|
||||
Step::FirstRay(_) => "DIMANGULAR Specify first extension line point:".into(),
|
||||
Step::SecondRay { .. } => "DIMANGULAR Specify second extension line point:".into(),
|
||||
Step::ArcPoint { .. } => "DIMANGULAR Specify dimension arc location:".into(),
|
||||
Step::Vertex => t!("DIMANGULAR Specify angle vertex:").into_owned(),
|
||||
Step::FirstRay(_) => {
|
||||
t!("DIMANGULAR Specify first extension line point:").into_owned()
|
||||
}
|
||||
Step::SecondRay { .. } => {
|
||||
t!("DIMANGULAR Specify second extension line point:").into_owned()
|
||||
}
|
||||
Step::ArcPoint { .. } => t!("DIMANGULAR Specify dimension arc location:").into_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ use glam::DVec3;
|
||||
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/ddedit.svg"));
|
||||
|
||||
@@ -38,7 +39,7 @@ impl CadCommand for DdeditCommand {
|
||||
}
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
"DDEDIT Select text entity:".into()
|
||||
t!("DDEDIT Select text entity:").into_owned()
|
||||
}
|
||||
|
||||
fn needs_entity_pick(&self) -> bool {
|
||||
|
||||
@@ -8,6 +8,7 @@ use glam::{DVec3, Vec3};
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/dim_diameter.svg"));
|
||||
|
||||
@@ -57,16 +58,16 @@ impl CadCommand for DiameterDimensionCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
if self.awaiting_text {
|
||||
return "DIMDIAMETER Enter dimension text (blank = measured value):".into();
|
||||
return t!("DIMDIAMETER Enter dimension text (blank = measured value):").into_owned();
|
||||
}
|
||||
if self.awaiting_angle {
|
||||
return "DIMDIAMETER Specify text angle (degrees):".into();
|
||||
return t!("DIMDIAMETER Specify text angle (degrees):").into_owned();
|
||||
}
|
||||
match self.step {
|
||||
Step::CenterPoint => "DIMDIAMETER Specify center point:".into(),
|
||||
Step::ArcPoint(_) => "DIMDIAMETER Specify point on circle:".into(),
|
||||
Step::CenterPoint => t!("DIMDIAMETER Specify center point:").into_owned(),
|
||||
Step::ArcPoint(_) => t!("DIMDIAMETER Specify point on circle:").into_owned(),
|
||||
Step::TextPoint { .. } => {
|
||||
"DIMDIAMETER Specify dimension line location [Text/Angle]:".into()
|
||||
t!("DIMDIAMETER Specify dimension line location [Text/Angle]:").into_owned()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ use glam::{DVec3, Vec3};
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/dim_baseline.svg"));
|
||||
|
||||
@@ -130,9 +131,9 @@ impl CadCommand for DimBaselineCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
if !self.ready {
|
||||
"DIMBASELINE No base dimension found. Place a dimension first.".into()
|
||||
t!("DIMBASELINE No base dimension found. Place a dimension first.").into_owned()
|
||||
} else {
|
||||
"DIMBASELINE Specify a second extension line origin (Enter to exit):".into()
|
||||
t!("DIMBASELINE Specify a second extension line origin (Enter to exit):").into_owned()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ use glam::{DVec3, Vec3};
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/dim_continue.svg"));
|
||||
|
||||
@@ -104,9 +105,9 @@ impl CadCommand for DimContinueCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
if !self.ready {
|
||||
"DIMCONTINUE No base dimension found. Place a dimension first.".into()
|
||||
t!("DIMCONTINUE No base dimension found. Place a dimension first.").into_owned()
|
||||
} else {
|
||||
"DIMCONTINUE Specify a second extension line origin (Enter to exit):".into()
|
||||
t!("DIMCONTINUE Specify a second extension line origin (Enter to exit):").into_owned()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ use glam::DVec3;
|
||||
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/dim_break.svg"));
|
||||
|
||||
@@ -50,9 +51,9 @@ impl CadCommand for DimBreakCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
Step::PickDim => "DIMBREAK Select dimension to break:".into(),
|
||||
Step::PickDim => t!("DIMBREAK Select dimension to break:").into_owned(),
|
||||
Step::PickCrossing { .. } => {
|
||||
"DIMBREAK Select object to break at, or Enter for Auto:".into()
|
||||
t!("DIMBREAK Select object to break at, or Enter for Auto:").into_owned()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ use glam::DVec3;
|
||||
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/dim_edit.svg"));
|
||||
|
||||
@@ -45,9 +46,9 @@ impl CadCommand for DimEditCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
Step::PickDim => "DIMEDIT Select dimension:".into(),
|
||||
Step::PickDim => t!("DIMEDIT Select dimension:").into_owned(),
|
||||
Step::EnterText { .. } => {
|
||||
"DIMEDIT Enter text override (blank = reset to measured):".into()
|
||||
t!("DIMEDIT Enter text override (blank = reset to measured):").into_owned()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ use glam::DVec3;
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/dim_jog.svg"));
|
||||
|
||||
@@ -46,8 +47,8 @@ impl CadCommand for DimJogLineCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
Step::PickDim => "DIMJOGLINE Select linear or aligned dimension:".into(),
|
||||
Step::PickJogPos { .. } => "DIMJOGLINE Specify jog location:".into(),
|
||||
Step::PickDim => t!("DIMJOGLINE Select linear or aligned dimension:").into_owned(),
|
||||
Step::PickJogPos { .. } => t!("DIMJOGLINE Specify jog location:").into_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ use glam::DVec3;
|
||||
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/dim_space.svg"));
|
||||
|
||||
@@ -47,12 +48,13 @@ impl CadCommand for DimSpaceCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
Step::PickBase => "DIMSPACE Select base dimension:".into(),
|
||||
Step::PickOthers { others, .. } => format!(
|
||||
"DIMSPACE Select dimension to space ({} selected, Enter when done):",
|
||||
others.len()
|
||||
),
|
||||
Step::EnterSpacing { .. } => "DIMSPACE Enter value (0 = auto):".into(),
|
||||
Step::PickBase => t!("DIMSPACE Select base dimension:").into_owned(),
|
||||
Step::PickOthers { others, .. } => t!(
|
||||
"DIMSPACE Select dimension to space (%{count} selected, Enter when done):",
|
||||
count = others.len()
|
||||
)
|
||||
.into_owned(),
|
||||
Step::EnterSpacing { .. } => t!("DIMSPACE Enter value (0 = auto):").into_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ use glam::DVec3;
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/dim_tedit.svg"));
|
||||
|
||||
@@ -49,8 +50,10 @@ impl CadCommand for DimTeditCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
Step::PickDim => "DIMTEDIT Select dimension:".into(),
|
||||
Step::PickTextPos { .. } => "DIMTEDIT Specify new location for dimension text:".into(),
|
||||
Step::PickDim => t!("DIMTEDIT Select dimension:").into_owned(),
|
||||
Step::PickTextPos { .. } => {
|
||||
t!("DIMTEDIT Specify new location for dimension text:").into_owned()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ use glam::{DVec3, Mat4, Vec3};
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/leader.svg"));
|
||||
|
||||
@@ -52,12 +53,13 @@ impl CadCommand for LeaderCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
if self.verts.is_empty() {
|
||||
"LEADER Specify arrowhead point:".into()
|
||||
t!("LEADER Specify arrowhead point:").into_owned()
|
||||
} else {
|
||||
format!(
|
||||
"LEADER Specify next point [{} pts — Enter to place text]:",
|
||||
self.verts.len()
|
||||
t!(
|
||||
"LEADER Specify next point [%{count} pts — Enter to place text]:",
|
||||
count = self.verts.len()
|
||||
)
|
||||
.into_owned()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use glam::{DVec3, Mat4, Vec3};
|
||||
use crate::t;
|
||||
|
||||
/// World-space measurement axis for a linear dimension between `first` and
|
||||
/// `second`, chosen as the UCS X or Y axis (whichever the span is closer to).
|
||||
@@ -75,18 +76,18 @@ impl CadCommand for LinearDimensionCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
if self.awaiting_text {
|
||||
return "DIMLINEAR Enter dimension text (blank = measured value):".into();
|
||||
return t!("DIMLINEAR Enter dimension text (blank = measured value):").into_owned();
|
||||
}
|
||||
if self.awaiting_angle {
|
||||
return "DIMLINEAR Specify text angle (degrees):".into();
|
||||
return t!("DIMLINEAR Specify text angle (degrees):").into_owned();
|
||||
}
|
||||
match self.step {
|
||||
Step::FirstPoint => "DIMLINEAR Specify first extension line origin:".into(),
|
||||
Step::FirstPoint => t!("DIMLINEAR Specify first extension line origin:").into_owned(),
|
||||
Step::SecondPoint(_) => {
|
||||
"DIMLINEAR Specify second extension line origin [Text/Angle]:".into()
|
||||
t!("DIMLINEAR Specify second extension line origin [Text/Angle]:").into_owned()
|
||||
}
|
||||
Step::DimensionLine { .. } => {
|
||||
"DIMLINEAR Specify dimension line location [Text/Angle]:".into()
|
||||
t!("DIMLINEAR Specify dimension line location [Text/Angle]:").into_owned()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ use glam::{DVec3, Mat4, Vec3};
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/mleader.svg"));
|
||||
|
||||
@@ -47,12 +48,13 @@ impl CadCommand for MLeaderCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
if self.verts.is_empty() {
|
||||
"MLEADER Specify arrowhead point:".into()
|
||||
t!("MLEADER Specify arrowhead point:").into_owned()
|
||||
} else {
|
||||
format!(
|
||||
"MLEADER Specify next point [{} pts — Enter to place text]:",
|
||||
self.verts.len()
|
||||
t!(
|
||||
"MLEADER Specify next point [%{count} pts — Enter to place text]:",
|
||||
count = self.verts.len()
|
||||
)
|
||||
.into_owned()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ use glam::{DVec3, Vec3};
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::t;
|
||||
|
||||
// ── MLEADERADD ────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -60,12 +61,15 @@ impl CadCommand for MLeaderAddCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
AddStep::PickMLeader => "MLEADERADD Select a multileader:".into(),
|
||||
AddStep::PickArrowhead { .. } => "MLEADERADD Specify arrowhead location:".into(),
|
||||
AddStep::CollectPoints { pts, .. } => format!(
|
||||
"MLEADERADD Specify next leader point ({} pts, Enter to finish):",
|
||||
pts.len()
|
||||
),
|
||||
AddStep::PickMLeader => t!("MLEADERADD Select a multileader:").into_owned(),
|
||||
AddStep::PickArrowhead { .. } => {
|
||||
t!("MLEADERADD Specify arrowhead location:").into_owned()
|
||||
}
|
||||
AddStep::CollectPoints { pts, .. } => t!(
|
||||
"MLEADERADD Specify next leader point (%{count} pts, Enter to finish):",
|
||||
count = pts.len()
|
||||
)
|
||||
.into_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,9 +196,9 @@ impl CadCommand for MLeaderRemoveCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
RemoveStep::PickMLeader => "MLEADERREMOVE Select a multileader:".into(),
|
||||
RemoveStep::PickMLeader => t!("MLEADERREMOVE Select a multileader:").into_owned(),
|
||||
RemoveStep::PickLeaderToRemove { .. } => {
|
||||
"MLEADERREMOVE Click near the leader line to remove:".into()
|
||||
t!("MLEADERREMOVE Click near the leader line to remove:").into_owned()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -300,13 +304,13 @@ impl CadCommand for MLeaderAlignCommand {
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
AlignStep::Gathering => {
|
||||
"MLEADERALIGN Select multileaders to align (Enter when done):".into()
|
||||
t!("MLEADERALIGN Select multileaders to align (Enter when done):").into_owned()
|
||||
}
|
||||
AlignStep::PickDirection { .. } => {
|
||||
"MLEADERALIGN Specify direction — pick start point:".into()
|
||||
t!("MLEADERALIGN Specify direction — pick start point:").into_owned()
|
||||
}
|
||||
AlignStep::PickEndDir { .. } => {
|
||||
"MLEADERALIGN Specify end point of alignment direction:".into()
|
||||
t!("MLEADERALIGN Specify end point of alignment direction:").into_owned()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -405,10 +409,10 @@ impl CadCommand for MLeaderCollectCommand {
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
CollectStep::Gathering => {
|
||||
"MLEADERCOLLECT Select multileaders to collect (Enter when done):".into()
|
||||
t!("MLEADERCOLLECT Select multileaders to collect (Enter when done):").into_owned()
|
||||
}
|
||||
CollectStep::PickLocation { .. } => {
|
||||
"MLEADERCOLLECT Specify collected multileader location:".into()
|
||||
t!("MLEADERCOLLECT Specify collected multileader location:").into_owned()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use glam::DVec3;
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/mtext.svg"));
|
||||
|
||||
@@ -37,7 +38,7 @@ impl CadCommand for MTextCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
Step::InsertPoint => "MTEXT Specify insertion point:".into(),
|
||||
Step::InsertPoint => t!("MTEXT Specify insertion point:").into_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ use glam::{DVec3, Vec3};
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::t;
|
||||
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
@@ -50,8 +51,8 @@ impl CadCommand for OrdinateDimCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match self.step {
|
||||
Step::FeaturePoint => "DIMORDINATE Specify feature location:".into(),
|
||||
Step::LeaderEndpoint { .. } => "DIMORDINATE Specify leader endpoint:".into(),
|
||||
Step::FeaturePoint => t!("DIMORDINATE Specify feature location:").into_owned(),
|
||||
Step::LeaderEndpoint { .. } => t!("DIMORDINATE Specify leader endpoint:").into_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ use glam::DVec3;
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/qdim.svg"));
|
||||
|
||||
@@ -50,8 +51,10 @@ impl CadCommand for QdimCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
Step::Gathering => "QDIM Select geometry to dimension (Enter when done):".into(),
|
||||
Step::PlaceLine { .. } => "QDIM Specify dimension line position:".into(),
|
||||
Step::Gathering => {
|
||||
t!("QDIM Select geometry to dimension (Enter when done):").into_owned()
|
||||
}
|
||||
Step::PlaceLine { .. } => t!("QDIM Specify dimension line position:").into_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use glam::{DVec3, Vec3};
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/dim_radius.svg"));
|
||||
|
||||
@@ -55,16 +56,16 @@ impl CadCommand for RadiusDimensionCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
if self.awaiting_text {
|
||||
return "DIMRADIUS Enter dimension text (blank = measured value):".into();
|
||||
return t!("DIMRADIUS Enter dimension text (blank = measured value):").into_owned();
|
||||
}
|
||||
if self.awaiting_angle {
|
||||
return "DIMRADIUS Specify text angle (degrees):".into();
|
||||
return t!("DIMRADIUS Specify text angle (degrees):").into_owned();
|
||||
}
|
||||
match self.step {
|
||||
Step::CenterPoint => "DIMRADIUS Specify center point:".into(),
|
||||
Step::RadiusPoint(_) => "DIMRADIUS Specify radius point:".into(),
|
||||
Step::CenterPoint => t!("DIMRADIUS Specify center point:").into_owned(),
|
||||
Step::RadiusPoint(_) => t!("DIMRADIUS Specify radius point:").into_owned(),
|
||||
Step::TextPoint { .. } => {
|
||||
"DIMRADIUS Specify dimension line location [Text/Angle]:".into()
|
||||
t!("DIMRADIUS Specify dimension line location [Text/Angle]:").into_owned()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ use glam::DVec3;
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/table.svg"));
|
||||
|
||||
@@ -57,13 +58,23 @@ impl CadCommand for TableCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
Step::Columns => format!("TABLE Enter number of columns [{DEFAULT_COLS}]:"),
|
||||
Step::Rows { cols } => format!(
|
||||
"TABLE Enter number of rows (incl. header) [{DEFAULT_ROWS}] ({cols} cols):"
|
||||
),
|
||||
Step::Insertion { cols, rows } => {
|
||||
format!("TABLE Specify insertion point [{cols}×{rows}]:")
|
||||
}
|
||||
Step::Columns => t!(
|
||||
"TABLE Enter number of columns [%{cols}]:",
|
||||
cols = DEFAULT_COLS
|
||||
)
|
||||
.into_owned(),
|
||||
Step::Rows { cols } => t!(
|
||||
"TABLE Enter number of rows (incl. header) [%{rows}] (%{cols} cols):",
|
||||
rows = DEFAULT_ROWS,
|
||||
cols = cols
|
||||
)
|
||||
.into_owned(),
|
||||
Step::Insertion { cols, rows } => t!(
|
||||
"TABLE Specify insertion point [%{cols}×%{rows}]:",
|
||||
cols = cols,
|
||||
rows = rows
|
||||
)
|
||||
.into_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use glam::DVec3;
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/text.svg"));
|
||||
|
||||
@@ -37,7 +38,7 @@ impl CadCommand for TextCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
Step::InsertPoint => "TEXT Specify insertion point:".into(),
|
||||
Step::InsertPoint => t!("TEXT Specify insertion point:").into_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ use acadrust::Handle;
|
||||
use glam::DVec3;
|
||||
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::t;
|
||||
|
||||
/// Parse a TEXTEDITMODE value. Accepts `0`/`m`/`multiple`/`false` (Multiple → false)
|
||||
/// and `1`/`s`/`single`/`true` (Single → true), case-insensitive. Returns `None`
|
||||
@@ -69,24 +70,27 @@ impl CadCommand for TexteditCommand {
|
||||
match self.step {
|
||||
Step::PickObject => {
|
||||
if self.edit_count == 0 {
|
||||
"TEXTEDIT Select an annotation object or [Undo Mode]:".to_string()
|
||||
t!("TEXTEDIT Select an annotation object or [Undo Mode]:").into_owned()
|
||||
} else {
|
||||
"TEXTEDIT Select an annotation object or [Undo Mode] <exit>:".to_string()
|
||||
t!("TEXTEDIT Select an annotation object or [Undo Mode] <exit>:").into_owned()
|
||||
}
|
||||
}
|
||||
Step::EnterMode => {
|
||||
let prefix = if self.invalid_mode {
|
||||
"Requires Single or Multiple. "
|
||||
format!("{} ", t!("Requires Single or Multiple."))
|
||||
} else {
|
||||
""
|
||||
String::new()
|
||||
};
|
||||
format!(
|
||||
"{prefix}TEXTEDIT Enter text edit mode [Single/Multiple] <{}>:",
|
||||
match self.mode {
|
||||
TextEditMode::Single => "Single",
|
||||
TextEditMode::Multiple => "Multiple",
|
||||
}
|
||||
let mode = match self.mode {
|
||||
TextEditMode::Single => t!("Single"),
|
||||
TextEditMode::Multiple => t!("Multiple"),
|
||||
};
|
||||
t!(
|
||||
"%{prefix}TEXTEDIT Enter text edit mode [Single/Multiple] <%{mode}>:",
|
||||
prefix = prefix,
|
||||
mode = mode
|
||||
)
|
||||
.into_owned()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -220,11 +224,16 @@ impl CadCommand for TexteditmodeCommand {
|
||||
fn prompt(&self) -> String {
|
||||
let v = if self.current { 1 } else { 0 };
|
||||
let prefix = if self.invalid {
|
||||
"Requires 0 OR 1 OR MULTIPLE OR SINGLE. "
|
||||
format!("{} ", t!("Requires 0 OR 1 OR MULTIPLE OR SINGLE."))
|
||||
} else {
|
||||
""
|
||||
String::new()
|
||||
};
|
||||
format!("{prefix}TEXTEDITMODE Enter new value for TEXTEDITMODE <{v}>:")
|
||||
t!(
|
||||
"%{prefix}TEXTEDITMODE Enter new value for TEXTEDITMODE <%{v}>:",
|
||||
prefix = prefix,
|
||||
v = v
|
||||
)
|
||||
.into_owned()
|
||||
}
|
||||
|
||||
fn wants_text_input(&self) -> bool {
|
||||
|
||||
@@ -12,6 +12,7 @@ use glam::DVec3;
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
use crate::t;
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/tolerance.svg"));
|
||||
|
||||
@@ -46,8 +47,10 @@ impl CadCommand for ToleranceCommand {
|
||||
|
||||
fn prompt(&self) -> String {
|
||||
match &self.step {
|
||||
Step::Text => "TOLERANCE Enter tolerance text:".into(),
|
||||
Step::Insertion { text } => format!("TOLERANCE Specify insertion point [{text}]:"),
|
||||
Step::Text => t!("TOLERANCE Enter tolerance text:").into_owned(),
|
||||
Step::Insertion { text } => {
|
||||
t!("TOLERANCE Specify insertion point [%{text}]:", text = text).into_owned()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user