Complete application localization across all supported languages

This commit is contained in:
Hakan Seven committed 2026-09-07 01:05:02 +03:00
1 parent 96c794c072
commit d66e89ca19
78 files changed
+26043 -877

No files matched your search

+23 -23
View File
@@ -29,7 +29,7 @@ impl OpenCADStudio {
let describe = |c: &Color| match c {
Color::ByLayer => "ByLayer".to_string(),
Color::ByBlock => "ByBlock".to_string(),
Color::Index(n) => format!("index {n}"),
Color::Index(n) => crate::tf!("index {n}").into_owned(),
_ => "(custom)".to_string(),
};
let arg = if cmd == "BYLAYER" {
@@ -65,7 +65,7 @@ impl OpenCADStudio {
}
None => {
self.command_line.push_error(
"Usage: COLOR <ByLayer|ByBlock|1-255|red|yellow|green|cyan|blue|magenta|white>",
crate::t!("Usage: COLOR <ByLayer|ByBlock|1-255|red|yellow|green|cyan|blue|magenta|white>").as_ref(),
);
}
}
@@ -486,19 +486,19 @@ impl OpenCADStudio {
// Per-type breakdown so the user sees exactly what went.
let mut parts: Vec<String> = Vec::new();
if n_layers > 0 {
parts.push(format!("{n_layers} layer(s)"));
parts.push(crate::tf!("{n_layers} layer(s)").into_owned());
}
if n_styles > 0 {
parts.push(format!("{n_styles} text style(s)"));
parts.push(crate::tf!("{n_styles} text style(s)").into_owned());
}
if n_lts > 0 {
parts.push(format!("{n_lts} linetype(s)"));
parts.push(crate::tf!("{n_lts} linetype(s)").into_owned());
}
if n_blocks > 0 {
parts.push(format!("{n_blocks} block(s)"));
parts.push(crate::tf!("{n_blocks} block(s)").into_owned());
}
if n_sortents > 0 {
parts.push(format!("{n_sortents} stale draw-order table(s)"));
parts.push(crate::tf!("{n_sortents} stale draw-order table(s)").into_owned());
}
self.command_line.push_output(crate::tf!(
"PURGE: {} item(s) removed — {}.",
@@ -539,7 +539,7 @@ impl OpenCADStudio {
if prop.is_empty() {
self.command_line.push_info(
"Usage: CHPROP <prop> <val> (props: LAYER COLOR LINETYPE LTSCALE)",
crate::t!("Usage: CHPROP <prop> <val> (props: LAYER COLOR LINETYPE LTSCALE)").as_ref(),
);
} else {
let handles: Vec<_> = self.tabs[i]
@@ -940,7 +940,7 @@ impl OpenCADStudio {
let value = it.next().map(|s| s.trim().to_string());
if name.is_empty() || name == "?" {
self.command_line.push_info(
"SETVAR: LTSCALE CELTSCALE PDMODE PDSIZE TEXTSIZE ORTHOMODE FILLMODE MIRRTEXT FRAME IMAGEFRAME PDFFRAME WIPEOUTFRAME XCLIPFRAME POINTCLOUDCLIPFRAME ZOOMWHEEL ZOOMFACTOR CURSORSIZE PICKBOX CURSORTYPE SNAPANG TEXTFILL CLIPROMPTLINES COMMANDLINEFADETIME ATTREQ ATTDIA DIMASSOC DIMCONTINUEMODE ANGBASE ANGDIR SKETCHINC SKPOLY SKTOLERANCE DONUTID DONUTOD CENTEREXE CENTERLAYER CENTERLTYPE CENTERLTSCALE CENTERLTYPEFILE CENTERCROSSSIZE CENTERCROSSGAP CENTERMARKEXE COLORTHEME SELECTIONAREA SELECTIONAREAOPACITY SELECTIONEFFECT SELECTIONEFFECTCOLOR WINDOWSAREACOLOR CROSSINGAREACOLOR SELECTIONPREVIEW GRIPSIZE GRIPCOLOR GRIPHOT GRIPHOVER | CLAYER CELTYPE TEXTSTYLE (read-only)",
crate::t!("SETVAR: LTSCALE CELTSCALE PDMODE PDSIZE TEXTSIZE ORTHOMODE FILLMODE MIRRTEXT FRAME IMAGEFRAME PDFFRAME WIPEOUTFRAME XCLIPFRAME POINTCLOUDCLIPFRAME ZOOMWHEEL ZOOMFACTOR CURSORSIZE PICKBOX CURSORTYPE SNAPANG TEXTFILL CLIPROMPTLINES COMMANDLINEFADETIME ATTREQ ATTDIA DIMASSOC DIMCONTINUEMODE ANGBASE ANGDIR SKETCHINC SKPOLY SKTOLERANCE DONUTID DONUTOD CENTEREXE CENTERLAYER CENTERLTYPE CENTERLTSCALE CENTERLTYPEFILE CENTERCROSSSIZE CENTERCROSSGAP CENTERMARKEXE COLORTHEME SELECTIONAREA SELECTIONAREAOPACITY SELECTIONEFFECT SELECTIONEFFECTCOLOR WINDOWSAREACOLOR CROSSINGAREACOLOR SELECTIONPREVIEW GRIPSIZE GRIPCOLOR GRIPHOT GRIPHOVER | CLAYER CELTYPE TEXTSTYLE (read-only)").as_ref(),
);
} else {
if matches!(name.as_str(), "SHOWHIST" | "SOLIDHIST") {
@@ -964,12 +964,12 @@ impl OpenCADStudio {
self.tabs[i].dirty = true;
self.refresh_properties();
}
self.command_line.push_output(&format!("{name} = {mode}"));
self.command_line.push_output(&crate::tf!("{name} = {mode}"));
}
None => self.command_line.push_error(&format!("{name}: expected an integer from 0 to {maximum}.")),
None => self.command_line.push_error(&crate::tf!("{name}: expected an integer from 0 to {maximum}.")),
}
} else {
self.command_line.push_output(&format!("Enter new value for {name} <{current}>:"));
self.command_line.push_output(&crate::tf!("Enter new value for {name} <{current}>:"));
self.pending_setvar = Some(name.clone());
}
return Some(self.finish_dispatch(cmd));
@@ -1033,7 +1033,7 @@ impl OpenCADStudio {
self.tabs[i].dirty = true;
}
self.command_line
.push_output(&format!("{name} = {mode}"));
.push_output(&crate::tf!("{name} = {mode}"));
}
_ => self.command_line.push_error(
crate::tf!("SETVAR: {name} requires 0, 1, or 2.").as_ref(),
@@ -1095,10 +1095,10 @@ impl OpenCADStudio {
self.dimension_continue_mode = mode;
self.persist_settings_if_changed();
self.command_line
.push_output(&format!("DIMCONTINUEMODE = {mode}"));
.push_output(&crate::tf!("DIMCONTINUEMODE = {mode}"));
}
_ => self.command_line.push_error(
"SETVAR: DIMCONTINUEMODE requires 0 or 1.",
crate::t!("SETVAR: DIMCONTINUEMODE requires 0 or 1.").as_ref(),
),
}
} else {
@@ -1136,13 +1136,13 @@ impl OpenCADStudio {
crate::modules::draw::defaults::set_donut_outer_diameter(number);
}
self.command_line
.push_output(&format!("{name} = {number}"));
.push_output(&crate::tf!("{name} = {number}"));
} else {
self.command_line.push_error(if name == "DONUTID" {
self.command_line.push_error(crate::t!(if name == "DONUTID" {
"SETVAR: DONUTID requires a finite value greater than or equal to zero."
} else {
"SETVAR: DONUTOD requires a finite value greater than zero."
});
}).as_ref());
}
} else {
self.command_line.push_output(crate::tf!(
@@ -2097,7 +2097,7 @@ impl OpenCADStudio {
false,
)),
},
_ => Err(format!("SETVAR: unknown variable \"{name}\".")),
_ => Err(crate::tf!("SETVAR: unknown variable \"{name}\".").into_owned()),
}
};
match outcome {
@@ -2501,7 +2501,7 @@ impl OpenCADStudio {
self.command_line.push_output(crate::tf!("PDMODE set to {v}").as_ref());
} else {
self.command_line.push_error(
"Usage: PDMODE [value] (0=dot 1=none 2=+ 3=x 4=tick; +32 circle, +64 square)",
crate::t!("Usage: PDMODE [value] (0=dot 1=none 2=+ 3=x 4=tick; +32 circle, +64 square)").as_ref(),
);
}
}
@@ -2569,7 +2569,7 @@ impl OpenCADStudio {
self.persist_settings_if_changed();
match crate::io::file_association::register_as_handler() {
Ok(()) => self.command_line.push_output(
"FILEASSOC set to 1 — registered as a .dwg/.dxf/.bak handler",
crate::t!("FILEASSOC set to 1 — registered as a .dwg/.dxf/.bak handler").as_ref(),
),
Err(e) => self
.command_line
@@ -2614,7 +2614,7 @@ impl OpenCADStudio {
let msg = if v == 0 {
"SAVETIME set to 0 (autosave off)".to_string()
} else {
format!("SAVETIME set to {v} minute(s)")
crate::tf!("SAVETIME set to {v} minute(s)").into_owned()
};
self.command_line.push_output(&msg);
}
@@ -2646,7 +2646,7 @@ impl OpenCADStudio {
.push_output(crate::tf!("PDSIZE set to {v:.4}").as_ref());
} else {
self.command_line.push_error(
"Usage: PDSIZE [value] (>0 absolute size, <0 percent of viewport, 0 default)",
crate::t!("Usage: PDSIZE [value] (>0 absolute size, <0 percent of viewport, 0 default)").as_ref(),
);
}
}