refactor(i18n): group Fluent attributes

This commit is contained in:
Hakan Seven committed 2026-08-09 11:12:47 +03:00
1 parent f3c2e061e0
commit 2f60dd0f59
26 files changed
+45139 -44415

No files matched your search

+4 -4
View File
@@ -183,8 +183,8 @@ impl CommandLine {
pub fn new() -> Self {
let mut cl = Self::default();
cl.history_height = HISTORY_HEIGHT_DEFAULT;
cl.push_info(&crate::tr!("command-line-ready"));
cl.push_info(&crate::tr!("command-line-hint"));
cl.push_info(&crate::tr!("command-line", "ready"));
cl.push_info(&crate::tr!("command-line", "hint"));
cl
}
@@ -522,7 +522,7 @@ impl CommandLine {
}
});
let prompt = container(
text(crate::tr!("command-line-label")).size(11).style(|theme: &Theme| iced::widget::text::Style {
text(crate::tr!("command-line", "label")).size(11).style(|theme: &Theme| iced::widget::text::Style {
color: Some(theme.palette().success.base.color),
}),
)
@@ -559,7 +559,7 @@ impl CommandLine {
..Default::default()
}
});
let literal_tip = container(text(crate::tr!("command-line-literal-spaces")).size(11))
let literal_tip = container(text(crate::tr!("command-line", "literal-spaces")).size(11))
.padding([3, 6])
.style(container::bordered_box);
let literal_btn = tooltip(literal_btn, literal_tip, tooltip::Position::Top).gap(4);
+1 -1
View File
@@ -106,7 +106,7 @@ pub fn view_window<'a>(
);
}
let close = button(text(crate::tr!("action-close")).size(12))
let close = button(text(crate::tr!("action", "close")).size(12))
.on_press(Message::CloseModal)
.padding([6, 18])
.style(button::secondary);
+15 -15
View File
@@ -91,12 +91,12 @@ pub fn view_window<'a>(
let palette = ui_theme.palette.to_iced();
let colors = [
(crate::tr!("options-color-background"), palette.background),
(crate::tr!("options-color-text"), palette.text),
(crate::tr!("options-color-primary"), palette.primary),
(crate::tr!("options-color-success"), palette.success),
(crate::tr!("options-color-warning"), palette.warning),
(crate::tr!("options-color-danger"), palette.danger),
(crate::tr!("options", "color-background"), palette.background),
(crate::tr!("options", "color-text"), palette.text),
(crate::tr!("options", "color-primary"), palette.primary),
(crate::tr!("options", "color-success"), palette.success),
(crate::tr!("options", "color-warning"), palette.warning),
(crate::tr!("options", "color-danger"), palette.danger),
];
let mut color_controls = column![].spacing(8);
@@ -126,16 +126,16 @@ pub fn view_window<'a>(
);
}
let close = button(text(crate::tr!("action-close")).size(12))
let close = button(text(crate::tr!("action", "close")).size(12))
.on_press(Message::CloseModal)
.padding([6, 18])
.style(button::secondary);
let general = column![
text(crate::tr!("options-language-section")).size(15),
text(crate::tr!("options", "language-section")).size(15),
Space::new().height(10),
row![
text(crate::tr!("options-language-label")).size(12).width(150),
text(crate::tr!("options", "language-label")).size(12).width(150),
iced::widget::pick_list(
selected_language,
language_options,
@@ -147,10 +147,10 @@ pub fn view_window<'a>(
.spacing(12)
.align_y(iced::Center),
Space::new().height(22),
text(crate::tr!("options-open-save-section")).size(15),
text(crate::tr!("options", "open-save-section")).size(15),
Space::new().height(10),
row![
text(crate::tr!("options-default-save-format-label")).size(12).width(150),
text(crate::tr!("options", "default-save-format-label")).size(12).width(150),
iced::widget::pick_list(
selected_format,
crate::io::SAVE_FORMAT_OPTIONS,
@@ -162,7 +162,7 @@ pub fn view_window<'a>(
.spacing(12)
.align_y(iced::Center),
Space::new().height(8),
text(crate::tr!("options-default-save-format-help"))
text(crate::tr!("options", "default-save-format-help"))
.size(11)
.width(sizing.width),
Space::new().height(14),
@@ -204,10 +204,10 @@ pub fn view_window<'a>(
});
let display = column![
text(crate::tr!("options-theme-section")).size(15),
text(crate::tr!("options", "theme-section")).size(15),
Space::new().height(10),
row![
text(crate::tr!("options-theme-label")).size(12).width(150),
text(crate::tr!("options", "theme-label")).size(12).width(150),
iced::widget::pick_list(
selected_theme,
theme_options,
@@ -219,7 +219,7 @@ pub fn view_window<'a>(
.spacing(12)
.align_y(iced::Center),
Space::new().height(8),
text(crate::tr!("options-theme-help"))
text(crate::tr!("options", "theme-help"))
.size(11)
.width(sizing.width),
Space::new().height(12),
+20 -20
View File
@@ -49,32 +49,32 @@ pub fn view_window<'a>(
) -> Element<'a, Message> {
let recovered = report.status == RecoveryStatus::Recovered;
let heading = if recovered {
crate::tr!("recovery-opened-with-repairs")
crate::tr!("recovery", "opened-with-repairs")
} else {
crate::tr!("recovery-open-failed")
crate::tr!("recovery", "open-failed")
};
let description = if recovered {
crate::tr!("recovery-repaired-description")
crate::tr!("recovery", "repaired-description")
} else {
crate::tr!("recovery-failed-description")
crate::tr!("recovery", "failed-description")
};
let status = report.status;
let metrics = row![
metric(
crate::tr!("recovery-entities-checked"),
crate::tr!("recovery", "entities-checked"),
report.entities_scanned.to_string(),
),
metric(
crate::tr!("recovery-issues-found"),
crate::tr!("recovery", "issues-found"),
report.issues_found().to_string(),
),
metric(
crate::tr!("recovery-entities-removed"),
crate::tr!("recovery", "entities-removed"),
report.removed_total().to_string(),
),
metric(
crate::tr!("recovery-references-checked"),
crate::tr!("recovery", "references-checked"),
report.references_checked.to_string(),
),
]
@@ -86,7 +86,7 @@ pub fn view_window<'a>(
details = details.push(
text(format!(
"{}: {}",
crate::tr!("recovery-referenced-entities-removed"),
crate::tr!("recovery", "referenced-entities-removed"),
report.referenced_entities_removed
))
.size(11),
@@ -96,7 +96,7 @@ pub fn view_window<'a>(
details = details.push(
text(format!(
"{}: {}",
crate::tr!("recovery-references-unavailable"),
crate::tr!("recovery", "references-unavailable"),
report
.references_missing
.saturating_add(report.references_failed)
@@ -112,7 +112,7 @@ pub fn view_window<'a>(
}
if let Some(path) = &report.log_path {
details = details.push(
text(format!("{}: {}", crate::tr!("recovery-log-path"), path.display()))
text(format!("{}: {}", crate::tr!("recovery", "log-path"), path.display()))
.size(10)
.style(muted_style),
);
@@ -120,14 +120,14 @@ pub fn view_window<'a>(
details = details.push(
text(format!(
"{}: {error}",
crate::tr!("recovery-log-write-failed")
crate::tr!("recovery", "log-write-failed")
))
.size(10)
.style(status_style(RecoveryStatus::Failed)),
);
} else if cfg!(target_arch = "wasm32") {
details = details.push(
text(crate::tr!("recovery-log-download-ready"))
text(crate::tr!("recovery", "log-download-ready"))
.size(10)
.style(muted_style),
);
@@ -142,7 +142,7 @@ pub fn view_window<'a>(
let mut actions = row![Space::new().width(Fill)].spacing(8);
if recovered && report.save_as_required && allow_save_copy {
actions = actions.push(
button(text(crate::tr!("recovery-save-copy")).size(12))
button(text(crate::tr!("recovery", "save-copy")).size(12))
.on_press(Message::RecoverySaveAs)
.style(button::primary)
.padding([6, 14]),
@@ -150,14 +150,14 @@ pub fn view_window<'a>(
}
if report.log_path.is_some() || cfg!(target_arch = "wasm32") {
actions = actions.push(
button(text(crate::tr!("recovery-show-log")).size(12))
button(text(crate::tr!("recovery", "show-log")).size(12))
.on_press(Message::RecoveryShowLog)
.style(button::secondary)
.padding([6, 14]),
);
}
actions = actions.push(
button(text(crate::tr!("action-close")).size(12))
button(text(crate::tr!("action", "close")).size(12))
.on_press(Message::RecoveryClose)
.style(button::secondary)
.padding([6, 14]),
@@ -200,11 +200,11 @@ pub fn view_prompt<'a>(
};
let actions = row![
Space::new().width(content_width),
button(text(crate::tr!("recovery-decline")).size(12))
button(text(crate::tr!("recovery", "decline")).size(12))
.on_press(Message::RecoveryDecline)
.style(button::secondary)
.padding([6, 14]),
button(text(crate::tr!("recovery-attempt")).size(12))
button(text(crate::tr!("recovery", "attempt")).size(12))
.on_press(Message::RecoveryAttempt)
.style(button::primary)
.padding([6, 14]),
@@ -213,9 +213,9 @@ pub fn view_prompt<'a>(
container(
column![
text(crate::tr!("recovery-prompt-heading")).size(20),
text(crate::tr!("recovery", "prompt-heading")).size(20),
text(file_name).size(13),
text(crate::tr!("recovery-prompt-description"))
text(crate::tr!("recovery", "prompt-description"))
.size(11)
.style(muted_style),
container(scrollable(text(error).size(10)).height(content_height))