M14: View menu, tooltips and Keyboard shortcuts show Ctrl, not ⌘, off macOS (#695)

View ▸ Zoom and Page navigation were hand-written with "⌘1", "⌘[" … while
the registered items below them were formatted by Shortcut::label, so
Linux showed both ⌘1 and Ctrl+K in one menu. Ten tooltips and the view-key
rows of Help ▸ Keyboard shortcuts hard-coded ⌘ the same way.

- The keys the document view handles itself are Shortcut constants in
  ui-egui commands.rs, written with the same Shortcut::label.
- Labels follow egui's detected OS (ctx.os()) instead of cfg!, so the web
  build in a Linux or Windows browser shows Ctrl too, and tests can check
  both platforms.
- Translated tooltips take a {key} placeholder (13 catalogs; only the
  shortcut token changed, hashes updated in ATTRIBUTION.toml).
- Fit visible is listed once in View (in Zoom), not also in the generated
  list; Ctrl+3 and the palette still run it.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Brandon Thomas <[email protected]>
This commit is contained in:
authored and GitHub committed 2026-10-10 06:32:06 -04:00
1 parent bfa65a9bfc
commit ebc5ccd4c0
22 files changed
+318 -190

No files matched your search

+13 -13
View File
@@ -19,7 +19,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Simplified Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "b130884fb43c0b69122b649e94726213782beff5a88c7efbc9b83f21d41f6800"
sha256 = "b4f5905c404dbc8841391aa9a35dbdf8ad78606df208f64ede3c336654025397"
[[asset]]
path = "crates/ui-egui/src/i18n/zh-hant.tsv"
@@ -30,7 +30,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Traditional Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "d00c946c83bf590dc23971b77f94f51017223cb7587055f83715490a1d152e66"
sha256 = "d989733686d249c6cb8cddc0a4cafbe2896d0801bf59ad76a684d3b30306154b"
[[asset]]
path = "crates/ui-egui/src/i18n/cs.tsv"
@@ -52,7 +52,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Brazilian Portuguese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "6e59e0df51801b317b1e707cb1eab54287ff3c6afdb660eab31683ddfde86342"
sha256 = "f4f6d80aa0d213446f686bc6f930ba4a9e988441a659e0e0c623a81b1823ec19"
[[asset]]
path = "crates/ui-egui/src/i18n/es.tsv"
@@ -63,7 +63,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Spanish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "cd27ba57af6b8016a30b29ff8c3fdb39805192711162517e6e0d608ac18dcec6"
sha256 = "640881c5e7a15603027b26b7f8a23a735d0e9b6cb3697ed5b7d7f2626d3939bd"
[[asset]]
path = "crates/ui-egui/src/i18n/fr.tsv"
@@ -74,7 +74,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "French UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "f24ffb1d5b239575ba605592da4502f24d755fae26126107d791d1e9e5d6eea7"
sha256 = "29357d34f7646a81c78c4c3d199757e306592caf352ea57581b36de0bdf0288f"
[[asset]]
path = "crates/ui-egui/src/i18n/de.tsv"
@@ -85,7 +85,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "German UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "23b96e2bd6d12f0f338638c8a9ca487f89de796f2c153341d28cb04c5b600262"
sha256 = "7c06be24f43ba554a5f57d9702602869c0c65b6f630fd66b1d0c5b9994530baf"
[[asset]]
path = "crates/ui-egui/src/i18n/te.tsv"
@@ -96,7 +96,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Telugu UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "e0062d55c47461bae2e9ce201ce125080736534592e2028eb71831696237979d"
sha256 = "83588462b7dfd3740e764bc734ddf0d09fd1004c1dca1fd3ca9d191bb3611876"
[[asset]]
path = "crates/ui-egui/src/i18n/it.tsv"
@@ -107,7 +107,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Italian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "8292677569d108bf6c0aec18a2843865980481036de12bda599e4b085ab67b66"
sha256 = "e558d1b1374c5725b68792446b08ae31c35c7b6fd68c4a54d257b6ca439f0250"
[[asset]]
path = "crates/ui-egui/src/i18n/ru.tsv"
@@ -118,7 +118,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Russian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "948acd6dcd5e64686ae3d573656bd689e089085da8d0ee19dcaebb5a0678756f"
sha256 = "f3ee03336b29ec87742aca37930f0ff7182e2e1f7a3672da588eea3334fa4dd7"
[[asset]]
path = "crates/ui-egui/src/i18n/hu.tsv"
@@ -129,7 +129,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Hungarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "4f612f1314c29534e389fd576af1c30f3ef85509598e6545dbd187ec0a4e5efe"
sha256 = "4254b9bb4d050910f26df82d66740b46e3d7a8e33205edad053a4bdf5316f6f6"
[[asset]]
path = "crates/ui-egui/src/i18n/bg.tsv"
@@ -140,7 +140,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Bulgarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "3791ef5ee3070a46474495ce1a6ed773518a1e874263413a6885bb2de13aed15"
sha256 = "0fa3e37945099a50d0bf5ad4c3191ab2eb1bc0d5ebe253cc459917395c0a83fa"
[[asset]]
path = "crates/ui-egui/src/i18n/ja.tsv"
@@ -151,7 +151,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Japanese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "07fc4ec18275cb70fc66052005566b8c180fc07d6f73f61b2dc11d1ceefc95d4"
sha256 = "a3b2a9f3068ab60dab4f1e18fe3d2be36275508772f39122cd26a03bd67527d9"
[[asset]]
path = "crates/ui-egui/src/i18n/uk.tsv"
@@ -162,7 +162,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Ukrainian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
sha256 = "775a93bd50a66af7a94c8fb35c4592934d278a3d0c24f37d93f38056922f5143"
sha256 = "51c933a8018726368dfaa55a82e8bc99a5684f80825bfdb6b581f03c5015908f"
[[asset]]
path = "assets/icons/accessibility.svg"
+1
View File
@@ -133,6 +133,7 @@ M0 → M1 → M2 → M3 → M4 must happen in order. After M4, M5–M12 can run
- **2026-10-10 (M14, side panel width):** The side panel keeps the width it is dragged to. The Bookmarks search row was 2 px wider than the panel, and a resizable egui panel keeps the width its content used, so every repaint (any pointer move) widened it up to 520 px. The Comments reply row did the same in languages with a longer "Post" (Russian, Spanish, …); Post now sits under a full-width reply field. Tests hold both panels' widths steady across 30 repaints. Overall estimate unchanged (about 30–35%).
- **2026-10-10 (M8):** Redaction codes. Redaction properties offers "Custom text" or "Redaction code" under "Use overlay text": pick the U.S. FOIA (5 U.S.C. 552(b)) or U.S. Privacy Act (552a) set and tick codes, and new marks carry them as overlay text in the set's order ("(b)(6), (b)(7)(C)"). `redact_mark` takes `code_set` and `codes`, rejecting unknown sets and codes with the allowed list. Tests cover the code sets, the tool end to end (mark, apply, text) and the dialog; the new label is translated in all 13 UI catalogs. `protect.redaction-codes` is partial: Edit Codes, custom sets and their import/export are still missing. Estimates unchanged.
- **2026-10-10 (M14, platform shortcut labels):** View ▸ Zoom and Page navigation, the rail, find-bar, toolbar and bookmark tooltips, and Help ▸ Keyboard shortcuts write shortcuts for the platform (`Ctrl+1`, `Ctrl+Shift++` off macOS) instead of hard-coded ⌘. Labels follow egui's detected OS, so the web build in a Linux or Windows browser shows Ctrl too. Fit visible is listed once in View. Translated tooltips take a `{key}` placeholder. Overall estimate unchanged (about 30–35%).
- **2026-10-10 (M6, #95):** Prepare a form edits shared General, Appearance and applicable Options properties in one atomic undo step. Explicit opt-in controls keep mixed values unchanged; partial appearance patches preserve custom font resources, each widget's style, indirect dictionary contents and unknown keys. Ctrl/Command+A selects the current page; rectangle selection and the Fields panel support multi-selection, with panel double-click opening properties. CLI/MCP `form_set_props` accepts a bounded, unique `fields` list. Regression tests cover save/reopen, undo/redo, locked-field rollback, stale dialogs, invalid arguments and selection. Names, positions, choices/defaults and script tabs remain individual GUI edits. Integrated upstream 0.5.0 and completed Portuguese/Italian catalogs without losing translator credit; shared-property labels now cover all 14 bundled translations. Kept the new Italian interface and Fill & Sign date-language registries aligned, including accented date output; the About-dialog regression waits for the larger contributor list to settle before clicking. Milestone and overall effort estimates unchanged (about 30–35%).
- **2026-10-09 (M5, line-ending labels):** Comment properties names each line ending in words ("Reverse open arrow", "Butt", …) and those labels are translated. The PDF `/LE` token is unchanged. Overall estimate unchanged (about 30–35%).
+17 -3
View File
@@ -59,14 +59,21 @@ pub struct Shortcut {
}
impl Shortcut {
const fn cmd(key: &'static str) -> Self {
/// ⌘ (Ctrl elsewhere) and `key`.
pub const fn cmd(key: &'static str) -> Self {
Self { command: true, shift: false, mac_ctrl: false, key }
}
const fn cmd_shift(key: &'static str) -> Self {
/// ⇧⌘ (Ctrl+Shift elsewhere) and `key`.
pub const fn cmd_shift(key: &'static str) -> Self {
Self { command: true, shift: true, mac_ctrl: false, key }
}
/// The command modifier on its own, for text such as "⌘-scroll" / "Ctrl-scroll".
pub fn command_name(mac: bool) -> &'static str {
if mac { "⌘" } else { "Ctrl" }
}
/// How the shortcut is written in menus: `⇧⌘S` on macOS, `Ctrl+Shift+S` elsewhere.
pub fn label(&self, mac: bool) -> String {
if mac {
@@ -190,7 +197,9 @@ pub const COMMANDS: &[CommandSpec] = &[
// Acrobat's view modes, a page display and a zoom at once (the rail's Page display menu).
c("view.fit_width_scrolling", "Fit to width scrolling", None, None, Document, "arrow-left-right"),
c("view.fit_one_page", "Fit one full page", None, None, Document, "maximize-2"),
c("view.fit_visible", "Fit visible", VIEW, Some(Shortcut::cmd("3")), Document, "scan"),
// In View ▸ Zoom with the view-local zoom keys, so `menu = None` keeps it out of the generated
// View menu (where it would show twice). The palette and ⌘3 still run it.
c("view.fit_visible", "Fit visible", None, Some(Shortcut::cmd("3")), Document, "scan"),
c("view.marquee_zoom", "Marquee zoom", VIEW, None, Document, "zoom-in"),
c("edit.snapshot", "Take a snapshot", EDIT, None, Document, "camera"),
c("view.full_screen", "Full screen mode", VIEW, Some(Shortcut::cmd("L")), Document, "maximize"),
@@ -412,6 +421,11 @@ mod tests {
assert_eq!(s.label(true), "⇧⌘S");
assert_eq!(s.label(false), "Ctrl+Shift+S");
assert_eq!(command("view.read_mode").unwrap().shortcut.unwrap().label(true), "⌃⌘H");
assert_eq!(Shortcut::cmd("+").label(false), "Ctrl++");
assert_eq!(Shortcut::cmd_shift("−").label(true), "⇧⌘−");
assert_eq!(Shortcut::cmd_shift("−").label(false), "Ctrl+Shift+−");
assert_eq!(Shortcut::command_name(true), "⌘");
assert_eq!(Shortcut::command_name(false), "Ctrl");
}
#[test]
+4 -2
View File
@@ -2821,10 +2821,12 @@ fn find_bar(view: &mut DocView, pages: usize, area: Rect, ui: &mut egui::Ui, t:
)
};
ui.label(egui::RichText::new(status).font(theme::regular(12.0)).color(t.text_muted));
if icons::button(ui, "chevron-up", 26.0, false, tl!("Previous (⇧⌘G)")).clicked() {
let tip = crate::commands::key_tip(ui.ctx(), tl!("Previous ({key})"), crate::commands::FIND_PREV);
if icons::button(ui, "chevron-up", 26.0, false, &tip).clicked() {
step = Some(false);
}
if icons::button(ui, "chevron-down", 26.0, false, tl!("Next (⌘G)")).clicked() {
let tip = crate::commands::key_tip(ui.ctx(), tl!("Next ({key})"), crate::commands::FIND_NEXT);
if icons::button(ui, "chevron-down", 26.0, false, &tip).clicked() {
step = Some(true);
}
let opts = icons::button(ui, "settings-2", 26.0, find.case_sensitive || find.whole_words, tl!("Find options"));
+25 -16
View File
@@ -117,7 +117,8 @@ pub fn tab_strip(app: &mut PdfCraftApp, ui: &mut egui::Ui) {
ui.ctx().request_repaint();
}
ui.add_space(4.0);
if widgets::ghost_button(ui, "plus", tl!("Open")).on_hover_text(tl!("Open a PDF (⌘O)")).clicked() {
let tip = crate::commands::command_tip(ui.ctx(), tl!("Open a PDF ({key})"), "file.open");
if widgets::ghost_button(ui, "plus", tl!("Open")).on_hover_text(tip).clicked() {
app.open_dialog();
}
ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
@@ -291,13 +292,15 @@ pub fn mode_bar(app: &mut PdfCraftApp, ui: &mut egui::Ui) {
ui.spacing_mut().item_spacing.x = 4.0;
let has_doc = app.active.is_some();
ui.add_enabled_ui(has_doc, |ui| {
if icons::button(ui, "printer", 32.0, false, tl!("Print (⌘P)")).clicked() {
let tip = crate::commands::command_tip(ui.ctx(), tl!("Print ({key})"), "print.dialog");
if icons::button(ui, "printer", 32.0, false, &tip).clicked() {
app.run_command("print.dialog");
}
if icons::button(ui, "save", 32.0, false, tl!("Save (M4)")).clicked() {
app.run_command("file.save");
}
if icons::button(ui, "info", 32.0, false, tl!("Document properties (⌘D)")).clicked() {
let tip = crate::commands::command_tip(ui.ctx(), tl!("Document properties ({key})"), "file.properties");
if icons::button(ui, "info", 32.0, false, &tip).clicked() {
app.dialog = Some(Dialog::Properties(PropsTab::Description));
}
});
@@ -321,43 +324,46 @@ fn main_menu(app: &mut PdfCraftApp, ui: &mut egui::Ui) {
ui.menu_button(tl!("View"), |ui| {
if let Some(i) = app.active {
let v = &mut app.views[i];
let ctx = ui.ctx().clone();
let key = |s| crate::commands::shortcut_label(&ctx, s);
use crate::commands::{ACTUAL_SIZE, FIT_WIDTH, NEXT_VIEW, PAGE_LEVEL, PREV_VIEW, ROTATE_CCW, ROTATE_CW, ZOOM_IN, ZOOM_OUT};
ui.label(egui::RichText::new(tl!("Zoom")).color(t.text_faint).small());
if widgets::menu_item(ui, tl!("Actual size"), "⌘1").clicked() {
if widgets::menu_item(ui, tl!("Actual size"), &key(ACTUAL_SIZE)).clicked() {
v.set_zoom(1.0);
}
if widgets::menu_item(ui, tl!("Zoom to page level"), "⌘0").clicked() {
if widgets::menu_item(ui, tl!("Zoom to page level"), &key(PAGE_LEVEL)).clicked() {
v.fit = Fit::Page;
}
if widgets::menu_item(ui, tl!("Fit to width"), "⌘2").clicked() {
if widgets::menu_item(ui, tl!("Fit to width"), &key(FIT_WIDTH)).clicked() {
v.fit = Fit::Width;
}
if widgets::menu_item(ui, tl!("Fit to height"), "").clicked() {
v.fit = Fit::Height;
v.goto = Some((v.current, 0.0));
}
if widgets::menu_item(ui, tl!("Fit visible"), "⌘3").clicked() {
if widgets::menu_item(ui, tl!("Fit visible"), &crate::commands::command_shortcut_label(&ctx, "view.fit_visible")).clicked() {
ui.close();
app.execute("view.fit_visible");
return;
}
if widgets::menu_item(ui, tl!("Zoom in"), "⌘+").clicked() {
if widgets::menu_item(ui, tl!("Zoom in"), &key(ZOOM_IN)).clicked() {
v.zoom_step(true);
}
if widgets::menu_item(ui, tl!("Zoom out"), "⌘−").clicked() {
if widgets::menu_item(ui, tl!("Zoom out"), &key(ZOOM_OUT)).clicked() {
v.zoom_step(false);
}
if widgets::menu_item(ui, tl!("Rotate view clockwise"), "⇧⌘+").clicked() {
if widgets::menu_item(ui, tl!("Rotate view clockwise"), &key(ROTATE_CW)).clicked() {
v.rotate_view(true);
}
if widgets::menu_item(ui, tl!("Rotate view counterclockwise"), "⇧⌘−").clicked() {
if widgets::menu_item(ui, tl!("Rotate view counterclockwise"), &key(ROTATE_CCW)).clicked() {
v.rotate_view(false);
}
ui.separator();
ui.label(egui::RichText::new(tl!("Page navigation")).color(t.text_faint).small());
if ui.add_enabled(!v.back.is_empty(), egui::Button::new(tl!("Previous view")).shortcut_text("⌘[")).clicked() {
if ui.add_enabled(!v.back.is_empty(), egui::Button::new(tl!("Previous view")).shortcut_text(key(PREV_VIEW))).clicked() {
v.view_history(false);
}
if ui.add_enabled(!v.forward.is_empty(), egui::Button::new(tl!("Next view")).shortcut_text("⌘]")).clicked() {
if ui.add_enabled(!v.forward.is_empty(), egui::Button::new(tl!("Next view")).shortcut_text(key(NEXT_VIEW))).clicked() {
v.view_history(true);
}
ui.separator();
@@ -439,10 +445,12 @@ pub fn right_rail(app: &mut PdfCraftApp, ui: &mut egui::Ui) {
let mut page_display = None;
ui.with_layout(Layout::bottom_up(Align::Center), |ui| {
ui.spacing_mut().item_spacing.y = 2.0;
if icons::button(ui, "zoom-out", 32.0, false, tl!("Zoom out (⌘−)")).clicked() {
let tip = crate::commands::key_tip(ui.ctx(), tl!("Zoom out ({key})"), crate::commands::ZOOM_OUT);
if icons::button(ui, "zoom-out", 32.0, false, &tip).clicked() {
view.zoom_step(false);
}
if icons::button(ui, "zoom-in", 32.0, false, tl!("Zoom in (⌘+)")).clicked() {
let tip = crate::commands::key_tip(ui.ctx(), tl!("Zoom in ({key})"), crate::commands::ZOOM_IN);
if icons::button(ui, "zoom-in", 32.0, false, &tip).clicked() {
view.zoom_step(true);
}
// Between rotate and zoom, as in Acrobat. Its command runs once `view` is free.
@@ -454,7 +462,8 @@ pub fn right_rail(app: &mut PdfCraftApp, ui: &mut egui::Ui) {
rail_view_menu(ui, view)
})
.and_then(|r| r.inner);
if icons::button(ui, "rotate-cw", 32.0, false, tl!("Rotate view clockwise (⇧⌘+)")).clicked() {
let tip = crate::commands::key_tip(ui.ctx(), tl!("Rotate view clockwise ({key})"), crate::commands::ROTATE_CW);
if icons::button(ui, "rotate-cw", 32.0, false, &tip).clicked() {
view.rotate_view(true);
}
// Not `columns-2` while fitting the page: that is the two-page view's icon.
+47 -2
View File
@@ -5,7 +5,7 @@
//! the control channel later) all call `PdfCraftApp::execute`.
use pdfcraft_engine::Edit;
use pdfcraft_engine::commands::{self, COMMANDS, CommandSpec};
use pdfcraft_engine::commands::{self, COMMANDS, CommandSpec, Shortcut};
use crate::{
Dialog, Mode, PdfCraftApp, PropsTab, RightPanel, SaveTarget,
@@ -13,6 +13,51 @@ use crate::{
widgets,
};
/// Keys the document view handles itself (`canvas::shortcuts`), for the View menu, tooltips and
/// Help ▸ Keyboard shortcuts. Keep them in step with the bindings there.
pub(crate) const ACTUAL_SIZE: Shortcut = Shortcut::cmd("1");
pub(crate) const PAGE_LEVEL: Shortcut = Shortcut::cmd("0");
pub(crate) const FIT_WIDTH: Shortcut = Shortcut::cmd("2");
pub(crate) const ZOOM_IN: Shortcut = Shortcut::cmd("+");
pub(crate) const ZOOM_OUT: Shortcut = Shortcut::cmd("−");
pub(crate) const ROTATE_CW: Shortcut = Shortcut::cmd_shift("+");
pub(crate) const ROTATE_CCW: Shortcut = Shortcut::cmd_shift("−");
pub(crate) const PREV_VIEW: Shortcut = Shortcut::cmd("[");
pub(crate) const NEXT_VIEW: Shortcut = Shortcut::cmd("]");
pub(crate) const FIND_NEXT: Shortcut = Shortcut::cmd("G");
pub(crate) const FIND_PREV: Shortcut = Shortcut::cmd_shift("G");
pub(crate) const COPY: Shortcut = Shortcut::cmd("C");
pub(crate) const SELECT_ALL: Shortcut = Shortcut::cmd("A");
pub(crate) const PAGE_PREV: Shortcut = Shortcut::cmd("←");
pub(crate) const PAGE_NEXT: Shortcut = Shortcut::cmd("→");
/// Whether shortcuts are written the macOS way (`⇧⌘S`) rather than `Ctrl+Shift+S`. egui knows the
/// platform from the build target, and on the web from the browser's user agent.
pub(crate) fn mac_shortcuts(ctx: &egui::Context) -> bool {
ctx.os() == egui::os::OperatingSystem::Mac
}
/// How `s` is written on this platform.
pub(crate) fn shortcut_label(ctx: &egui::Context, s: Shortcut) -> String {
s.label(mac_shortcuts(ctx))
}
/// How a registered command's shortcut is written on this platform ("" without one).
pub(crate) fn command_shortcut_label(ctx: &egui::Context, id: &str) -> String {
commands::command(id).and_then(|c| c.shortcut).map(|s| shortcut_label(ctx, s)).unwrap_or_default()
}
/// A translated tooltip with a `{key}` placeholder, filled with `s` as written on this platform:
/// "Zoom in ({key})" → "Zoom in (Ctrl++)".
pub(crate) fn key_tip(ctx: &egui::Context, template: &str, s: Shortcut) -> String {
crate::i18n::fmt(template, &[("key", &shortcut_label(ctx, s))])
}
/// [`key_tip`] with a registered command's shortcut, so the tooltip names the real binding.
pub(crate) fn command_tip(ctx: &egui::Context, template: &str, id: &str) -> String {
crate::i18n::fmt(template, &[("key", &command_shortcut_label(ctx, id))])
}
impl PdfCraftApp {
/// Whether a registered command can run now. The engine judges the document (security,
/// contents, undo history); view state it can't see is checked here.
@@ -570,7 +615,7 @@ impl PdfCraftApp {
/// Render a top-level menu's registered commands (with live labels, shortcuts and enablement).
pub(crate) fn registry_menu(app: &mut PdfCraftApp, ui: &mut egui::Ui, menu: &str) {
let mac = cfg!(target_os = "macos") || cfg!(target_arch = "wasm32");
let mac = mac_shortcuts(ui.ctx());
for spec in commands::menu(menu) {
let label = commands::current_label(spec, &app.session, app.active_ids().map(|(_, id)| id));
let label = crate::i18n::menu_label(spec.id, &label);
+29 -18
View File
@@ -1024,32 +1024,43 @@ pub fn show(app: &mut PdfCraftApp, ctx: &egui::Context) {
Dialog::Shortcuts => {
ui.label(egui::RichText::new(tl!("Keyboard shortcuts")).font(theme::semibold(18.0)));
ui.add_space(8.0);
let mac = cfg!(target_os = "macos") || cfg!(target_arch = "wasm32");
use crate::commands::{
ACTUAL_SIZE, COPY, FIND_NEXT, FIND_PREV, FIT_WIDTH, PAGE_LEVEL, PAGE_NEXT, PAGE_PREV, ROTATE_CCW, ROTATE_CW, SELECT_ALL, ZOOM_IN,
ZOOM_OUT,
};
let mac = crate::commands::mac_shortcuts(ui.ctx());
// Registered commands first (always in sync with the real bindings), then the
// keys the document view handles itself.
let mut rows: Vec<(String, String)> = pdfcraft_engine::commands::COMMANDS
.iter()
.filter_map(|c| c.shortcut.map(|k| (k.label(mac), tl!(c.label).trim_end_matches('…').to_string())))
.collect();
let key = |s: pdfcraft_engine::commands::Shortcut| s.label(mac);
let pair = |a, b| format!("{} / {}", key(a), key(b));
// Key names, translated where a catalog has them (not scanned as UI literals).
let named = |k: &str| tl!(k).to_string();
let scroll = crate::i18n::fmt(
tl!("Zoom in / out (also pinch or {key}-scroll)"),
&[("key", pdfcraft_engine::commands::Shortcut::command_name(mac))],
);
for (k, v) in [
("⌘G / ⇧⌘G", tl!("Next / previous match")),
("⌘C", tl!("Copy selected text")),
("Double-click", tl!("Select a word")),
("Esc", tl!("Clear selection / close find")),
("⌘1", tl!("Actual size")),
("⌘0", tl!("Zoom to page level")),
("⌘2", tl!("Fit to width")),
("⌘3", tl!("Fit visible")),
("⌘+ / ⌘−", tl!("Zoom in / out (also pinch or ⌘-scroll)")),
("⇧⌘+ / ⇧⌘−", tl!("Rotate view")),
("Home / End", tl!("First / last page")),
("← / →, ⌘← / ⌘→", tl!("Previous / next page")),
("V", tl!("Select (V)")),
("H / Space (hold)", tl!("Hand (H)")),
("Delete", tl!("Delete selected pages (Organize)")),
("⌘A", tl!("Select all pages (Organize)")),
(pair(FIND_NEXT, FIND_PREV), tl!("Next / previous match").to_string()),
(key(COPY), tl!("Copy selected text").to_string()),
(named("Double-click"), tl!("Select a word").to_string()),
(named("Esc"), tl!("Clear selection / close find").to_string()),
(key(ACTUAL_SIZE), tl!("Actual size").to_string()),
(key(PAGE_LEVEL), tl!("Zoom to page level").to_string()),
(key(FIT_WIDTH), tl!("Fit to width").to_string()),
(pair(ZOOM_IN, ZOOM_OUT), scroll),
(pair(ROTATE_CW, ROTATE_CCW), tl!("Rotate view").to_string()),
(named("Home / End"), tl!("First / last page").to_string()),
(format!("← / →, {}", pair(PAGE_PREV, PAGE_NEXT)), tl!("Previous / next page").to_string()),
(named("V"), tl!("Select (V)").to_string()),
(named("H / Space (hold)"), tl!("Hand (H)").to_string()),
(named("Delete"), tl!("Delete selected pages (Organize)").to_string()),
(key(SELECT_ALL), tl!("Select all pages (Organize)").to_string()),
] {
rows.push((tl!(k).to_string(), tl!(v).to_string()));
rows.push((k, v));
}
egui::ScrollArea::vertical().max_height(460.0).show(ui, |ui| {
egui::Grid::new("keys").num_columns(2).spacing([24.0, 6.0]).show(ui, |ui| {
+10 -10
View File
@@ -1069,19 +1069,19 @@
Attachments Прикачени файлове
Signatures Подписи
Accessibility Checker Проверка на достъпността
Zoom out (⌘−) Намали мащаба (⌘−)
Zoom in (⌘+) Увеличи мащаба (⌘+)
Rotate view clockwise (⇧⌘+) Завърти изгледа по часовниковата стрелка (⇧⌘+)
Zoom out ({key}) Намали мащаба ({key})
Zoom in ({key}) Увеличи мащаба ({key})
Rotate view clockwise ({key}) Завърти изгледа по часовниковата стрелка ({key})
Toggle fit page / fit width Превключи между „побери страницата“ и „побери по ширина“
Next page Следваща страница
Previous page Предишна страница
Current page — type a page number or label (such as iv) and press Enter Текуща страница — въведете номер или етикет на страница (например iv) и натиснете Enter
Open a PDF (⌘O) Отвори PDF файл (⌘O)
Open a PDF ({key}) Отвори PDF файл ({key})
Dark gray theme Тъмносива тема
Light theme Светла тема
Print (⌘P) Печат (⌘P)
Print ({key}) Печат ({key})
Save (M4) Запиши (M4)
Document properties (⌘D) Свойства на документа (⌘D)
Document properties ({key}) Свойства на документа ({key})
Action Wizard… Съветник за действия…
Add Bates numbering… Добави номериране на Бейтс…
Add a button Добави бутон
@@ -1211,7 +1211,7 @@
Expand all bookmarks Разгъни всички отметки
Expand top-level bookmarks Разгъни отметките от първо ниво
Collapse all bookmarks Свий всички отметки
New bookmark (⌘B) Нова отметка (⌘B)
New bookmark ({key}) Нова отметка ({key})
This document has no bookmarks. Този документ няма отметки.
This document has no layers. Този документ няма слоеве.
This document has no attachments. Този документ няма прикачени файлове.
@@ -1226,8 +1226,8 @@
No matches Няма съвпадения
Searching… {s}/{p} Търсене… {s}/{p}
{c} of {n}{more} {c} от {n}{more}
Previous (⇧⌘G) Предишно (⇧⌘G)
Next (⌘G) Следващо (⌘G)
Previous ({key}) Предишно ({key})
Next ({key}) Следващо ({key})
Find options Опции за търсене
Whole words only Само цели думи
Case-sensitive Чувствително към регистъра
@@ -1298,7 +1298,7 @@
Copy selected text Копирай избрания текст
Select a word Избери дума
Clear selection / close find Изчисти избора / затвори търсенето
Zoom in / out (also pinch or ⌘-scroll) Увеличи / намали (също с щипване или ⌘ + превъртане)
Zoom in / out (also pinch or {key}-scroll) Увеличи / намали (също с щипване или {key} + превъртане)
Rotate view Завърти изгледа
First / last page Първа / последна страница
Previous / next page Предишна / следваща страница
Can't render this file because it contains an unexpected character in line 8 and column 16.
+10 -10
View File
@@ -68,7 +68,7 @@
Double-click Doppelklick
Select a word Wort auswählen
Clear selection / close find Auswahl aufheben / Suche schließen
Zoom in / out (also pinch or ⌘-scroll) Vergrößern / Verkleinern (auch per Pinch-Geste oder ⌘ + Scrollen)
Zoom in / out (also pinch or {key}-scroll) Vergrößern / Verkleinern (auch per Pinch-Geste oder {key} + Scrollen)
Rotate view Ansicht drehen
First / last page Erste / letzte Seite
Previous / next page Vorherige / nächste Seite
@@ -76,16 +76,16 @@
Select all pages (Organize) Alle Seiten auswählen (Organisieren)
Home Start
Open Öffnen
Open a PDF (⌘O) PDF öffnen (⌘O)
Open a PDF ({key}) PDF öffnen ({key})
Dark gray theme Dunkelgraues Design
Light theme Helles Design
All tools Alle Werkzeuge
Read Lesen
Convert Konvertieren
E-Sign E-Signatur
Print (⌘P) Drucken (⌘P)
Print ({key}) Drucken ({key})
Save (M4) Speichern (M4)
Document properties (⌘D) Dokumenteigenschaften (⌘D)
Document properties ({key}) Dokumenteigenschaften ({key})
Find tools and commands Tools und Befehle suchen
Fit to height Seitenhöhe
Zoom in Vergrößern
@@ -114,9 +114,9 @@
Compare Vergleichen
Page thumbnails Seitenminiaturen
Form fields Formularfelder
Zoom out (⌘−) Verkleinern (⌘−)
Zoom in (⌘+) Vergrößern (⌘+)
Rotate view clockwise (⇧⌘+) Ansicht im Uhrzeigersinn drehen (⇧⌘+)
Zoom out ({key}) Verkleinern ({key})
Zoom in ({key}) Vergrößern ({key})
Rotate view clockwise ({key}) Ansicht im Uhrzeigersinn drehen ({key})
Toggle fit page / fit width Ganze Seite / Seitenbreite umschalten
Next page Nächste Seite
Previous page Vorherige Seite
@@ -1249,7 +1249,7 @@
Expand all bookmarks Alle Lesezeichen erweitern
Expand top-level bookmarks Lesezeichen der obersten Ebene erweitern
Collapse all bookmarks Alle Lesezeichen reduzieren
New bookmark (⌘B) Neues Lesezeichen (⌘B)
New bookmark ({key}) Neues Lesezeichen ({key})
This document has no bookmarks. Dieses Dokument hat keine Lesezeichen.
This document has no layers. Dieses Dokument hat keine Ebenen.
This document has no attachments. Dieses Dokument hat keine Anhänge.
@@ -1263,8 +1263,8 @@
No matches Keine Treffer
Searching… {s}/{p} Suche läuft… {s}/{p}
{c} of {n}{more} {c} von {n}{more}
Previous (⇧⌘G) Vorheriger (⇧⌘G)
Next (⌘G) Nächster (⌘G)
Previous ({key}) Vorheriger ({key})
Next ({key}) Nächster ({key})
Find options Suchoptionen
Whole words only Nur ganze Wörter
Case-sensitive Groß-/Kleinschreibung beachten
Can't render this file because it contains an unexpected character in line 6 and column 51.
+10 -10
View File
@@ -89,7 +89,7 @@
Double-click Doble clic
Select a word Seleccionar una palabra
Clear selection / close find Borrar la selección / cerrar la búsqueda
Zoom in / out (also pinch or ⌘-scroll) Acercar / alejar (también con pellizco o ⌘ + desplazamiento)
Zoom in / out (also pinch or {key}-scroll) Acercar / alejar (también con pellizco o {key} + desplazamiento)
Rotate view Girar la vista
First / last page Primera / última página
Previous / next page Página anterior / siguiente
@@ -97,16 +97,16 @@
Select all pages (Organize) Seleccionar todas las páginas (Organizar)
Home Inicio
Open Abrir
Open a PDF (⌘O) Abrir un PDF (⌘O)
Open a PDF ({key}) Abrir un PDF ({key})
Dark gray theme Tema gris oscuro
Light theme Tema claro
All tools Todas las herramientas
Read Leer
Convert Convertir
E-Sign Firma electrónica
Print (⌘P) Imprimir (⌘P)
Print ({key}) Imprimir ({key})
Save (M4) Guardar (M4)
Document properties (⌘D) Propiedades del documento (⌘D)
Document properties ({key}) Propiedades del documento ({key})
Find tools and commands Buscar herramientas y comandos
Fit to height Ajustar al alto
Zoom in Acercar
@@ -135,9 +135,9 @@
Compare Comparar
Page thumbnails Miniaturas de página
Form fields Campos de formulario
Zoom out (⌘−) Alejar (⌘−)
Zoom in (⌘+) Acercar (⌘+)
Rotate view clockwise (⇧⌘+) Girar la vista a la derecha (⇧⌘+)
Zoom out ({key}) Alejar ({key})
Zoom in ({key}) Acercar ({key})
Rotate view clockwise ({key}) Girar la vista a la derecha ({key})
Toggle fit page / fit width Alternar entre ajustar a la página y al ancho
Next page Página siguiente
Previous page Página anterior
@@ -1262,7 +1262,7 @@
Expand all bookmarks Expandir todos los marcadores
Expand top-level bookmarks Expandir los marcadores de primer nivel
Collapse all bookmarks Contraer todos los marcadores
New bookmark (⌘B) Nuevo marcador (⌘B)
New bookmark ({key}) Nuevo marcador ({key})
This document has no bookmarks. Este documento no tiene marcadores.
This document has no layers. Este documento no tiene capas.
This document has no attachments. Este documento no tiene archivos adjuntos.
@@ -1277,8 +1277,8 @@
No matches Sin coincidencias
Searching… {s}/{p} Buscando… {s}/{p}
{c} of {n}{more} {c} de {n}{more}
Previous (⇧⌘G) Anterior (⇧⌘G)
Next (⌘G) Siguiente (⌘G)
Previous ({key}) Anterior ({key})
Next ({key}) Siguiente ({key})
Find options Opciones de búsqueda
Whole words only Solo palabras completas
Case-sensitive Distinguir mayúsculas y minúsculas
Can't render this file because it contains an unexpected character in line 6 and column 60.
+10 -10
View File
@@ -68,7 +68,7 @@
Double-click Double-clic
Select a word Sélectionner un mot
Clear selection / close find Effacer la sélection / fermer la recherche
Zoom in / out (also pinch or ⌘-scroll) Zoom avant / arrière (aussi pincer ou ⌘-défilement)
Zoom in / out (also pinch or {key}-scroll) Zoom avant / arrière (aussi pincer ou {key}-défilement)
Rotate view Pivoter l'affichage
First / last page Première / dernière page
Previous / next page Page précédente / suivante
@@ -76,16 +76,16 @@
Select all pages (Organize) Sélectionner toutes les pages (Organiser)
Home Accueil
Open Ouvrir
Open a PDF (⌘O) Ouvrir un PDF (⌘O)
Open a PDF ({key}) Ouvrir un PDF ({key})
Dark gray theme Thème gris foncé
Light theme Thème clair
All tools Tous les outils
Read Lire
Convert Convertir
E-Sign Signature électronique
Print (⌘P) Imprimer (⌘P)
Print ({key}) Imprimer ({key})
Save (M4) Enregistrer (M4)
Document properties (⌘D) Propriétés du document (⌘D)
Document properties ({key}) Propriétés du document ({key})
Find tools and commands Rechercher des outils et des commandes
Fit to height Ajuster à la hauteur
Zoom in Zoom avant
@@ -114,9 +114,9 @@
Compare Comparer
Page thumbnails Vignettes de page
Form fields Champs de formulaire
Zoom out (⌘−) Zoom arrière (⌘−)
Zoom in (⌘+) Zoom avant (⌘+)
Rotate view clockwise (⇧⌘+) Pivoter l'affichage vers la droite (⇧⌘+)
Zoom out ({key}) Zoom arrière ({key})
Zoom in ({key}) Zoom avant ({key})
Rotate view clockwise ({key}) Pivoter l'affichage vers la droite ({key})
Toggle fit page / fit width Basculer entre ajuster à la page et à la largeur
Next page Page suivante
Previous page Page précédente
@@ -1248,7 +1248,7 @@
Expand all bookmarks Développer tous les signets
Expand top-level bookmarks Développer les signets de premier niveau
Collapse all bookmarks Réduire tous les signets
New bookmark (⌘B) Nouveau signet (⌘B)
New bookmark ({key}) Nouveau signet ({key})
This document has no bookmarks. Ce document ne contient aucun signet.
This document has no layers. Ce document ne contient aucun calque.
This document has no attachments. Ce document ne contient aucune pièce jointe.
@@ -1262,8 +1262,8 @@
No matches Aucune correspondance
Searching… {s}/{p} Recherche… {s}/{p}
{c} of {n}{more} {c} sur {n}{more}
Previous (⇧⌘G) Précédent (⇧⌘G)
Next (⌘G) Suivant (⌘G)
Previous ({key}) Précédent ({key})
Next ({key}) Suivant ({key})
Find options Options de recherche
Whole words only Mots entiers seulement
Case-sensitive Respecter la casse
Can't render this file because it contains an unexpected character in line 6 and column 39.
+10 -10
View File
@@ -66,7 +66,7 @@
Double-click Dupla kattintás
Select a word Szó kijelölése
Clear selection / close find Kijelölés törlése / keresés bezárása
Zoom in / out (also pinch or ⌘-scroll) Nagyítás / kicsinyítés (csípéssel vagy ⌘-görgetéssel is)
Zoom in / out (also pinch or {key}-scroll) Nagyítás / kicsinyítés (csípéssel vagy {key}-görgetéssel is)
Rotate view Nézet forgatása
First / last page Első / utolsó oldal
Previous / next page Előző / következő oldal
@@ -74,16 +74,16 @@
Select all pages (Organize) Összes oldal kijelölése (Rendezés)
Home Kezdőlap
Open Megnyitás
Open a PDF (⌘O) PDF megnyitása (⌘O)
Open a PDF ({key}) PDF megnyitása ({key})
Dark gray theme Sötétszürke téma
Light theme Világos téma
All tools Minden eszköz
Read Olvasás
Convert Konvertálás
E-Sign E-aláírás
Print (⌘P) Nyomtatás (⌘P)
Print ({key}) Nyomtatás ({key})
Save (M4) Mentés (M4)
Document properties (⌘D) Dokumentum tulajdonságai (⌘D)
Document properties ({key}) Dokumentum tulajdonságai ({key})
Find tools and commands Eszközök és parancsok keresése
Fit to height Magassághoz igazítás
Zoom in Nagyítás
@@ -112,9 +112,9 @@
Compare Összehasonlítás
Page thumbnails Oldalbélyegképek
Form fields Űrlapmezők
Zoom out (⌘−) Kicsinyítés (⌘−)
Zoom in (⌘+) Nagyítás (⌘+)
Rotate view clockwise (⇧⌘+) Nézet forgatása az óramutató járásával megegyezően (⇧⌘+)
Zoom out ({key}) Kicsinyítés ({key})
Zoom in ({key}) Nagyítás ({key})
Rotate view clockwise ({key}) Nézet forgatása az óramutató járásával megegyezően ({key})
Toggle fit page / fit width Teljes oldal / szélesség váltása
Next page Következő oldal
Previous page Előző oldal
@@ -1238,7 +1238,7 @@
Expand all bookmarks Összes könyvjelző kibontása
Expand top-level bookmarks A legfelső szintű könyvjelzők kibontása
Collapse all bookmarks Összes könyvjelző összecsukása
New bookmark (⌘B) Új könyvjelző (⌘B)
New bookmark ({key}) Új könyvjelző ({key})
This document has no bookmarks. Ebben a dokumentumban nincs könyvjelző.
This document has no layers. Ebben a dokumentumban nincs réteg.
This document has no attachments. Ebben a dokumentumban nincs melléklet.
@@ -1252,8 +1252,8 @@
No matches Nincs találat
Searching… {s}/{p} Keresés… {s}/{p}
{c} of {n}{more} {c} / {n}{more}
Previous (⇧⌘G) Előző (⇧⌘G)
Next (⌘G) Következő (⌘G)
Previous ({key}) Előző ({key})
Next ({key}) Következő ({key})
Find options Keresés beállításai
Whole words only Csak egész szavak
Case-sensitive Kis- és nagybetű
Can't render this file because it contains an unexpected character in line 7 and column 44.
+10 -10
View File
@@ -92,7 +92,7 @@
Double-click Doppio clic
Select a word Seleziona una parola
Clear selection / close find Deseleziona / chiudi ricerca
Zoom in / out (also pinch or ⌘-scroll) Aumenta/riduci ingrandimento (anche con pizzico o ⌘ + rotellina)
Zoom in / out (also pinch or {key}-scroll) Aumenta/riduci ingrandimento (anche con pizzico o {key} + rotellina)
Rotate view Ruota vista
First / last page Prima/ultima pagina
Previous / next page Pagina precedente/successiva
@@ -100,16 +100,16 @@
Select all pages (Organize) Seleziona tutte le pagine (Organizza)
Home Home
Open Apri
Open a PDF (⌘O) Apri un PDF (⌘O)
Open a PDF ({key}) Apri un PDF ({key})
Dark gray theme Tema grigio scuro
Light theme Tema chiaro
All tools Tutti gli strumenti
Read Lettura
Convert Converti
E-Sign Firma elettronica
Print (⌘P) Stampa (⌘P)
Print ({key}) Stampa ({key})
Save (M4) Salva (M4)
Document properties (⌘D) Proprietà documento (⌘D)
Document properties ({key}) Proprietà documento ({key})
Find tools and commands Trova strumenti e comandi
Fit to height Adatta all'altezza
Zoom in Aumenta ingrandimento
@@ -138,9 +138,9 @@
Compare Confronta
Page thumbnails Miniature pagine
Form fields Campi modulo
Zoom out (⌘−) Riduci ingrandimento (⌘−)
Zoom in (⌘+) Aumenta ingrandimento (⌘+)
Rotate view clockwise (⇧⌘+) Ruota vista in senso orario (⇧⌘+)
Zoom out ({key}) Riduci ingrandimento ({key})
Zoom in ({key}) Aumenta ingrandimento ({key})
Rotate view clockwise ({key}) Ruota vista in senso orario ({key})
Toggle fit page / fit width Alterna adatta alla pagina / adatta alla larghezza
Next page Pagina successiva
Previous page Pagina precedente
@@ -1263,7 +1263,7 @@
Expand all bookmarks Espandi tutti i segnalibri
Expand top-level bookmarks Espandi segnalibri di primo livello
Collapse all bookmarks Comprimi tutti i segnalibri
New bookmark (⌘B) Nuovo segnalibro (⌘B)
New bookmark ({key}) Nuovo segnalibro ({key})
This document has no bookmarks. Questo documento non ha segnalibri.
This document has no layers. Questo documento non ha livelli.
This document has no attachments. Questo documento non ha allegati.
@@ -1278,8 +1278,8 @@
No matches Nessuna corrispondenza
Searching… {s}/{p} Ricerca in corso… {s}/{p}
{c} of {n}{more} {c} di {n}{more}
Previous (⇧⌘G) Precedente (⇧⌘G)
Next (⌘G) Successivo (⌘G)
Previous ({key}) Precedente ({key})
Next ({key}) Successivo ({key})
Find options Opzioni di ricerca
Whole words only Solo parole intere
Case-sensitive Maiuscole/minuscole
Can't render this file because it contains an unexpected character in line 6 and column 47.
+10 -10
View File
@@ -95,7 +95,7 @@
Double-click ダブルクリック
Select a word 単語を選択
Clear selection / close find 選択を解除/検索を閉じる
Zoom in / out (also pinch or ⌘-scroll) 拡大/縮小(ピンチ操作や ⌘+スクロールも使用可能)
Zoom in / out (also pinch or {key}-scroll) 拡大/縮小(ピンチ操作や {key}+スクロールも使用可能)
Rotate view 表示を回転
First / last page 最初/最後のページ
Previous / next page 前/次のページ
@@ -103,16 +103,16 @@
Select all pages (Organize) すべてのページを選択(ページ整理)
Home ホーム
Open 開く
Open a PDF (⌘O) PDF を開く(⌘O)
Open a PDF ({key}) PDF を開く({key})
Dark gray theme ダークグレーのテーマ
Light theme ライトテーマ
All tools すべてのツール
Read 閲覧
Convert 変換
E-Sign 電子署名
Print (⌘P) 印刷(⌘P)
Print ({key}) 印刷({key})
Save (M4) 保存(M4)
Document properties (⌘D) 文書のプロパティ(⌘D)
Document properties ({key}) 文書のプロパティ({key})
Find tools and commands ツールとコマンドを検索
Fit to height 高さに合わせる
Zoom in 拡大
@@ -141,9 +141,9 @@
Compare 比較
Page thumbnails ページサムネール
Form fields フォームフィールド
Zoom out (⌘−) 縮小(⌘−)
Zoom in (⌘+) 拡大(⌘+)
Rotate view clockwise (⇧⌘+) 表示を時計回りに回転(⇧⌘+)
Zoom out ({key}) 縮小({key})
Zoom in ({key}) 拡大({key})
Rotate view clockwise ({key}) 表示を時計回りに回転({key})
Toggle fit page / fit width ページ全体/幅に合わせるを切り替え
Next page 次のページ
Previous page 前のページ
@@ -1268,7 +1268,7 @@
Expand all bookmarks すべてのしおりを展開
Expand top-level bookmarks 最上位のしおりを展開
Collapse all bookmarks すべてのしおりを折りたたむ
New bookmark (⌘B) 新しいしおり(⌘B)
New bookmark ({key}) 新しいしおり({key})
This document has no bookmarks. この文書にしおりはありません。
This document has no layers. この文書にレイヤーはありません。
This document has no attachments. この文書に添付ファイルはありません。
@@ -1283,8 +1283,8 @@
No matches 一致なし
Searching… {s}/{p} 検索中… {s}/{p}
{c} of {n}{more} {c} / {n}{more}
Previous (⇧⌘G) 前へ(⇧⌘G)
Next (⌘G) 次へ(⌘G)
Previous ({key}) 前へ({key})
Next ({key}) 次へ({key})
Find options 検索オプション
Whole words only 単語単位で検索
Case-sensitive 大文字と小文字を区別
Can't render this file because it contains an unexpected character in line 6 and column 47.
+10 -10
View File
@@ -1011,19 +1011,19 @@
Attachments Anexos
Signatures Assinaturas
Accessibility Checker Verificador de acessibilidade
Zoom out (⌘−) Diminuir zoom (⌘−)
Zoom in (⌘+) Aumentar zoom (⌘+)
Rotate view clockwise (⇧⌘+) Girar visualização em sentido horário (⇧⌘+)
Zoom out ({key}) Diminuir zoom ({key})
Zoom in ({key}) Aumentar zoom ({key})
Rotate view clockwise ({key}) Girar visualização em sentido horário ({key})
Toggle fit page / fit width Alternar ajustar à página / ajustar à largura
Next page Próxima página
Previous page Página anterior
Current page — type a page number or label (such as iv) and press Enter Página atual — digite o número da página ou rótulo (como iv) e pressione Enter
Open a PDF (⌘O) Abrir um PDF (⌘O)
Open a PDF ({key}) Abrir um PDF ({key})
Dark gray theme Tema cinza escuro
Light theme Tema claro
Print (⌘P) Imprimir (⌘P)
Print ({key}) Imprimir ({key})
Save (M4) Salvar (M4)
Document properties (⌘D) Propriedades do documento (⌘D)
Document properties ({key}) Propriedades do documento ({key})
Action Wizard… Assistente de ações…
Add Bates numbering… Adicionar numeração Bates…
Add a button Adicionar um botão
@@ -1153,7 +1153,7 @@
Expand all bookmarks Expandir todos os marcadores
Expand top-level bookmarks Expandir marcadores de nível superior
Collapse all bookmarks Recolher todos os marcadores
New bookmark (⌘B) Novo marcador (⌘B)
New bookmark ({key}) Novo marcador ({key})
This document has no bookmarks. Este documento não tem marcadores.
This document has no layers. Este documento não tem camadas.
This document has no attachments. Este documento não tem anexos.
@@ -1167,8 +1167,8 @@
No matches Nenhuma correspondência
Searching… {s}/{p} Pesquisando… {s}/{p}
{c} of {n}{more} {c} de {n}{more}
Previous (⇧⌘G) Anterior (⇧⌘G)
Next (⌘G) Próximo (⌘G)
Previous ({key}) Anterior ({key})
Next ({key}) Próximo ({key})
Find options Opções de localização
Whole words only Apenas palavras inteiras
Case-sensitive Diferenciar maiúsculas de minúsculas
@@ -1239,7 +1239,7 @@
Copy selected text Copiar texto selecionado
Select a word Selecionar uma palavra
Clear selection / close find Limpar seleção / fechar localização
Zoom in / out (also pinch or ⌘-scroll) Aumentar / diminuir zoom (ou pinçar / ⌘-rolagem)
Zoom in / out (also pinch or {key}-scroll) Aumentar / diminuir zoom (ou pinçar / {key}-rolagem)
Rotate view Girar visualização
First / last page Primeira / última página
Previous / next page Página anterior / seguinte
Can't render this file because it contains an unexpected character in line 9 and column 16.
+10 -10
View File
@@ -89,7 +89,7 @@
Double-click Двойной щелчок
Select a word Выделить слово
Clear selection / close find Снять выделение / закрыть поиск
Zoom in / out (also pinch or ⌘-scroll) Масштаб (также щипок или ⌘-прокрутка)
Zoom in / out (also pinch or {key}-scroll) Масштаб (также щипок или {key}-прокрутка)
Rotate view Повернуть вид
First / last page Первая / последняя страница
Previous / next page Предыдущая / следующая страница
@@ -97,16 +97,16 @@
Select all pages (Organize) Выделить все страницы (Организация)
Home Главная
Open Открыть
Open a PDF (⌘O) Открыть PDF (⌘O)
Open a PDF ({key}) Открыть PDF ({key})
Dark gray theme Тёмно-серая тема
Light theme Светлая тема
All tools Все инструменты
Read Чтение
Convert Конвертация
E-Sign Электронная подпись
Print (⌘P) Печать (⌘P)
Print ({key}) Печать ({key})
Save (M4) Сохранить (M4)
Document properties (⌘D) Свойства документа (⌘D)
Document properties ({key}) Свойства документа ({key})
Find tools and commands Найти инструменты и команды
Fit to height По высоте
Zoom in Увеличить
@@ -135,9 +135,9 @@
Compare Сравнить
Page thumbnails Миниатюры страниц
Form fields Поля формы
Zoom out (⌘−) Уменьшить (⌘−)
Zoom in (⌘+) Увеличить (⌘+)
Rotate view clockwise (⇧⌘+) Повернуть вид по часовой стрелке (⇧⌘+)
Zoom out ({key}) Уменьшить ({key})
Zoom in ({key}) Увеличить ({key})
Rotate view clockwise ({key}) Повернуть вид по часовой стрелке ({key})
Toggle fit page / fit width Переключить по странице / по ширине
Next page Следующая страница
Previous page Предыдущая страница
@@ -1269,7 +1269,7 @@
Expand all bookmarks Развернуть все закладки
Expand top-level bookmarks Развернуть закладки верхнего уровня
Collapse all bookmarks Свернуть все закладки
New bookmark (⌘B) Новая закладка (⌘B)
New bookmark ({key}) Новая закладка ({key})
This document has no bookmarks. В этом документе нет закладки.
This document has no layers. В этом документе нет слоёв.
This document has no attachments. В этом документе нет вложений.
@@ -1284,8 +1284,8 @@
No matches Совпадений нет
Searching… {s}/{p} Поиск… {s}/{p}
{c} of {n}{more} {c} из {n}{more}
Previous (⇧⌘G) Предыдущее (⇧⌘G)
Next (⌘G) Следующее (⌘G)
Previous ({key}) Предыдущее ({key})
Next ({key}) Следующее ({key})
Find options Параметры поиска
Whole words only Только целые слова
Case-sensitive С учётом регистра
Can't render this file because it contains an unexpected character in line 9 and column 16.
+10 -10
View File
@@ -72,7 +72,7 @@ comment menu Edit సవరించు
Double-click డబుల్-క్లిక్
Select a word ఒక పదాన్ని ఎంచుకో
Clear selection / close find ఎంపికను క్లియర్ చేయి / శోధనను మూసివేయి
Zoom in / out (also pinch or ⌘-scroll) జూమ్ పెంచు / తగ్గించు (పించ్ లేదా ⌘-స్క్రోల్‌తో కూడా)
Zoom in / out (also pinch or {key}-scroll) జూమ్ పెంచు / తగ్గించు (పించ్ లేదా {key}-స్క్రోల్‌తో కూడా)
Rotate view వీక్షణను తిప్పు
First / last page మొదటి / చివరి పేజీ
Previous / next page మునుపటి / తదుపరి పేజీ
@@ -80,16 +80,16 @@ comment menu Edit సవరించు
Select all pages (Organize) అన్ని పేజీలను ఎంచుకో (పేజీల నిర్వహణలో)
Home హోమ్
Open తెరువు
Open a PDF (⌘O) PDFను తెరువు (⌘O)
Open a PDF ({key}) PDFను తెరువు ({key})
Dark gray theme ముదురు బూడిద రంగు థీమ్
Light theme లేత థీమ్
All tools అన్ని సాధనాలు
Read చదవడం
Convert మార్పిడి
E-Sign ఇ-సంతకం
Print (⌘P) ముద్రించు (⌘P)
Print ({key}) ముద్రించు ({key})
Save (M4) సేవ్ చేయి (M4)
Document properties (⌘D) పత్ర లక్షణాలు (⌘D)
Document properties ({key}) పత్ర లక్షణాలు ({key})
Find tools and commands సాధనాలను, కమాండ్‌లను కనుగొను
Fit to height ఎత్తుకు సరిపోయేలా
Zoom in జూమ్ పెంచు
@@ -118,9 +118,9 @@ comment menu Edit సవరించు
Compare పోల్చు
Page thumbnails పేజీ థంబ్‌నెయిల్‌లు
Form fields ఫారం ఫీల్డ్‌లు
Zoom out (⌘−) జూమ్ తగ్గించు (⌘−)
Zoom in (⌘+) జూమ్ పెంచు (⌘+)
Rotate view clockwise (⇧⌘+) వీక్షణను సవ్యదిశలో తిప్పు (⇧⌘+)
Zoom out ({key}) జూమ్ తగ్గించు ({key})
Zoom in ({key}) జూమ్ పెంచు ({key})
Rotate view clockwise ({key}) వీక్షణను సవ్యదిశలో తిప్పు ({key})
Toggle fit page / fit width పేజీకి సరిపోయేలా / వెడల్పుకు సరిపోయేలా మధ్య మారు
Next page తదుపరి పేజీ
Previous page మునుపటి పేజీ
@@ -1243,7 +1243,7 @@ signature pad Type టైప్ చేయి
Expand all bookmarks అన్ని బుక్‌మార్క్‌లను విస్తరించు
Expand top-level bookmarks పై స్థాయి బుక్‌మార్క్‌లను విస్తరించు
Collapse all bookmarks అన్ని బుక్‌మార్క్‌లను ముడుచు
New bookmark (⌘B) కొత్త బుక్‌మార్క్ (⌘B)
New bookmark ({key}) కొత్త బుక్‌మార్క్ ({key})
This document has no bookmarks. ఈ పత్రంలో బుక్‌మార్క్‌లు లేవు.
This document has no layers. ఈ పత్రంలో లేయర్‌లు లేవు.
This document has no attachments. ఈ పత్రంలో జోడింపులు లేవు.
@@ -1257,8 +1257,8 @@ signature pad Type టైప్ చేయి
No matches సరిపోలికలు లేవు
Searching… {s}/{p} వెతుకుతోంది… {s}/{p}
{c} of {n}{more} {n}{more}లో {c}
Previous (⇧⌘G) మునుపటి (⇧⌘G)
Next (⌘G) తదుపరి (⌘G)
Previous ({key}) మునుపటి ({key})
Next ({key}) తదుపరి ({key})
Find options కనుగొనే ఎంపికలు
Whole words only పూర్తి పదాలు మాత్రమే
Case-sensitive పెద్ద/చిన్న అక్షరాల తేడాతో
Can't render this file because it contains an unexpected character in line 13 and column 16.
+10 -10
View File
@@ -94,7 +94,7 @@
Double-click Подвійне клацання
Select a word Виділити слово
Clear selection / close find Зняти виділення / закрити пошук
Zoom in / out (also pinch or ⌘-scroll) Збільшити / зменшити (також жестом зведення або ⌘-прокручуванням)
Zoom in / out (also pinch or {key}-scroll) Збільшити / зменшити (також жестом зведення або {key}-прокручуванням)
Rotate view Повернути вигляд
First / last page Перша / остання сторінка
Previous / next page Попередня / наступна сторінка
@@ -102,16 +102,16 @@
Select all pages (Organize) Вибрати всі сторінки (Упорядкування)
Home Головна
Open Відкрити
Open a PDF (⌘O) Відкрити PDF (⌘O)
Open a PDF ({key}) Відкрити PDF ({key})
Dark gray theme Темно-сіра тема
Light theme Світла тема
All tools Усі інструменти
Read Читання
Convert Перетворення
E-Sign Електронний підпис
Print (⌘P) Друк (⌘P)
Print ({key}) Друк ({key})
Save (M4) Зберегти (M4)
Document properties (⌘D) Властивості документа (⌘D)
Document properties ({key}) Властивості документа ({key})
Find tools and commands Знайти інструменти й команди
Fit to height За висотою
Zoom in Збільшити
@@ -140,9 +140,9 @@
Compare Порівняння
Page thumbnails Мініатюри сторінок
Form fields Поля форми
Zoom out (⌘−) Зменшити (⌘−)
Zoom in (⌘+) Збільшити (⌘+)
Rotate view clockwise (⇧⌘+) Повернути вигляд за годинниковою стрілкою (⇧⌘+)
Zoom out ({key}) Зменшити ({key})
Zoom in ({key}) Збільшити ({key})
Rotate view clockwise ({key}) Повернути вигляд за годинниковою стрілкою ({key})
Toggle fit page / fit width Перемкнути масштаб за сторінкою / за шириною
Next page Наступна сторінка
Previous page Попередня сторінка
@@ -1266,7 +1266,7 @@
Expand all bookmarks Розгорнути всі закладки
Expand top-level bookmarks Розгорнути закладки верхнього рівня
Collapse all bookmarks Згорнути всі закладки
New bookmark (⌘B) Нова закладка (⌘B)
New bookmark ({key}) Нова закладка ({key})
This document has no bookmarks. Цей документ не має закладок.
This document has no layers. Цей документ не має шарів.
This document has no attachments. Цей документ не має вкладень.
@@ -1281,8 +1281,8 @@
No matches Збігів немає
Searching… {s}/{p} Пошук… {s}/{p}
{c} of {n}{more} {c} із {n}{more}
Previous (⇧⌘G) Попередній (⇧⌘G)
Next (⌘G) Наступний (⌘G)
Previous ({key}) Попередній ({key})
Next ({key}) Наступний ({key})
Find options Параметри пошуку
Whole words only Лише цілі слова
Case-sensitive З урахуванням регістру
Can't render this file because it contains an unexpected character in line 6 and column 47.
+10 -10
View File
@@ -1076,19 +1076,19 @@
Attachments 附件
Signatures 签名
Accessibility Checker 无障碍检查器
Zoom out (⌘−) 缩小 (⌘−)
Zoom in (⌘+) 放大 (⌘+)
Rotate view clockwise (⇧⌘+) 顺时针旋转视图 (⇧⌘+)
Zoom out ({key}) 缩小 ({key})
Zoom in ({key}) 放大 ({key})
Rotate view clockwise ({key}) 顺时针旋转视图 ({key})
Toggle fit page / fit width 切换适合页面/适合宽度
Next page 下一页
Previous page 上一页
Current page — type a page number or label (such as iv) and press Enter 当前页 — 输入页码或标签(如 iv)后按 Enter
Open a PDF (⌘O) 打开 PDF (⌘O)
Open a PDF ({key}) 打开 PDF ({key})
Dark gray theme 深灰色主题
Light theme 浅色主题
Print (⌘P) 打印 (⌘P)
Print ({key}) 打印 ({key})
Save (M4) 保存 (M4)
Document properties (⌘D) 文档属性 (⌘D)
Document properties ({key}) 文档属性 ({key})
Action Wizard… 操作向导…
Add Bates numbering… 添加贝茨编号…
Add a button 添加按钮
@@ -1218,7 +1218,7 @@
Expand all bookmarks 展开所有书签
Expand top-level bookmarks 展开顶层书签
Collapse all bookmarks 折叠所有书签
New bookmark (⌘B) 新建书签 (⌘B)
New bookmark ({key}) 新建书签 ({key})
This document has no bookmarks. 本文档没有书签。
This document has no layers. 本文档没有图层。
This document has no attachments. 本文档没有附件。
@@ -1233,8 +1233,8 @@
No matches 无匹配
Searching… {s}/{p} 正在搜索… {s}/{p}
{c} of {n}{more} {c} / {n}{more}
Previous (⇧⌘G) 上一个 (⇧⌘G)
Next (⌘G) 下一个 (⌘G)
Previous ({key}) 上一个 ({key})
Next ({key}) 下一个 ({key})
Find options 查找选项
Whole words only 仅全字匹配
Case-sensitive 区分大小写
@@ -1305,7 +1305,7 @@
Copy selected text 复制所选文本
Select a word 选择一个词
Clear selection / close find 清除选择/关闭查找
Zoom in / out (also pinch or ⌘-scroll) 放大/缩小(也可用捏合或 ⌘+滚轮)
Zoom in / out (also pinch or {key}-scroll) 放大/缩小(也可用捏合或 {key}+滚轮)
Rotate view 旋转视图
First / last page 首页/末页
Previous / next page 上一页/下一页
Can't render this file because it contains an unexpected character in line 9 and column 16.
+10 -10
View File
@@ -1025,19 +1025,19 @@
Attachments 附件
Signatures 簽章
Accessibility Checker 無障礙偵測工具
Zoom out (⌘−) 縮小(⌘−)
Zoom in (⌘+) 放大(⌘+)
Rotate view clockwise (⇧⌘+) 順時針旋轉檢視(⇧⌘+)
Zoom out ({key}) 縮小({key})
Zoom in ({key}) 放大({key})
Rotate view clockwise ({key}) 順時針旋轉檢視({key})
Toggle fit page / fit width 切換符合頁面/符合寬度
Next page 下一頁
Previous page 上一頁
Current page — type a page number or label (such as iv) and press Enter 目前頁面:輸入頁碼或頁面標籤(例如 iv),再按 Enter
Open a PDF (⌘O) 開啟 PDF(⌘O)
Open a PDF ({key}) 開啟 PDF({key})
Dark gray theme 深灰色主題
Light theme 淺色主題
Print (⌘P) 列印(⌘P)
Print ({key}) 列印({key})
Save (M4) 儲存(M4)
Document properties (⌘D) 文件內容(⌘D)
Document properties ({key}) 文件內容({key})
Action Wizard… 動作精靈…
Add Bates numbering… 新增 Bates 編號…
Add a button 新增按鈕
@@ -1167,7 +1167,7 @@
Expand all bookmarks 展開所有書籤
Expand top-level bookmarks 展開頂層書籤
Collapse all bookmarks 摺疊所有書籤
New bookmark (⌘B) 新建書籤 (⌘B)
New bookmark ({key}) 新建書籤 ({key})
This document has no bookmarks. 本文件沒有書籤。
This document has no layers. 本文件沒有圖層。
This document has no attachments. 本文件沒有附件。
@@ -1182,8 +1182,8 @@
No matches 無匹配
Searching… {s}/{p} 正在搜尋… {s}/{p}
{c} of {n}{more} {c} / {n}{more}
Previous (⇧⌘G) 上一個 (⇧⌘G)
Next (⌘G) 下一個 (⌘G)
Previous ({key}) 上一個 ({key})
Next ({key}) 下一個 ({key})
Find options 尋找選項
Whole words only 僅全字匹配
Case-sensitive 區分大小寫
@@ -1254,7 +1254,7 @@
Copy selected text 複製所選文字
Select a word 選取一個詞
Clear selection / close find 清除選取/關閉尋找
Zoom in / out (also pinch or ⌘-scroll) 放大/縮小(也可用雙指縮放或 ⌘ 加捲動)
Zoom in / out (also pinch or {key}-scroll) 放大/縮小(也可用雙指縮放或 {key} 加捲動)
Rotate view 旋轉檢視
First / last page 第一頁/最後一頁
Previous / next page 上一頁/下一頁
Can't render this file because it contains an unexpected character in line 9 and column 16.
+2 -4
View File
@@ -480,10 +480,8 @@ pub fn right_panel(app: &mut PdfCraftApp, ui: &mut egui::Ui) {
}
});
}
if panel == RightPanel::Bookmarks
&& bm_editable
&& icons::button(ui, "bookmark-plus", 26.0, false, tl!("New bookmark (⌘B)")).clicked()
{
let new_tip = crate::commands::command_tip(ui.ctx(), tl!("New bookmark ({key})"), "bookmark.add");
if panel == RightPanel::Bookmarks && bm_editable && icons::button(ui, "bookmark-plus", 26.0, false, &new_tip).clicked() {
bm_action = Some(BmAction::New);
}
});
+50 -2
View File
@@ -1,6 +1,7 @@
//! The command registry drives menus, shortcuts and the palette: every registered command must
//! be implemented, disabled commands must say why, and every surface must reach the same action.
use egui::os::OperatingSystem;
use egui::{Key, Modifiers};
use egui_kittest::Harness;
use egui_kittest::kittest::Queryable;
@@ -290,11 +291,58 @@ fn clear_recent_files_runs_from_the_palette_and_is_saved() {
#[test]
fn the_shortcuts_dialog_lists_the_real_bindings() {
let mut h = harness();
h.ctx.set_os(OperatingSystem::Nix);
h.state_mut().execute("help.shortcuts");
h.run_steps(3);
let mac = cfg!(target_os = "macos");
h.get_by_label(if mac { "⇧⌘S" } else { "Ctrl+Shift+S" });
h.get_by_label("Ctrl+Shift+S");
h.get_by_label("Save as");
// The keys the document view handles itself are written for the platform too, and Fit
// visible (a registered command) is listed once.
h.get_by_label("Ctrl+1");
h.get_by_label("Ctrl+3");
h.get_by_label("Ctrl+G / Ctrl+Shift+G");
h.get_by_label("← / →, Ctrl+← / Ctrl+→");
h.get_by_label("Zoom in / out (also pinch or Ctrl-scroll)");
assert_eq!(h.query_all_by_label_contains("⌘").count(), 0, "no ⌘ outside macOS");
h.ctx.set_os(OperatingSystem::Mac);
h.run_steps(2);
h.get_by_label("⇧⌘S");
h.get_by_label("⌘1");
h.get_by_label("Zoom in / out (also pinch or ⌘-scroll)");
}
/// Menu ▸ View open, with egui told the app runs on `os`.
fn view_menu(os: OperatingSystem) -> Harness<'static, PdfCraftApp> {
let mut h = harness();
h.ctx.set_os(os);
h.get_by_label("Menu").click();
h.run_steps(2);
h.get_by_label("View ⏵").hover();
h.run_steps(3);
h
}
#[test]
fn view_menu_and_tooltips_write_shortcuts_for_the_platform() {
// On Linux, View ▸ Zoom and Page navigation showed ⌘1, ⌘[ … (hard-coded) while the
// registered items under them showed Ctrl+K; tooltips showed ⌘ too.
let h = view_menu(OperatingSystem::Nix);
h.get_by_label("Actual size Ctrl+1");
h.get_by_label("Zoom to page level Ctrl+0");
h.get_by_label("Rotate view counterclockwise Ctrl+Shift+−");
h.get_by_label("Previous view Ctrl+[");
h.get_by_label("Find tools and commands… Ctrl+K");
h.get_by_label("Zoom in (Ctrl++)");
h.get_by_label("Print (Ctrl+P)");
assert_eq!(h.query_all_by_label_contains("⌘").count(), 0, "no ⌘ outside macOS");
assert_eq!(h.query_all_by_label_contains("Fit visible").count(), 1, "View lists Fit visible once");
h.get_by_label("Fit visible Ctrl+3");
let h = view_menu(OperatingSystem::Mac);
h.get_by_label("Actual size ⌘1");
h.get_by_label("Fit visible ⌘3");
h.get_by_label("Rotate view clockwise (⇧⌘+)");
assert_eq!(h.query_all_by_label_contains("Ctrl+").count(), 0, "no Ctrl+ on macOS");
}
#[test]