feat(locale): add Fluent translations

Default to the platform language with persisted overrides across native and web builds.

Refs #630
This commit is contained in:
Hakan Seven committed 2026-08-02 18:53:38 +03:00
1 parent e102887000
commit b90b3e3ecf
26 files changed
+1581 -112

No files matched your search

+14 -10
View File
@@ -61,23 +61,27 @@ impl CadCommand for CopyCommand {
fn prompt(&self) -> String {
if self.awaiting_count {
return "COPY Enter number of items to array:".to_string();
return crate::tr!("command-copy-array-count");
}
match &self.step {
Step::Base => format!(
"COPY Specify base point [{} objects]:",
self.handles.len()
Step::Base => crate::tr!(
"command-copy-base",
count = (self.handles.len() as i64),
),
Step::Placing(base) => {
if let Some(n) = self.array_count {
format!(
"COPY Specify second point for {n}-item array [base {:.3},{:.3}]:",
base.x, base.y
crate::tr!(
"command-copy-array-target",
count = (n as i64),
x = format!("{:.3}", base.x),
y = format!("{:.3}", base.y),
)
} else {
format!(
"COPY Specify destination [{} copies so far | Array | Enter=done | base {:.3},{:.3}]:",
self.count, base.x, base.y
crate::tr!(
"command-copy-target",
count = (self.count as i64),
x = format!("{:.3}", base.x),
y = format!("{:.3}", base.y),
)
}
}
+7 -6
View File
@@ -53,13 +53,14 @@ impl CadCommand for MoveCommand {
fn prompt(&self) -> String {
match &self.step {
Step::Base => format!(
"MOVE Specify base point [{} objects]:",
self.handles.len()
Step::Base => crate::tr!(
"command-move-base",
count = (self.handles.len() as i64),
),
Step::Target(base) => format!(
"MOVE Specify destination [base {:.3},{:.3}]:",
base.x, base.y
Step::Target(base) => crate::tr!(
"command-move-target",
x = format!("{:.3}", base.x),
y = format!("{:.3}", base.y),
),
}
}