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
@@ -3,6 +3,7 @@
|
||||
use crate::app::Message;
|
||||
use iced::widget::{button, column, container, row, scrollable, text, text_input, Space};
|
||||
use iced::{Background, Element, Theme};
|
||||
use crate::t;
|
||||
|
||||
fn muted_style(theme: &Theme) -> iced::widget::text::Style {
|
||||
iced::widget::text::Style {
|
||||
@@ -74,11 +75,11 @@ pub fn view_window<'a>(
|
||||
// ── Toolbar ───────────────────────────────────────────────────────────
|
||||
let toolbar = container(
|
||||
row![
|
||||
button(text("New Layout").size(11))
|
||||
button(text(t!("New Layout")).size(11))
|
||||
.on_press(Message::LayoutManagerNew)
|
||||
.style(btn_s(false))
|
||||
.padding([4, 10]),
|
||||
button(text("Delete").size(11))
|
||||
button(text(t!("Delete")).size(11))
|
||||
.on_press(Message::LayoutManagerDelete)
|
||||
.style(move |theme: &Theme, status| {
|
||||
if is_model {
|
||||
@@ -92,7 +93,7 @@ pub fn view_window<'a>(
|
||||
button(
|
||||
row![
|
||||
crate::ui::icons::themed_arrow_left(9.0),
|
||||
text("Move Left").size(11),
|
||||
text(t!("Move Left")).size(11),
|
||||
]
|
||||
.spacing(4)
|
||||
.align_y(iced::Center),
|
||||
@@ -102,7 +103,7 @@ pub fn view_window<'a>(
|
||||
.padding([4, 8]),
|
||||
button(
|
||||
row![
|
||||
text("Move Right").size(11),
|
||||
text(t!("Move Right")).size(11),
|
||||
crate::ui::icons::themed_arrow_right(9.0),
|
||||
]
|
||||
.spacing(4)
|
||||
@@ -111,7 +112,7 @@ pub fn view_window<'a>(
|
||||
.on_press(Message::LayoutManagerMoveRight)
|
||||
.style(btn_s(false))
|
||||
.padding([4, 8]),
|
||||
button(text("Set Current").size(11))
|
||||
button(text(t!("Set Current")).size(11))
|
||||
.on_press(Message::LayoutManagerSetCurrent)
|
||||
.style(btn_s(true))
|
||||
.padding([4, 10]),
|
||||
@@ -151,7 +152,7 @@ pub fn view_window<'a>(
|
||||
|
||||
let layout_list = container(
|
||||
column![
|
||||
text("Layouts").size(10).style(muted_style),
|
||||
text(t!("Layouts")).size(10).style(muted_style),
|
||||
container(scrollable(column(list_items).spacing(2)).height(sizing.height))
|
||||
.style(container::bordered_box)
|
||||
.width(sizing.width)
|
||||
@@ -174,24 +175,24 @@ pub fn view_window<'a>(
|
||||
let details = container(
|
||||
column![
|
||||
text(if is_model {
|
||||
"Model Space"
|
||||
t!("Model Space")
|
||||
} else {
|
||||
"Paper Space Layout"
|
||||
t!("Paper Space Layout")
|
||||
})
|
||||
.size(13),
|
||||
Space::new().height(8),
|
||||
row![
|
||||
text("Name:").size(11).style(muted_style).width(80),
|
||||
text(t!("Name:")).size(11).style(muted_style).width(80),
|
||||
text(selected).size(11),
|
||||
]
|
||||
.spacing(8)
|
||||
.align_y(iced::Center),
|
||||
row![
|
||||
text("Status:").size(11).style(muted_style).width(80),
|
||||
text(t!("Status:")).size(11).style(muted_style).width(80),
|
||||
text(if selected == current.as_str() {
|
||||
"Active"
|
||||
t!("Active")
|
||||
} else {
|
||||
"Inactive"
|
||||
t!("Inactive")
|
||||
})
|
||||
.size(11)
|
||||
.style(move |theme: &Theme| {
|
||||
@@ -205,14 +206,14 @@ pub fn view_window<'a>(
|
||||
.spacing(8)
|
||||
.align_y(iced::Center),
|
||||
Space::new().height(16),
|
||||
text("Rename").size(10).style(muted_style),
|
||||
text(t!("Rename")).size(10).style(muted_style),
|
||||
row![
|
||||
text_input("New name…", rename_buf)
|
||||
text_input(t!("New name…").as_ref(), rename_buf)
|
||||
.on_input(Message::LayoutManagerRenameBuf)
|
||||
.on_submit(Message::LayoutManagerRenameCommit)
|
||||
.size(11)
|
||||
.padding([4, 8]),
|
||||
button(text("OK").size(11))
|
||||
button(text(t!("OK")).size(11))
|
||||
.on_press(Message::LayoutManagerRenameCommit)
|
||||
.style(btn_s(true))
|
||||
.padding([4, 10]),
|
||||
|
||||
Reference in new issue
Block a user