Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

feat(i18n): translate command names, connection notices and stray messages

RoversX2e94b3c4d8f5
diff --git a/Cargo.lock b/Cargo.lock
index e07de5e7..0485de9c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -12627,6 +12627,7 @@ dependencies = [
"shared_library",
"shlex 1.3.0",
"smithay-client-toolkit",
+ "thinkterm-i18n",
"thinkterm-render",
"thiserror 1.0.69",
"tiny-skia",
diff --git a/thinkterm-i18n/i18n/de-DE.ftl b/thinkterm-i18n/i18n/de-DE.ftl
index a1755627..731a6e49 100644
--- a/thinkterm-i18n/i18n/de-DE.ftl
+++ b/thinkterm-i18n/i18n/de-DE.ftl
@@ -1472,3 +1472,218 @@ web-machines-off-hint = Schalten Sie „Andere Rechner erreichen“ unter Einste
web-machines-failed-off = Auf diesem Server ausgeschaltet
web-machines-bad-port = Ein Port ist eine Zahl von 1 bis 65535
web-machines-details = Details
+
+## Commands: the command palette, the menu bar and the keymap page.
+command-create-new-workspace = Neuen Workspace erstellen
+command-paste-primary-selection = Primäre Auswahl einfügen
+command-copy-to-primary-selection = In die primäre Auswahl kopieren
+command-copy-to-clipboard = In die Zwischenablage kopieren
+command-copy-to-clipboard-and-primary-selection = In Zwischenablage und primäre Auswahl kopieren
+command-paste-from-clipboard = Aus der Zwischenablage einfügen
+command-toggle-full-screen-mode = Vollbild umschalten
+command-toggle-always-on-top = „Immer im Vordergrund“ umschalten
+command-toggle-always-on-bottom = „Immer im Hintergrund“ umschalten
+command-always-on-top = Immer im Vordergrund
+command-normal = Normal
+command-always-on-bottom = Immer im Hintergrund
+command-hide-minimize-window = Fenster ausblenden/minimieren
+command-show-restore-window = Fenster anzeigen/wiederherstellen
+command-hide-application = ThinkTerm ausblenden
+command-settings = Einstellungen…
+command-quit-and-stop-session-server = Beenden und Sitzungsserver stoppen
+command-check-for-updates = Nach Updates suchen…
+command-remote-hosts = Remote-Hosts…
+command-add-remote-host = Remote-Host hinzufügen…
+command-live-overview = Live-Übersicht
+command-find-thread = Thread suchen
+command-toggle-left-sidebar = Linke Seitenleiste ein-/ausblenden
+command-toggle-right-sidebar = Rechte Seitenleiste ein-/ausblenden
+command-new-thread = Neuer Thread
+command-previous-space = Vorheriger Space
+command-next-space = Nächster Space
+command-new-window = Neues Fenster
+command-clear-scrollback = Scrollback leeren
+command-clear-the-scrollback-and-viewport = Scrollback und Ansicht leeren
+command-search-pane-output = Ausgabe des Bereichs durchsuchen
+command-show-debug-overlay = Debug-Overlay anzeigen
+command-prompt-the-user-to-choose-from-a-list = Aus einer Liste wählen lassen
+command-prompt-the-user-for-confirmation = Um Bestätigung bitten
+command-prompt-the-user-for-a-line-of-text = Eine Textzeile abfragen
+command-rename-tab = Tab umbenennen
+command-rename-pane-tab = Bereichs-Tab umbenennen
+command-rename-workspace = Workspace umbenennen
+command-reveal-in-folder = Im Ordner zeigen
+command-grant-folder-access = Ordnerzugriff gewähren
+command-open-file-with-application = Datei mit Programm öffnen
+command-open-file = Datei öffnen
+command-open-file-with-other-application = Datei mit anderem Programm öffnen
+command-reveal-file-in-folder = Datei im Ordner zeigen
+command-rename-file = Datei umbenennen
+command-move-file-to-trash = Datei in den Papierkorb legen
+command-copy-file-path = Dateipfad kopieren
+command-rename-thread = Thread umbenennen
+command-rename-space = Space umbenennen
+command-new-space = Neuer Space
+command-new-space-here = Neuer Space hier
+command-switch-space = Space wechseln
+command-delete-space = Space löschen
+command-delete-space-everywhere = Space überall löschen
+command-delete-space-end-remote-sessions = Space löschen und entfernte Terminals beenden
+command-collapse-or-expand-threads = Threads ein- oder ausklappen
+command-remove-workspace = Workspace entfernen
+command-archive-workspace = Workspace archivieren
+command-unarchive-workspace = Workspace aus dem Archiv holen
+command-archive-active-workspace = Aktiven Workspace archivieren
+command-show-archived-workspaces = Archivierte Workspaces anzeigen
+command-connect-thread = Thread verbinden
+command-disconnect-thread = Thread trennen
+command-pin-thread = Thread anheften
+command-delete-thread = Thread löschen
+command-mark-thread-as-unread = Thread als ungelesen markieren
+command-enter-quickselect-mode = QuickSelect-Modus starten
+command-enter-emoji-character-selection-mode = Emoji-/Zeichenauswahl starten
+command-enter-pane-selection-mode = Bereichsauswahl starten
+command-swap-a-pane-with-the-active-pane = Bereich mit dem aktiven tauschen
+command-swap-a-pane-with-the-active-pane-keeping-focus = Bereich mit dem aktiven tauschen, Fokus behalten
+command-move-a-pane-into-its-own-tab = Bereich in einen eigenen Tab verschieben
+command-move-a-pane-into-its-own-window = Bereich in ein eigenes Fenster verschieben
+command-decrease-font-size = Schrift verkleinern
+command-increase-font-size = Schrift vergrößern
+command-reset-font-size = Schriftgröße zurücksetzen
+command-reset-the-window-and-font-size = Fenster- und Schriftgröße zurücksetzen
+command-new-terminal-tab-to-right = Neuer Terminal-Tab rechts
+command-new-tab = Neuer Tab
+command-new-tab-default-domain = Neuer Tab (Standard-Domain)
+command-activate-right-most-tab = Tab ganz rechts aktivieren
+command-close-current-tab = Aktuellen Tab schließen
+command-close-current-pane = Aktuellen Bereich schließen
+command-activate-the-preceeding-window = Vorheriges Fenster aktivieren
+command-activate-the-next-window = Nächstes Fenster aktivieren
+command-activate-the-tab-to-the-left = Tab links aktivieren
+command-activate-the-tab-to-the-right = Tab rechts aktivieren
+command-activate-the-tab-to-the-left-no-wrapping = Tab links aktivieren (ohne Umlauf)
+command-activate-the-tab-to-the-right-no-wrapping = Tab rechts aktivieren (ohne Umlauf)
+command-reload-configuration = Konfiguration neu laden
+command-quit-thinkterm = ThinkTerm beenden
+command-move-tab-one-place-to-the-left = Tab eine Stelle nach links verschieben
+command-move-tab-one-place-to-the-right = Tab eine Stelle nach rechts verschieben
+command-scroll-up-one-page = Eine Seite nach oben scrollen
+command-scroll-down-one-page = Eine Seite nach unten scrollen
+command-scroll-to-the-bottom = Ganz nach unten scrollen
+command-scroll-to-the-top = Ganz nach oben scrollen
+command-activate-copy-mode = Kopiermodus aktivieren
+command-activate-pane-left = Bereich links aktivieren
+command-activate-pane-right = Bereich rechts aktivieren
+command-activate-pane-up = Bereich oben aktivieren
+command-activate-pane-down = Bereich unten aktivieren
+command-toggle-pane-zoom = Bereichszoom umschalten
+command-activate-the-last-active-tab = Zuletzt aktiven Tab aktivieren
+command-clear-the-key-table-stack = Tastentabellen-Stapel leeren
+command-open-link-at-mouse-cursor = Link unter dem Mauszeiger öffnen
+command-show-the-launcher = Starter anzeigen
+command-navigate-tabs = Tabs durchgehen
+command-detach-the-domain-of-the-active-pane = Domain des aktiven Bereichs trennen
+command-detach-the-default-domain = Standard-Domain trennen
+command-documentation = Dokumentation
+command-discuss-on-github = Auf GitHub diskutieren
+command-search-or-report-issue-on-github = Problem auf GitHub suchen oder melden
+command-does-nothing = Tut nichts
+command-clears-the-selection-in-the-current-pane = Auswahl im aktuellen Bereich aufheben
+command-pop-the-current-key-table = Aktuelle Tastentabelle verlassen
+command-reset-the-terminal-emulation-state-in-the-current-pane = Terminalzustand im aktuellen Bereich zurücksetzen
+command-activate-command-palette = Befehlspalette öffnen
+command-open-thread = Thread öffnen
+
+## Commands with a name or a number in them.
+command-launch-menu-new-tab = { $label } (neuer Tab)
+command-default-shell = (Standard-Shell)
+command-new-tab-in-domain = Neuer Tab (Domain { $name })
+command-attach-domain = Domain { $name } verbinden
+command-detach-domain = Domain { $name } trennen
+command-switch-to-workspace = Zu Workspace { $name } wechseln
+command-move-spaces = { $n } Spaces weiter
+command-activate-tab = Tab { $n } aktivieren
+command-activate-window = Fenster { $n } aktivieren
+command-resize-pane-left = Bereich um { $n } Zelle(n) nach links anpassen
+command-resize-pane-right = Bereich um { $n } Zelle(n) nach rechts anpassen
+command-resize-pane-up = Bereich um { $n } Zelle(n) nach oben anpassen
+command-resize-pane-down = Bereich um { $n } Zelle(n) nach unten anpassen
+command-rotate-panes-clockwise = Bereiche im Uhrzeigersinn rotieren
+command-rotate-panes-counter-clockwise = Bereiche gegen den Uhrzeigersinn rotieren
+command-split-vertically = Vertikal teilen (oben/unten)
+command-split-horizontally = Horizontal teilen (links/rechts)
+
+## The macOS menu bar. Commands are placed by fixed English names;
+## these are what the menus are called on screen.
+menu-bar-shell = Shell
+menu-bar-edit = Bearbeiten
+menu-bar-view = Darstellung
+menu-bar-window = Fenster
+menu-bar-help = Hilfe
+menu-bar-attach = Verbinden
+menu-bar-detach = Trennen
+menu-bar-copy-mode = Kopiermodus
+menu-bar-font-size = Schriftgröße
+menu-bar-level = Ebene
+menu-bar-move-tab = Tab verschieben
+menu-bar-resize-pane = Bereichsgröße ändern
+menu-bar-rotate-pane = Bereiche rotieren
+menu-bar-select-pane = Bereich wählen
+menu-bar-select-tab = Tab wählen
+menu-bar-select-window = Fenster wählen
+menu-bar-workspace = Workspace
+menu-bar-about = Über ThinkTerm
+menu-bar-services = Dienste
+quit-confirm-title = ThinkTerm beenden?
+quit-confirm-detail = Alle Bereiche werden getrennt und geschlossen, dann wird ThinkTerm beendet.
+quit-confirm-cancel = Abbrechen
+quit-confirm-ok = Beenden
+
+## The cover over a terminal that is not this window's to use yet.
+terminal-gate-busy = Das Terminal wird auf einem anderen Gerät verwendet
+terminal-gate-busy-on = Das Terminal wird auf { $host } verwendet
+terminal-gate-busy-hint = Klicken oder scrollen, um fortzufahren
+terminal-gate-free = Das Terminal ist verfügbar
+terminal-gate-free-hint = Klicken oder scrollen, um zu übernehmen
+terminal-gate-connecting = Verbindung zum Terminal wird hergestellt…
+terminal-gate-wait-hint = Bitte warten
+terminal-gate-reconnecting = Verbindung verloren — wird wiederhergestellt…
+terminal-gate-reconnecting-hint = Das Terminal macht automatisch weiter
+terminal-gate-offline = Verbindung getrennt
+terminal-gate-offline-hint = Über die Seitenleiste erneut verbinden
+terminal-gate-syncing = Terminalzustand wird wiederhergestellt…
+
+## Copying files to and from a folder here or on a remote.
+transfer-into-itself = Ein Ordner kann nicht in sich selbst oder einen seiner Unterordner kopiert werden
+transfer-too-many-items = Dieser Ordner enthält mehr als { $limit } Objekte
+transfer-unreadable = { $path } kann nicht gelesen werden
+transfer-names-collide = Namen in { $folder } kollidieren auf diesem Computer
+transfer-name-unusable = Der Name von { $path } ist auf diesem Computer nicht verwendbar
+remote-files-cannot-upload = Über diese Verbindung können keine Dateien hochgeladen werden
+remote-files-cannot-create-folders = Über diese Verbindung können keine Ordner erstellt werden
+remote-files-cannot-download = Über diese Verbindung können keine Dateien geladen werden
+remote-files-cannot-delete-files = Über diese Verbindung können keine Dateien gelöscht werden
+remote-files-cannot-delete-folders = Über diese Verbindung können keine Ordner gelöscht werden
+remote-files-cannot-rename = Über diese Verbindung kann nichts umbenannt werden
+remote-files-cannot-run = Über diese Verbindung können keine Programme laufen
+remote-files-cannot-look = Über diese Verbindung können keine Dateien angesehen werden
+remote-files-listing-timed-out = Die Liste der entfernten Dateien hat zu lange gedauert
+remote-files-listing-exec-failed = Die entfernten Dateien können nicht aufgelistet werden
+remote-files-listing-read-failed = Das Lesen der entfernten Dateiliste ist fehlgeschlagen
+remote-files-listing-empty = Der entfernte Host hat keine Dateiliste geliefert
+remote-files-listing-refused = Der entfernte Host konnte keine Dateien auflisten: { $detail }
+remote-files-listing-too-large = Die entfernte Dateiliste ist zu groß
+download-completed = Download abgeschlossen
+download-completed-body = Geladen nach { $path }
+
+## Why a plugin's ask was not done. Plugins show these as they are.
+plugin-answer-no-terminal = neben dem Panel ist kein Terminal
+plugin-answer-local-terminal = das Terminal neben dem Panel läuft auf diesem Rechner
+plugin-answer-moved = das Terminal neben dem Panel ist jetzt auf einem anderen Rechner
+plugin-answer-not-connected = ThinkTerm ist nicht mit { $host } verbunden
+plugin-answer-closed = das Panel wurde geschlossen
+
+## Browser client: the status line while the connection is down.
+web-toast-connection-lost = Verbindung verloren ({ $reason })
+web-toast-reconnecting = Verbindung verloren ({ $reason }); wird wiederhergestellt…
+web-toast-still-reconnecting = Nach { $n } Versuchen noch immer keine Verbindung ({ $reason }). Der Link ist vielleicht abgelaufen oder der Server läuft nicht.
diff --git a/thinkterm-i18n/i18n/en-US.ftl b/thinkterm-i18n/i18n/en-US.ftl
index 06d70581..b2674946 100644
--- a/thinkterm-i18n/i18n/en-US.ftl
+++ b/thinkterm-i18n/i18n/en-US.ftl
@@ -1472,3 +1472,218 @@ web-machines-off-hint = Turn on “Reach other machines” in Settings → Web o
web-machines-failed-off = Turned off on this server
web-machines-bad-port = A port is a number from 1 to 65535
web-machines-details = Details
+
+## Commands: the command palette, the menu bar and the keymap page.
+command-create-new-workspace = Create new Workspace
+command-paste-primary-selection = Paste primary selection
+command-copy-to-primary-selection = Copy to primary selection
+command-copy-to-clipboard = Copy to clipboard
+command-copy-to-clipboard-and-primary-selection = Copy to clipboard and primary selection
+command-paste-from-clipboard = Paste from clipboard
+command-toggle-full-screen-mode = Toggle full screen mode
+command-toggle-always-on-top = Toggle always on Top
+command-toggle-always-on-bottom = Toggle always on Bottom
+command-always-on-top = Always on Top
+command-normal = Normal
+command-always-on-bottom = Always on Bottom
+command-hide-minimize-window = Hide/Minimize Window
+command-show-restore-window = Show/Restore Window
+command-hide-application = Hide Application
+command-settings = Settings...
+command-quit-and-stop-session-server = Quit and Stop Session Server
+command-check-for-updates = Check for Updates...
+command-remote-hosts = Remote Hosts...
+command-add-remote-host = Add Remote Host...
+command-live-overview = Live Overview
+command-find-thread = Find Thread
+command-toggle-left-sidebar = Toggle Left Sidebar
+command-toggle-right-sidebar = Toggle Right Sidebar
+command-new-thread = New Thread
+command-previous-space = Previous Space
+command-next-space = Next Space
+command-new-window = New Window
+command-clear-scrollback = Clear scrollback
+command-clear-the-scrollback-and-viewport = Clear the scrollback and viewport
+command-search-pane-output = Search pane output
+command-show-debug-overlay = Show debug overlay
+command-prompt-the-user-to-choose-from-a-list = Prompt the user to choose from a list
+command-prompt-the-user-for-confirmation = Prompt the user for confirmation
+command-prompt-the-user-for-a-line-of-text = Prompt the user for a line of text
+command-rename-tab = Rename Tab
+command-rename-pane-tab = Rename Pane Tab
+command-rename-workspace = Rename Workspace
+command-reveal-in-folder = Reveal in Folder
+command-grant-folder-access = Grant Folder Access
+command-open-file-with-application = Open File With Application
+command-open-file = Open File
+command-open-file-with-other-application = Open File With Other Application
+command-reveal-file-in-folder = Reveal File in Folder
+command-rename-file = Rename File
+command-move-file-to-trash = Move File to Trash
+command-copy-file-path = Copy File Path
+command-rename-thread = Rename Thread
+command-rename-space = Rename Space
+command-new-space = New Space
+command-new-space-here = New Space Here
+command-switch-space = Switch Space
+command-delete-space = Delete Space
+command-delete-space-everywhere = Delete Space Everywhere
+command-delete-space-end-remote-sessions = Delete Space & End Remote Sessions
+command-collapse-or-expand-threads = Collapse or Expand Threads
+command-remove-workspace = Remove Workspace
+command-archive-workspace = Archive Workspace
+command-unarchive-workspace = Unarchive Workspace
+command-archive-active-workspace = Archive Active Workspace
+command-show-archived-workspaces = Show Archived Workspaces
+command-connect-thread = Connect Thread
+command-disconnect-thread = Disconnect Thread
+command-pin-thread = Pin Thread
+command-delete-thread = Delete Thread
+command-mark-thread-as-unread = Mark Thread as Unread
+command-enter-quickselect-mode = Enter QuickSelect mode
+command-enter-emoji-character-selection-mode = Enter Emoji / Character selection mode
+command-enter-pane-selection-mode = Enter Pane selection mode
+command-swap-a-pane-with-the-active-pane = Swap a pane with the active pane
+command-swap-a-pane-with-the-active-pane-keeping-focus = Swap a pane with the active pane, keeping focus
+command-move-a-pane-into-its-own-tab = Move a pane into its own tab
+command-move-a-pane-into-its-own-window = Move a pane into its own window
+command-decrease-font-size = Decrease font size
+command-increase-font-size = Increase font size
+command-reset-font-size = Reset font size
+command-reset-the-window-and-font-size = Reset the window and font size
+command-new-terminal-tab-to-right = New Terminal Tab to Right
+command-new-tab = New Tab
+command-new-tab-default-domain = New Tab (Default Domain)
+command-activate-right-most-tab = Activate right-most tab
+command-close-current-tab = Close current Tab
+command-close-current-pane = Close current Pane
+command-activate-the-preceeding-window = Activate the preceeding window
+command-activate-the-next-window = Activate the next window
+command-activate-the-tab-to-the-left = Activate the tab to the left
+command-activate-the-tab-to-the-right = Activate the tab to the right
+command-activate-the-tab-to-the-left-no-wrapping = Activate the tab to the left (no wrapping)
+command-activate-the-tab-to-the-right-no-wrapping = Activate the tab to the right (no wrapping)
+command-reload-configuration = Reload configuration
+command-quit-thinkterm = Quit ThinkTerm
+command-move-tab-one-place-to-the-left = Move tab one place to the left
+command-move-tab-one-place-to-the-right = Move tab one place to the right
+command-scroll-up-one-page = Scroll Up One Page
+command-scroll-down-one-page = Scroll Down One Page
+command-scroll-to-the-bottom = Scroll to the bottom
+command-scroll-to-the-top = Scroll to the top
+command-activate-copy-mode = Activate Copy Mode
+command-activate-pane-left = Activate Pane Left
+command-activate-pane-right = Activate Pane Right
+command-activate-pane-up = Activate Pane Up
+command-activate-pane-down = Activate Pane Down
+command-toggle-pane-zoom = Toggle Pane Zoom
+command-activate-the-last-active-tab = Activate the last active tab
+command-clear-the-key-table-stack = Clear the key table stack
+command-open-link-at-mouse-cursor = Open link at mouse cursor
+command-show-the-launcher = Show the launcher
+command-navigate-tabs = Navigate tabs
+command-detach-the-domain-of-the-active-pane = Detach the domain of the active pane
+command-detach-the-default-domain = Detach the default domain
+command-documentation = Documentation
+command-discuss-on-github = Discuss on GitHub
+command-search-or-report-issue-on-github = Search or report issue on GitHub
+command-does-nothing = Does nothing
+command-clears-the-selection-in-the-current-pane = Clears the selection in the current pane
+command-pop-the-current-key-table = Pop the current key table
+command-reset-the-terminal-emulation-state-in-the-current-pane = Reset the terminal emulation state in the current pane
+command-activate-command-palette = Activate Command Palette
+command-open-thread = Open thread
+
+## Commands with a name or a number in them.
+command-launch-menu-new-tab = { $label } (New Tab)
+command-default-shell = (default shell)
+command-new-tab-in-domain = New Tab (Domain { $name })
+command-attach-domain = Attach Domain { $name }
+command-detach-domain = Detach Domain { $name }
+command-switch-to-workspace = Switch to workspace { $name }
+command-move-spaces = Move { $n } Spaces
+command-activate-tab = Activate { $ordinal } Tab
+command-activate-window = Activate { $ordinal } Window
+command-resize-pane-left = Resize Pane { $n } cell(s) to the Left
+command-resize-pane-right = Resize Pane { $n } cell(s) to the Right
+command-resize-pane-up = Resize Pane { $n } cell(s) Upwards
+command-resize-pane-down = Resize Pane { $n } cell(s) Downwards
+command-rotate-panes-clockwise = Rotate panes Clockwise
+command-rotate-panes-counter-clockwise = Rotate panes CounterClockwise
+command-split-vertically = Split Vertically (Top/Bottom)
+command-split-horizontally = Split Horizontally (Left/Right)
+
+## The macOS menu bar. Commands are placed by fixed English names;
+## these are what the menus are called on screen.
+menu-bar-shell = Shell
+menu-bar-edit = Edit
+menu-bar-view = View
+menu-bar-window = Window
+menu-bar-help = Help
+menu-bar-attach = Attach
+menu-bar-detach = Detach
+menu-bar-copy-mode = Copy Mode
+menu-bar-font-size = Font Size
+menu-bar-level = Level
+menu-bar-move-tab = Move Tab
+menu-bar-resize-pane = Resize Pane
+menu-bar-rotate-pane = Rotate Pane
+menu-bar-select-pane = Select Pane
+menu-bar-select-tab = Select Tab
+menu-bar-select-window = Select Window
+menu-bar-workspace = Workspace
+menu-bar-about = About ThinkTerm
+menu-bar-services = Services
+quit-confirm-title = Terminate ThinkTerm?
+quit-confirm-detail = Detach and close all panes and terminate ThinkTerm?
+quit-confirm-cancel = Cancel
+quit-confirm-ok = Ok
+
+## The cover over a terminal that is not this window's to use yet.
+terminal-gate-busy = Terminal is being used on another device
+terminal-gate-busy-on = Terminal is being used on { $host }
+terminal-gate-busy-hint = Click or scroll to continue
+terminal-gate-free = Terminal is available
+terminal-gate-free-hint = Click or scroll to take control
+terminal-gate-connecting = Connecting to terminal…
+terminal-gate-wait-hint = Please wait
+terminal-gate-reconnecting = Connection lost — Reconnecting…
+terminal-gate-reconnecting-hint = Terminal will resume automatically
+terminal-gate-offline = Connection offline
+terminal-gate-offline-hint = Reconnect from the sidebar
+terminal-gate-syncing = Restoring terminal state…
+
+## Copying files to and from a folder here or on a remote.
+transfer-into-itself = Cannot copy a folder into itself or into one of its own subfolders
+transfer-too-many-items = That folder holds more than { $limit } items
+transfer-unreadable = Unable to read { $path }
+transfer-names-collide = The names in { $folder } collide on this computer
+transfer-name-unusable = The name of { $path } cannot be used on this computer
+remote-files-cannot-upload = This connection cannot upload files
+remote-files-cannot-create-folders = This connection cannot create directories
+remote-files-cannot-download = This connection cannot download files
+remote-files-cannot-delete-files = This connection cannot delete files
+remote-files-cannot-delete-folders = This connection cannot delete folders
+remote-files-cannot-rename = This connection cannot rename
+remote-files-cannot-run = This connection cannot run programs
+remote-files-cannot-look = This connection cannot look at files
+remote-files-listing-timed-out = The remote file listing timed out
+remote-files-listing-exec-failed = Unable to run the remote file listing
+remote-files-listing-read-failed = Reading the remote file listing failed
+remote-files-listing-empty = The remote host did not return a file listing
+remote-files-listing-refused = The remote host could not list files: { $detail }
+remote-files-listing-too-large = The remote file listing is too large
+download-completed = Download completed
+download-completed-body = Downloaded { $path }
+
+## Why a plugin's ask was not done. Plugins show these as they are.
+plugin-answer-no-terminal = no terminal is beside the panel
+plugin-answer-local-terminal = the terminal beside the panel runs on this machine
+plugin-answer-moved = the terminal beside the panel is on another machine now
+plugin-answer-not-connected = ThinkTerm is not connected to { $host }
+plugin-answer-closed = the panel closed
+
+## Browser client: the status line while the connection is down.
+web-toast-connection-lost = connection lost ({ $reason })
+web-toast-reconnecting = connection lost ({ $reason }); reconnecting…
+web-toast-still-reconnecting = still trying to reconnect after { $n } attempts ({ $reason }). The link may have expired, or the server may be down.
diff --git a/thinkterm-i18n/i18n/fr-FR.ftl b/thinkterm-i18n/i18n/fr-FR.ftl
index 9dfe8494..56fcb166 100644
--- a/thinkterm-i18n/i18n/fr-FR.ftl
+++ b/thinkterm-i18n/i18n/fr-FR.ftl
@@ -1466,3 +1466,218 @@ web-machines-off-hint = Activez « Joindre d’autres machines » dans Réglages
web-machines-failed-off = Désactivé sur ce serveur
web-machines-bad-port = Un port est un nombre de 1 à 65535
web-machines-details = Détails
+
+## Commands: the command palette, the menu bar and the keymap page.
+command-create-new-workspace = Créer un espace de travail
+command-paste-primary-selection = Coller la sélection primaire
+command-copy-to-primary-selection = Copier dans la sélection primaire
+command-copy-to-clipboard = Copier dans le presse-papiers
+command-copy-to-clipboard-and-primary-selection = Copier dans le presse-papiers et la sélection primaire
+command-paste-from-clipboard = Coller depuis le presse-papiers
+command-toggle-full-screen-mode = Basculer en plein écran
+command-toggle-always-on-top = Basculer « toujours au premier plan »
+command-toggle-always-on-bottom = Basculer « toujours à l’arrière-plan »
+command-always-on-top = Toujours au premier plan
+command-normal = Normal
+command-always-on-bottom = Toujours à l’arrière-plan
+command-hide-minimize-window = Masquer/réduire la fenêtre
+command-show-restore-window = Afficher/restaurer la fenêtre
+command-hide-application = Masquer ThinkTerm
+command-settings = Réglages…
+command-quit-and-stop-session-server = Quitter et arrêter le serveur de sessions
+command-check-for-updates = Rechercher les mises à jour…
+command-remote-hosts = Hôtes distants…
+command-add-remote-host = Ajouter un hôte distant…
+command-live-overview = Aperçu en direct
+command-find-thread = Rechercher une session
+command-toggle-left-sidebar = Afficher/masquer la barre latérale gauche
+command-toggle-right-sidebar = Afficher/masquer la barre latérale droite
+command-new-thread = Nouvelle session
+command-previous-space = Espace précédent
+command-next-space = Espace suivant
+command-new-window = Nouvelle fenêtre
+command-clear-scrollback = Effacer l’historique de défilement
+command-clear-the-scrollback-and-viewport = Effacer l’historique et l’écran
+command-search-pane-output = Rechercher dans la sortie du volet
+command-show-debug-overlay = Afficher la couche de débogage
+command-prompt-the-user-to-choose-from-a-list = Demander de choisir dans une liste
+command-prompt-the-user-for-confirmation = Demander une confirmation
+command-prompt-the-user-for-a-line-of-text = Demander une ligne de texte
+command-rename-tab = Renommer l’onglet
+command-rename-pane-tab = Renommer l’onglet du volet
+command-rename-workspace = Renommer l’espace de travail
+command-reveal-in-folder = Afficher dans le dossier
+command-grant-folder-access = Autoriser l’accès au dossier
+command-open-file-with-application = Ouvrir le fichier avec une application
+command-open-file = Ouvrir le fichier
+command-open-file-with-other-application = Ouvrir le fichier avec une autre application
+command-reveal-file-in-folder = Afficher le fichier dans le dossier
+command-rename-file = Renommer le fichier
+command-move-file-to-trash = Placer le fichier dans la corbeille
+command-copy-file-path = Copier le chemin du fichier
+command-rename-thread = Renommer la session
+command-rename-space = Renommer l’espace
+command-new-space = Nouvel espace
+command-new-space-here = Nouvel espace ici
+command-switch-space = Changer d’espace
+command-delete-space = Supprimer l’espace
+command-delete-space-everywhere = Supprimer l’espace partout
+command-delete-space-end-remote-sessions = Supprimer l’espace et fermer les terminaux distants
+command-collapse-or-expand-threads = Replier ou déplier les sessions
+command-remove-workspace = Retirer l’espace de travail
+command-archive-workspace = Archiver l’espace de travail
+command-unarchive-workspace = Désarchiver l’espace de travail
+command-archive-active-workspace = Archiver l’espace de travail actif
+command-show-archived-workspaces = Afficher les espaces de travail archivés
+command-connect-thread = Connecter la session
+command-disconnect-thread = Déconnecter la session
+command-pin-thread = Épingler la session
+command-delete-thread = Supprimer la session
+command-mark-thread-as-unread = Marquer la session comme non lue
+command-enter-quickselect-mode = Passer en mode sélection rapide
+command-enter-emoji-character-selection-mode = Passer en mode sélection d’emoji / de caractère
+command-enter-pane-selection-mode = Passer en mode sélection de volet
+command-swap-a-pane-with-the-active-pane = Échanger un volet avec le volet actif
+command-swap-a-pane-with-the-active-pane-keeping-focus = Échanger un volet avec le volet actif, sans déplacer le focus
+command-move-a-pane-into-its-own-tab = Déplacer un volet dans son propre onglet
+command-move-a-pane-into-its-own-window = Déplacer un volet dans sa propre fenêtre
+command-decrease-font-size = Réduire la taille de police
+command-increase-font-size = Augmenter la taille de police
+command-reset-font-size = Réinitialiser la taille de police
+command-reset-the-window-and-font-size = Réinitialiser la taille de la fenêtre et de la police
+command-new-terminal-tab-to-right = Nouvel onglet de terminal à droite
+command-new-tab = Nouvel onglet
+command-new-tab-default-domain = Nouvel onglet (domaine par défaut)
+command-activate-right-most-tab = Activer l’onglet le plus à droite
+command-close-current-tab = Fermer l’onglet actuel
+command-close-current-pane = Fermer le volet actuel
+command-activate-the-preceeding-window = Activer la fenêtre précédente
+command-activate-the-next-window = Activer la fenêtre suivante
+command-activate-the-tab-to-the-left = Activer l’onglet de gauche
+command-activate-the-tab-to-the-right = Activer l’onglet de droite
+command-activate-the-tab-to-the-left-no-wrapping = Activer l’onglet de gauche (sans boucler)
+command-activate-the-tab-to-the-right-no-wrapping = Activer l’onglet de droite (sans boucler)
+command-reload-configuration = Recharger la configuration
+command-quit-thinkterm = Quitter ThinkTerm
+command-move-tab-one-place-to-the-left = Déplacer l’onglet d’un cran vers la gauche
+command-move-tab-one-place-to-the-right = Déplacer l’onglet d’un cran vers la droite
+command-scroll-up-one-page = Défiler d’une page vers le haut
+command-scroll-down-one-page = Défiler d’une page vers le bas
+command-scroll-to-the-bottom = Défiler jusqu’en bas
+command-scroll-to-the-top = Défiler jusqu’en haut
+command-activate-copy-mode = Activer le mode copie
+command-activate-pane-left = Activer le volet de gauche
+command-activate-pane-right = Activer le volet de droite
+command-activate-pane-up = Activer le volet du haut
+command-activate-pane-down = Activer le volet du bas
+command-toggle-pane-zoom = Agrandir/rétablir le volet
+command-activate-the-last-active-tab = Activer le dernier onglet actif
+command-clear-the-key-table-stack = Vider la pile des tables de touches
+command-open-link-at-mouse-cursor = Ouvrir le lien sous le pointeur
+command-show-the-launcher = Afficher le lanceur
+command-navigate-tabs = Parcourir les onglets
+command-detach-the-domain-of-the-active-pane = Détacher le domaine du volet actif
+command-detach-the-default-domain = Détacher le domaine par défaut
+command-documentation = Documentation
+command-discuss-on-github = Discuter sur GitHub
+command-search-or-report-issue-on-github = Rechercher ou signaler un problème sur GitHub
+command-does-nothing = Ne fait rien
+command-clears-the-selection-in-the-current-pane = Efface la sélection dans le volet actuel
+command-pop-the-current-key-table = Quitter la table de touches actuelle
+command-reset-the-terminal-emulation-state-in-the-current-pane = Réinitialiser l’état du terminal dans le volet actuel
+command-activate-command-palette = Ouvrir la palette de commandes
+command-open-thread = Ouvrir la session
+
+## Commands with a name or a number in them.
+command-launch-menu-new-tab = { $label } (nouvel onglet)
+command-default-shell = (shell par défaut)
+command-new-tab-in-domain = Nouvel onglet (domaine { $name })
+command-attach-domain = Attacher le domaine { $name }
+command-detach-domain = Détacher le domaine { $name }
+command-switch-to-workspace = Passer à l’espace de travail { $name }
+command-move-spaces = Avancer de { $n } espaces
+command-activate-tab = Activer l’onglet { $n }
+command-activate-window = Activer la fenêtre { $n }
+command-resize-pane-left = Redimensionner le volet de { $n } cellule(s) vers la gauche
+command-resize-pane-right = Redimensionner le volet de { $n } cellule(s) vers la droite
+command-resize-pane-up = Redimensionner le volet de { $n } cellule(s) vers le haut
+command-resize-pane-down = Redimensionner le volet de { $n } cellule(s) vers le bas
+command-rotate-panes-clockwise = Faire pivoter les volets dans le sens horaire
+command-rotate-panes-counter-clockwise = Faire pivoter les volets dans le sens antihoraire
+command-split-vertically = Scinder verticalement (haut/bas)
+command-split-horizontally = Scinder horizontalement (gauche/droite)
+
+## The macOS menu bar. Commands are placed by fixed English names;
+## these are what the menus are called on screen.
+menu-bar-shell = Shell
+menu-bar-edit = Édition
+menu-bar-view = Présentation
+menu-bar-window = Fenêtre
+menu-bar-help = Aide
+menu-bar-attach = Attacher
+menu-bar-detach = Détacher
+menu-bar-copy-mode = Mode copie
+menu-bar-font-size = Taille de police
+menu-bar-level = Niveau
+menu-bar-move-tab = Déplacer l’onglet
+menu-bar-resize-pane = Redimensionner le volet
+menu-bar-rotate-pane = Faire pivoter les volets
+menu-bar-select-pane = Choisir un volet
+menu-bar-select-tab = Choisir un onglet
+menu-bar-select-window = Choisir une fenêtre
+menu-bar-workspace = Espace de travail
+menu-bar-about = À propos de ThinkTerm
+menu-bar-services = Services
+quit-confirm-title = Quitter ThinkTerm ?
+quit-confirm-detail = Tous les volets seront détachés et fermés, puis ThinkTerm quittera.
+quit-confirm-cancel = Annuler
+quit-confirm-ok = Quitter
+
+## The cover over a terminal that is not this window's to use yet.
+terminal-gate-busy = Le terminal est utilisé sur un autre appareil
+terminal-gate-busy-on = Le terminal est utilisé sur { $host }
+terminal-gate-busy-hint = Cliquez ou faites défiler pour continuer
+terminal-gate-free = Le terminal est disponible
+terminal-gate-free-hint = Cliquez ou faites défiler pour prendre la main
+terminal-gate-connecting = Connexion au terminal…
+terminal-gate-wait-hint = Veuillez patienter
+terminal-gate-reconnecting = Connexion perdue — reconnexion…
+terminal-gate-reconnecting-hint = Le terminal reprendra automatiquement
+terminal-gate-offline = Connexion interrompue
+terminal-gate-offline-hint = Reconnectez-vous depuis la barre latérale
+terminal-gate-syncing = Restauration de l’état du terminal…
+
+## Copying files to and from a folder here or on a remote.
+transfer-into-itself = Impossible de copier un dossier dans lui-même ou dans l’un de ses sous-dossiers
+transfer-too-many-items = Ce dossier contient plus de { $limit } éléments
+transfer-unreadable = Impossible de lire { $path }
+transfer-names-collide = Des noms dans { $folder } se confondent sur cet ordinateur
+transfer-name-unusable = Le nom de { $path } n’est pas utilisable sur cet ordinateur
+remote-files-cannot-upload = Cette connexion ne peut pas envoyer de fichiers
+remote-files-cannot-create-folders = Cette connexion ne peut pas créer de dossiers
+remote-files-cannot-download = Cette connexion ne peut pas télécharger de fichiers
+remote-files-cannot-delete-files = Cette connexion ne peut pas supprimer de fichiers
+remote-files-cannot-delete-folders = Cette connexion ne peut pas supprimer de dossiers
+remote-files-cannot-rename = Cette connexion ne peut pas renommer
+remote-files-cannot-run = Cette connexion ne peut pas lancer de programmes
+remote-files-cannot-look = Cette connexion ne peut pas examiner de fichiers
+remote-files-listing-timed-out = La liste des fichiers distants a expiré
+remote-files-listing-exec-failed = Impossible de lister les fichiers distants
+remote-files-listing-read-failed = La lecture de la liste des fichiers distants a échoué
+remote-files-listing-empty = L’hôte distant n’a pas renvoyé de liste de fichiers
+remote-files-listing-refused = L’hôte distant n’a pas pu lister les fichiers : { $detail }
+remote-files-listing-too-large = La liste des fichiers distants est trop grande
+download-completed = Téléchargement terminé
+download-completed-body = Téléchargé dans { $path }
+
+## Why a plugin's ask was not done. Plugins show these as they are.
+plugin-answer-no-terminal = aucun terminal à côté du panneau
+plugin-answer-local-terminal = le terminal à côté du panneau tourne sur cette machine
+plugin-answer-moved = le terminal à côté du panneau est maintenant sur une autre machine
+plugin-answer-not-connected = ThinkTerm n’est pas connecté à { $host }
+plugin-answer-closed = le panneau a été fermé
+
+## Browser client: the status line while the connection is down.
+web-toast-connection-lost = connexion perdue ({ $reason })
+web-toast-reconnecting = connexion perdue ({ $reason }) ; reconnexion…
+web-toast-still-reconnecting = toujours en train de se reconnecter après { $n } tentatives ({ $reason }). Le lien a peut-être expiré, ou le serveur est arrêté.
diff --git a/thinkterm-i18n/i18n/ja-JP.ftl b/thinkterm-i18n/i18n/ja-JP.ftl
index 7b0592d1..bdea34ee 100644
--- a/thinkterm-i18n/i18n/ja-JP.ftl
+++ b/thinkterm-i18n/i18n/ja-JP.ftl
@@ -1426,3 +1426,218 @@ web-machines-off-hint = このサーバーのデスクトップ版で 設定 →
web-machines-failed-off = このサーバーでオフになっています
web-machines-bad-port = ポートは 1 から 65535 までの数字です
web-machines-details = 詳細
+
+## Commands: the command palette, the menu bar and the keymap page.
+command-create-new-workspace = 新しいワークスペースを作成
+command-paste-primary-selection = プライマリ選択を貼り付け
+command-copy-to-primary-selection = プライマリ選択にコピー
+command-copy-to-clipboard = クリップボードにコピー
+command-copy-to-clipboard-and-primary-selection = クリップボードとプライマリ選択にコピー
+command-paste-from-clipboard = クリップボードから貼り付け
+command-toggle-full-screen-mode = フルスクリーンを切り替え
+command-toggle-always-on-top = 常に手前に表示を切り替え
+command-toggle-always-on-bottom = 常に背面に表示を切り替え
+command-always-on-top = 常に手前に表示
+command-normal = 標準
+command-always-on-bottom = 常に背面に表示
+command-hide-minimize-window = ウインドウを隠す/最小化
+command-show-restore-window = ウインドウを表示/復元
+command-hide-application = ThinkTerm を隠す
+command-settings = 設定…
+command-quit-and-stop-session-server = 終了してセッションサーバーを停止
+command-check-for-updates = アップデートを確認…
+command-remote-hosts = リモートホスト…
+command-add-remote-host = リモートホストを追加…
+command-live-overview = ライブ概要
+command-find-thread = セッションを検索
+command-toggle-left-sidebar = 左サイドバーを表示/隠す
+command-toggle-right-sidebar = 右サイドバーを表示/隠す
+command-new-thread = 新しいセッション
+command-previous-space = 前のスペース
+command-next-space = 次のスペース
+command-new-window = 新規ウインドウ
+command-clear-scrollback = スクロールバックを消去
+command-clear-the-scrollback-and-viewport = スクロールバックと画面を消去
+command-search-pane-output = ペインの出力を検索
+command-show-debug-overlay = デバッグオーバーレイを表示
+command-prompt-the-user-to-choose-from-a-list = リストから選んでもらう
+command-prompt-the-user-for-confirmation = 確認を求める
+command-prompt-the-user-for-a-line-of-text = 1 行のテキストを入力してもらう
+command-rename-tab = タブ名を変更
+command-rename-pane-tab = ペインのタブ名を変更
+command-rename-workspace = ワークスペース名を変更
+command-reveal-in-folder = フォルダで表示
+command-grant-folder-access = フォルダへのアクセスを許可
+command-open-file-with-application = アプリケーションでファイルを開く
+command-open-file = ファイルを開く
+command-open-file-with-other-application = 別のアプリケーションでファイルを開く
+command-reveal-file-in-folder = ファイルをフォルダで表示
+command-rename-file = ファイル名を変更
+command-move-file-to-trash = ファイルをゴミ箱に入れる
+command-copy-file-path = ファイルのパスをコピー
+command-rename-thread = セッション名を変更
+command-rename-space = スペース名を変更
+command-new-space = 新しいスペース
+command-new-space-here = ここに新しいスペース
+command-switch-space = スペースを切り替え
+command-delete-space = スペースを削除
+command-delete-space-everywhere = すべての場所からスペースを削除
+command-delete-space-end-remote-sessions = スペースを削除してリモートの端末を終了
+command-collapse-or-expand-threads = セッションを折りたたむ/展開
+command-remove-workspace = ワークスペースを取り除く
+command-archive-workspace = ワークスペースをアーカイブ
+command-unarchive-workspace = ワークスペースのアーカイブを解除
+command-archive-active-workspace = 現在のワークスペースをアーカイブ
+command-show-archived-workspaces = アーカイブ済みのワークスペースを表示
+command-connect-thread = セッションに接続
+command-disconnect-thread = セッションを切断
+command-pin-thread = セッションをピン留め
+command-delete-thread = セッションを削除
+command-mark-thread-as-unread = セッションを未読にする
+command-enter-quickselect-mode = クイック選択モードに入る
+command-enter-emoji-character-selection-mode = 絵文字/文字選択モードに入る
+command-enter-pane-selection-mode = ペイン選択モードに入る
+command-swap-a-pane-with-the-active-pane = ペインを現在のペインと入れ替える
+command-swap-a-pane-with-the-active-pane-keeping-focus = ペインを現在のペインと入れ替える(フォーカスは移さない)
+command-move-a-pane-into-its-own-tab = ペインを新しいタブに移動
+command-move-a-pane-into-its-own-window = ペインを新しいウインドウに移動
+command-decrease-font-size = フォントを小さく
+command-increase-font-size = フォントを大きく
+command-reset-font-size = フォントサイズをリセット
+command-reset-the-window-and-font-size = ウインドウとフォントのサイズをリセット
+command-new-terminal-tab-to-right = 右に新しいターミナルタブ
+command-new-tab = 新規タブ
+command-new-tab-default-domain = 新規タブ(デフォルトのドメイン)
+command-activate-right-most-tab = 一番右のタブに切り替え
+command-close-current-tab = 現在のタブを閉じる
+command-close-current-pane = 現在のペインを閉じる
+command-activate-the-preceeding-window = 前のウインドウに切り替え
+command-activate-the-next-window = 次のウインドウに切り替え
+command-activate-the-tab-to-the-left = 左のタブに切り替え
+command-activate-the-tab-to-the-right = 右のタブに切り替え
+command-activate-the-tab-to-the-left-no-wrapping = 左のタブに切り替え(端で止まる)
+command-activate-the-tab-to-the-right-no-wrapping = 右のタブに切り替え(端で止まる)
+command-reload-configuration = 設定を再読み込み
+command-quit-thinkterm = ThinkTerm を終了
+command-move-tab-one-place-to-the-left = タブを 1 つ左へ移動
+command-move-tab-one-place-to-the-right = タブを 1 つ右へ移動
+command-scroll-up-one-page = 1 ページ上へスクロール
+command-scroll-down-one-page = 1 ページ下へスクロール
+command-scroll-to-the-bottom = 一番下までスクロール
+command-scroll-to-the-top = 一番上までスクロール
+command-activate-copy-mode = コピーモードに入る
+command-activate-pane-left = 左のペインに切り替え
+command-activate-pane-right = 右のペインに切り替え
+command-activate-pane-up = 上のペインに切り替え
+command-activate-pane-down = 下のペインに切り替え
+command-toggle-pane-zoom = ペインのズームを切り替え
+command-activate-the-last-active-tab = 直前のタブに切り替え
+command-clear-the-key-table-stack = キーテーブルのスタックを消去
+command-open-link-at-mouse-cursor = マウス位置のリンクを開く
+command-show-the-launcher = ランチャーを表示
+command-navigate-tabs = タブを移動
+command-detach-the-domain-of-the-active-pane = 現在のペインのドメインを切断
+command-detach-the-default-domain = デフォルトのドメインを切断
+command-documentation = ドキュメント
+command-discuss-on-github = GitHub でディスカッション
+command-search-or-report-issue-on-github = GitHub で問題を検索・報告
+command-does-nothing = 何もしない
+command-clears-the-selection-in-the-current-pane = 現在のペインの選択を解除
+command-pop-the-current-key-table = 現在のキーテーブルを抜ける
+command-reset-the-terminal-emulation-state-in-the-current-pane = 現在のペインの端末の状態をリセット
+command-activate-command-palette = コマンドパレットを開く
+command-open-thread = セッションを開く
+
+## Commands with a name or a number in them.
+command-launch-menu-new-tab = { $label }(新規タブ)
+command-default-shell = (デフォルトのシェル)
+command-new-tab-in-domain = 新規タブ(ドメイン { $name })
+command-attach-domain = ドメイン { $name } に接続
+command-detach-domain = ドメイン { $name } を切断
+command-switch-to-workspace = ワークスペース { $name } に切り替え
+command-move-spaces = スペースを { $n } 個移動
+command-activate-tab = { $n } 番目のタブに切り替え
+command-activate-window = { $n } 番目のウインドウに切り替え
+command-resize-pane-left = ペインのサイズを左へ { $n } セル変更
+command-resize-pane-right = ペインのサイズを右へ { $n } セル変更
+command-resize-pane-up = ペインのサイズを上へ { $n } セル変更
+command-resize-pane-down = ペインのサイズを下へ { $n } セル変更
+command-rotate-panes-clockwise = ペインを時計回りに回転
+command-rotate-panes-counter-clockwise = ペインを反時計回りに回転
+command-split-vertically = 上下に分割
+command-split-horizontally = 左右に分割
+
+## The macOS menu bar. Commands are placed by fixed English names;
+## these are what the menus are called on screen.
+menu-bar-shell = シェル
+menu-bar-edit = 編集
+menu-bar-view = 表示
+menu-bar-window = ウインドウ
+menu-bar-help = ヘルプ
+menu-bar-attach = 接続
+menu-bar-detach = 切断
+menu-bar-copy-mode = コピーモード
+menu-bar-font-size = フォントサイズ
+menu-bar-level = レベル
+menu-bar-move-tab = タブを移動
+menu-bar-resize-pane = ペインのサイズ変更
+menu-bar-rotate-pane = ペインを回転
+menu-bar-select-pane = ペインを選択
+menu-bar-select-tab = タブを選択
+menu-bar-select-window = ウインドウを選択
+menu-bar-workspace = ワークスペース
+menu-bar-about = ThinkTerm について
+menu-bar-services = サービス
+quit-confirm-title = ThinkTerm を終了しますか?
+quit-confirm-detail = すべてのペインを切り離して閉じ、ThinkTerm を終了します。
+quit-confirm-cancel = キャンセル
+quit-confirm-ok = 終了
+
+## The cover over a terminal that is not this window's to use yet.
+terminal-gate-busy = ターミナルは別のデバイスで使用中です
+terminal-gate-busy-on = ターミナルは { $host } で使用中です
+terminal-gate-busy-hint = クリックまたはスクロールで続行
+terminal-gate-free = ターミナルは利用できます
+terminal-gate-free-hint = クリックまたはスクロールで操作を引き継ぐ
+terminal-gate-connecting = ターミナルに接続しています…
+terminal-gate-wait-hint = お待ちください
+terminal-gate-reconnecting = 接続が切れました — 再接続しています…
+terminal-gate-reconnecting-hint = 再接続するとターミナルは自動で再開します
+terminal-gate-offline = 接続が切れています
+terminal-gate-offline-hint = サイドバーから再接続してください
+terminal-gate-syncing = ターミナルの状態を復元しています…
+
+## Copying files to and from a folder here or on a remote.
+transfer-into-itself = フォルダをそれ自身やその中のフォルダにはコピーできません
+transfer-too-many-items = このフォルダには { $limit } 個を超える項目があります
+transfer-unreadable = { $path } を読み込めません
+transfer-names-collide = { $folder } の中の名前がこのコンピュータでは重複します
+transfer-name-unusable = { $path } の名前はこのコンピュータでは使えません
+remote-files-cannot-upload = この接続ではファイルをアップロードできません
+remote-files-cannot-create-folders = この接続ではフォルダを作成できません
+remote-files-cannot-download = この接続ではファイルをダウンロードできません
+remote-files-cannot-delete-files = この接続ではファイルを削除できません
+remote-files-cannot-delete-folders = この接続ではフォルダを削除できません
+remote-files-cannot-rename = この接続では名前を変更できません
+remote-files-cannot-run = この接続ではプログラムを実行できません
+remote-files-cannot-look = この接続ではファイルを確認できません
+remote-files-listing-timed-out = リモートのファイル一覧の取得がタイムアウトしました
+remote-files-listing-exec-failed = リモートでファイル一覧を取得できません
+remote-files-listing-read-failed = リモートのファイル一覧を読み込めませんでした
+remote-files-listing-empty = リモートホストからファイル一覧が返ってきませんでした
+remote-files-listing-refused = リモートホストでファイルを一覧できませんでした:{ $detail }
+remote-files-listing-too-large = リモートのファイル一覧が大きすぎます
+download-completed = ダウンロードが完了しました
+download-completed-body = { $path } にダウンロードしました
+
+## Why a plugin's ask was not done. Plugins show these as they are.
+plugin-answer-no-terminal = パネルの隣にターミナルがありません
+plugin-answer-local-terminal = パネルの隣のターミナルはこのマシンで動いています
+plugin-answer-moved = パネルの隣のターミナルは今は別のマシンにあります
+plugin-answer-not-connected = ThinkTerm は { $host } に接続していません
+plugin-answer-closed = パネルが閉じられました
+
+## Browser client: the status line while the connection is down.
+web-toast-connection-lost = 接続が切れました({ $reason })
+web-toast-reconnecting = 接続が切れました({ $reason })。再接続しています…
+web-toast-still-reconnecting = { $n } 回試しましたが、まだ再接続を試みています({ $reason })。リンクの期限が切れているか、サーバーが停止している可能性があります。
diff --git a/thinkterm-i18n/i18n/zh-CN.ftl b/thinkterm-i18n/i18n/zh-CN.ftl
index b4c37270..f8a82d6f 100644
--- a/thinkterm-i18n/i18n/zh-CN.ftl
+++ b/thinkterm-i18n/i18n/zh-CN.ftl
@@ -1426,3 +1426,218 @@ web-machines-off-hint = 在这台服务器桌面版的设置 → 网页里打开
web-machines-failed-off = 这台服务器已关闭此功能
web-machines-bad-port = 端口是 1 到 65535 之间的数字
web-machines-details = 详情
+
+## Commands: the command palette, the menu bar and the keymap page.
+command-create-new-workspace = 新建工作区
+command-paste-primary-selection = 粘贴主选区
+command-copy-to-primary-selection = 复制到主选区
+command-copy-to-clipboard = 复制到剪贴板
+command-copy-to-clipboard-and-primary-selection = 复制到剪贴板和主选区
+command-paste-from-clipboard = 从剪贴板粘贴
+command-toggle-full-screen-mode = 切换全屏
+command-toggle-always-on-top = 切换窗口置顶
+command-toggle-always-on-bottom = 切换窗口置底
+command-always-on-top = 置顶
+command-normal = 普通
+command-always-on-bottom = 置底
+command-hide-minimize-window = 隐藏/最小化窗口
+command-show-restore-window = 显示/恢复窗口
+command-hide-application = 隐藏 ThinkTerm
+command-settings = 设置…
+command-quit-and-stop-session-server = 退出并停止会话服务器
+command-check-for-updates = 检查更新…
+command-remote-hosts = 远程主机…
+command-add-remote-host = 添加远程主机…
+command-live-overview = 实时总览
+command-find-thread = 查找会话
+command-toggle-left-sidebar = 显示/隐藏左侧栏
+command-toggle-right-sidebar = 显示/隐藏右侧栏
+command-new-thread = 新建会话
+command-previous-space = 上一个空间
+command-next-space = 下一个空间
+command-new-window = 新建窗口
+command-clear-scrollback = 清除回滚记录
+command-clear-the-scrollback-and-viewport = 清除回滚记录和屏幕
+command-search-pane-output = 搜索窗格输出
+command-show-debug-overlay = 显示调试层
+command-prompt-the-user-to-choose-from-a-list = 让用户从列表中选择
+command-prompt-the-user-for-confirmation = 请用户确认
+command-prompt-the-user-for-a-line-of-text = 请用户输入一行文字
+command-rename-tab = 重命名标签页
+command-rename-pane-tab = 重命名窗格标签
+command-rename-workspace = 重命名工作区
+command-reveal-in-folder = 在文件夹中显示
+command-grant-folder-access = 授权文件夹访问
+command-open-file-with-application = 用应用打开文件
+command-open-file = 打开文件
+command-open-file-with-other-application = 用其他应用打开文件
+command-reveal-file-in-folder = 在文件夹中显示文件
+command-rename-file = 重命名文件
+command-move-file-to-trash = 将文件移到废纸篓
+command-copy-file-path = 复制文件路径
+command-rename-thread = 重命名会话
+command-rename-space = 重命名空间
+command-new-space = 新建空间
+command-new-space-here = 在此新建空间
+command-switch-space = 切换空间
+command-delete-space = 删除空间
+command-delete-space-everywhere = 在所有地方删除空间
+command-delete-space-end-remote-sessions = 删除空间并结束远程终端
+command-collapse-or-expand-threads = 折叠或展开会话
+command-remove-workspace = 移除工作区
+command-archive-workspace = 归档工作区
+command-unarchive-workspace = 取消归档工作区
+command-archive-active-workspace = 归档当前工作区
+command-show-archived-workspaces = 显示已归档的工作区
+command-connect-thread = 连接会话
+command-disconnect-thread = 断开会话
+command-pin-thread = 置顶会话
+command-delete-thread = 删除会话
+command-mark-thread-as-unread = 将会话标记为未读
+command-enter-quickselect-mode = 进入快速选择模式
+command-enter-emoji-character-selection-mode = 进入表情/字符选择模式
+command-enter-pane-selection-mode = 进入窗格选择模式
+command-swap-a-pane-with-the-active-pane = 与当前窗格互换
+command-swap-a-pane-with-the-active-pane-keeping-focus = 与当前窗格互换,焦点不动
+command-move-a-pane-into-its-own-tab = 把窗格移到单独的标签页
+command-move-a-pane-into-its-own-window = 把窗格移到单独的窗口
+command-decrease-font-size = 减小字号
+command-increase-font-size = 增大字号
+command-reset-font-size = 重置字号
+command-reset-the-window-and-font-size = 重置窗口大小和字号
+command-new-terminal-tab-to-right = 在右侧新建终端标签页
+command-new-tab = 新建标签页
+command-new-tab-default-domain = 新建标签页(默认域)
+command-activate-right-most-tab = 切换到最右边的标签页
+command-close-current-tab = 关闭当前标签页
+command-close-current-pane = 关闭当前窗格
+command-activate-the-preceeding-window = 切换到上一个窗口
+command-activate-the-next-window = 切换到下一个窗口
+command-activate-the-tab-to-the-left = 切换到左边的标签页
+command-activate-the-tab-to-the-right = 切换到右边的标签页
+command-activate-the-tab-to-the-left-no-wrapping = 切换到左边的标签页(到头不循环)
+command-activate-the-tab-to-the-right-no-wrapping = 切换到右边的标签页(到头不循环)
+command-reload-configuration = 重新加载配置
+command-quit-thinkterm = 退出 ThinkTerm
+command-move-tab-one-place-to-the-left = 标签页左移一位
+command-move-tab-one-place-to-the-right = 标签页右移一位
+command-scroll-up-one-page = 向上滚动一页
+command-scroll-down-one-page = 向下滚动一页
+command-scroll-to-the-bottom = 滚动到底部
+command-scroll-to-the-top = 滚动到顶部
+command-activate-copy-mode = 进入复制模式
+command-activate-pane-left = 切换到左边的窗格
+command-activate-pane-right = 切换到右边的窗格
+command-activate-pane-up = 切换到上边的窗格
+command-activate-pane-down = 切换到下边的窗格
+command-toggle-pane-zoom = 放大/还原窗格
+command-activate-the-last-active-tab = 切换到上次用的标签页
+command-clear-the-key-table-stack = 清空按键表栈
+command-open-link-at-mouse-cursor = 打开鼠标处的链接
+command-show-the-launcher = 显示启动器
+command-navigate-tabs = 浏览标签页
+command-detach-the-domain-of-the-active-pane = 断开当前窗格所在的域
+command-detach-the-default-domain = 断开默认域
+command-documentation = 文档
+command-discuss-on-github = 在 GitHub 上讨论
+command-search-or-report-issue-on-github = 在 GitHub 上搜索或报告问题
+command-does-nothing = 无操作
+command-clears-the-selection-in-the-current-pane = 清除当前窗格中的选择
+command-pop-the-current-key-table = 退出当前按键表
+command-reset-the-terminal-emulation-state-in-the-current-pane = 重置当前窗格的终端状态
+command-activate-command-palette = 打开命令面板
+command-open-thread = 打开会话
+
+## Commands with a name or a number in them.
+command-launch-menu-new-tab = { $label }(新标签页)
+command-default-shell = (默认 shell)
+command-new-tab-in-domain = 新建标签页(域 { $name })
+command-attach-domain = 连接域 { $name }
+command-detach-domain = 断开域 { $name }
+command-switch-to-workspace = 切换到工作区 { $name }
+command-move-spaces = 移动 { $n } 个空间
+command-activate-tab = 切换到第 { $n } 个标签页
+command-activate-window = 切换到第 { $n } 个窗口
+command-resize-pane-left = 窗格向左调整 { $n } 格
+command-resize-pane-right = 窗格向右调整 { $n } 格
+command-resize-pane-up = 窗格向上调整 { $n } 格
+command-resize-pane-down = 窗格向下调整 { $n } 格
+command-rotate-panes-clockwise = 顺时针轮换窗格
+command-rotate-panes-counter-clockwise = 逆时针轮换窗格
+command-split-vertically = 上下分屏
+command-split-horizontally = 左右分屏
+
+## The macOS menu bar. Commands are placed by fixed English names;
+## these are what the menus are called on screen.
+menu-bar-shell = Shell
+menu-bar-edit = 编辑
+menu-bar-view = 显示
+menu-bar-window = 窗口
+menu-bar-help = 帮助
+menu-bar-attach = 连接
+menu-bar-detach = 断开
+menu-bar-copy-mode = 复制模式
+menu-bar-font-size = 字号
+menu-bar-level = 层级
+menu-bar-move-tab = 移动标签页
+menu-bar-resize-pane = 调整窗格大小
+menu-bar-rotate-pane = 轮换窗格
+menu-bar-select-pane = 选择窗格
+menu-bar-select-tab = 选择标签页
+menu-bar-select-window = 选择窗口
+menu-bar-workspace = 工作区
+menu-bar-about = 关于 ThinkTerm
+menu-bar-services = 服务
+quit-confirm-title = 要退出 ThinkTerm 吗?
+quit-confirm-detail = 将断开并关闭所有窗格,然后退出 ThinkTerm。
+quit-confirm-cancel = 取消
+quit-confirm-ok = 退出
+
+## The cover over a terminal that is not this window's to use yet.
+terminal-gate-busy = 终端正在另一台设备上使用
+terminal-gate-busy-on = 终端正在 { $host } 上使用
+terminal-gate-busy-hint = 点击或滚动即可继续
+terminal-gate-free = 终端可以使用
+terminal-gate-free-hint = 点击或滚动即可接管
+terminal-gate-connecting = 正在连接终端…
+terminal-gate-wait-hint = 请稍候
+terminal-gate-reconnecting = 连接已断开,正在重连…
+terminal-gate-reconnecting-hint = 连上后终端会自动恢复
+terminal-gate-offline = 连接已断开
+terminal-gate-offline-hint = 请在侧边栏重新连接
+terminal-gate-syncing = 正在恢复终端状态…
+
+## Copying files to and from a folder here or on a remote.
+transfer-into-itself = 不能把文件夹复制到它自己或它的子文件夹里
+transfer-too-many-items = 这个文件夹里的项目超过 { $limit } 个
+transfer-unreadable = 无法读取 { $path }
+transfer-names-collide = { $folder } 里有名字在这台电脑上会重名
+transfer-name-unusable = { $path } 的名字在这台电脑上不能用
+remote-files-cannot-upload = 这个连接不能上传文件
+remote-files-cannot-create-folders = 这个连接不能新建文件夹
+remote-files-cannot-download = 这个连接不能下载文件
+remote-files-cannot-delete-files = 这个连接不能删除文件
+remote-files-cannot-delete-folders = 这个连接不能删除文件夹
+remote-files-cannot-rename = 这个连接不能重命名
+remote-files-cannot-run = 这个连接不能运行程序
+remote-files-cannot-look = 这个连接不能查看文件
+remote-files-listing-timed-out = 列出远程文件超时了
+remote-files-listing-exec-failed = 无法在远程列出文件
+remote-files-listing-read-failed = 读取远程文件列表失败
+remote-files-listing-empty = 远程主机没有返回文件列表
+remote-files-listing-refused = 远程主机无法列出文件:{ $detail }
+remote-files-listing-too-large = 远程文件列表太大了
+download-completed = 下载完成
+download-completed-body = 已下载到 { $path }
+
+## Why a plugin's ask was not done. Plugins show these as they are.
+plugin-answer-no-terminal = 面板旁边没有终端
+plugin-answer-local-terminal = 面板旁边的终端就在这台机器上
+plugin-answer-moved = 面板旁边的终端现在在另一台机器上
+plugin-answer-not-connected = ThinkTerm 还没有连接到 { $host }
+plugin-answer-closed = 面板已关闭
+
+## Browser client: the status line while the connection is down.
+web-toast-connection-lost = 连接已断开({ $reason })
+web-toast-reconnecting = 连接已断开({ $reason }),正在重连…
+web-toast-still-reconnecting = 已重试 { $n } 次仍在重连({ $reason })。链接可能已过期,或者服务器没在运行。
diff --git a/thinkterm-i18n/src/lib.rs b/thinkterm-i18n/src/lib.rs
index 9793abbb..7ccd22b0 100644
--- a/thinkterm-i18n/src/lib.rs
+++ b/thinkterm-i18n/src/lib.rs
@@ -8,6 +8,7 @@ use fluent_bundle::FluentResource;
pub use fluent_bundle::{FluentArgs, FluentValue};
use fluent_langneg::negotiate_languages;
use fluent_langneg::NegotiationStrategy;
+use std::cell::Cell;
use std::collections::HashSet;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Mutex, OnceLock};
@@ -89,6 +90,10 @@ static ACTIVE_LOCALE: OnceLock<AtomicUsize> = OnceLock::new();
static INITIAL: OnceLock<fn() -> &'static str> = OnceLock::new();
static REPORTED_ERRORS: OnceLock<Mutex<HashSet<String>>> = OnceLock::new();
+thread_local! {
+ static IN_ENGLISH: Cell<bool> = const { Cell::new(false) };
+}
+
fn build_catalog(locale: Locale) -> Catalog {
let language_id: LanguageIdentifier = locale
.code
@@ -163,6 +168,9 @@ pub fn set_initial_resolver(resolver: fn() -> &'static str) {
}
fn active_locale() -> Locale {
+ if IN_ENGLISH.with(Cell::get) {
+ return EN_US;
+ }
let index = ACTIVE_LOCALE
.get_or_init(|| {
let code = INITIAL.get().map(|resolve| resolve()).unwrap_or(EN_US.code);
@@ -185,6 +193,20 @@ pub fn activate_preference(preference: &str, system: &[String]) -> &'static str
locale.code
}
+/// Runs `f` with this thread's lookups answering in en-US, whatever the
+/// active locale: how a client gets the English form of a name it shows
+/// translated, to keep something that must not change with the language.
+pub fn in_english<R>(f: impl FnOnce() -> R) -> R {
+ struct Restore(bool);
+ impl Drop for Restore {
+ fn drop(&mut self) {
+ IN_ENGLISH.with(|flag| flag.set(self.0));
+ }
+ }
+ let _restore = Restore(IN_ENGLISH.with(|flag| flag.replace(true)));
+ f()
+}
+
fn format_for(locale: Locale, id: &str, args: Option<&FluentArgs<'_>>) -> Option<String> {
let catalog = &catalogs().locales[locale.index()];
let message = catalog.bundle.get_message(id)?;
@@ -221,6 +243,15 @@ pub fn tr_args(id: &str, args: &FluentArgs<'_>) -> String {
format(id, Some(args))
}
+/// What `id` reads in each shipped locale that defines it: how a client
+/// finds what it named in another language, such as a menu to rename.
+pub fn tr_every_locale(id: &str) -> Vec<String> {
+ SUPPORTED_LOCALES
+ .iter()
+ .filter_map(|locale| format_for(*locale, id, None))
+ .collect()
+}
+
/// Whether the en-US catalogue defines `id` (with a value).
pub fn has_key(id: &str) -> bool {
catalogs().locales[EN_US.index()]
@@ -313,6 +344,18 @@ mod tests {
}
}
+ #[test]
+ fn in_english_answers_in_en_us_and_then_restores() {
+ activate_preference("zh-CN", &[]);
+ let translated = tr("command-copy-to-clipboard");
+ assert_ne!(translated, "Copy to clipboard");
+ assert_eq!(in_english(|| tr("command-copy-to-clipboard")), "Copy to clipboard");
+ // A nested scope ending does not end the outer one.
+ assert_eq!(in_english(|| { in_english(|| ()); current_locale() }), "en-US");
+ assert_eq!(tr("command-copy-to-clipboard"), translated);
+ activate_preference("en-US", &[]);
+ }
+
#[test]
fn fluent_arguments_can_be_reordered_by_a_translation() {
let mut args = FluentArgs::new();
diff --git a/thinkterm-web/src/app.rs b/thinkterm-web/src/app.rs
index f89381ee..99c4cced 100644
--- a/thinkterm-web/src/app.rs
+++ b/thinkterm-web/src/app.rs
@@ -1868,14 +1868,13 @@ impl<P: Platform, L: Link> App<P, L> {
let Some(reason) = inner.disconnected.clone() else {
return;
};
+ let mut args = thinkterm_i18n::FluentArgs::new();
+ args.set("reason", reason);
let text = if inner.reconnect_attempts >= RECONNECT_DOUBT_AFTER {
- format!(
- "still trying to reconnect after {} attempts ({reason}). \
- The link may have expired, or the server may be down.",
- inner.reconnect_attempts
- )
+ args.set("n", inner.reconnect_attempts);
+ thinkterm_i18n::tr_args("web-toast-still-reconnecting", &args)
} else {
- format!("connection lost ({reason}); reconnecting…")
+ thinkterm_i18n::tr_args("web-toast-reconnecting", &args)
};
Self::set_status(&inner, &text);
}
@@ -1890,8 +1889,12 @@ impl<P: Platform, L: Link> App<P, L> {
if !inner.settings.auto_reconnect {
// Asked not to: the remark stays, sticky, until a reconnect
// is asked for.
- let reason = inner.disconnected.clone().unwrap_or_default();
- Self::set_status(&inner, &format!("connection lost ({reason})"));
+ let mut args = thinkterm_i18n::FluentArgs::new();
+ args.set("reason", inner.disconnected.clone().unwrap_or_default());
+ Self::set_status(
+ &inner,
+ &thinkterm_i18n::tr_args("web-toast-connection-lost", &args),
+ );
return;
}
inner.reconnect_pending = true;
diff --git a/wezterm-gui/src/commands.rs b/wezterm-gui/src/commands.rs
index f7d5ac74..e231d7c3 100644
--- a/wezterm-gui/src/commands.rs
+++ b/wezterm-gui/src/commands.rs
@@ -1,3 +1,4 @@
+use crate::i18n::{tr, tr_args};
use crate::inputmap::InputMap;
use config::keyassignment::*;
use config::window::WindowLevel;
@@ -80,6 +81,17 @@ pub struct ExpandedCommand {
/// the Space a thread belongs to. `menubar` cannot serve here: it is
/// `&'static` and these values are built from live state.
pub accessory: Option<Cow<'static, str>>,
+ /// The English `brief`, when it differs from the one shown: the
+ /// palette's recents are kept by it, so they survive a language switch
+ /// and still match what was recorded before the names were translated.
+ pub english_brief: Option<Cow<'static, str>>,
+}
+
+impl ExpandedCommand {
+ /// What the palette's recents remember this command by.
+ pub fn recent_key(&self) -> &str {
+ self.english_brief.as_deref().unwrap_or(&self.brief)
+ }
}
impl std::fmt::Debug for CommandDef {
@@ -184,6 +196,7 @@ impl CommandDef {
brief: def.brief.into(),
doc: def.doc.into(),
keys,
+ english_brief: english_brief_of(&action),
action,
menubar: def.menubar,
icon: def.icon.map(Cow::Borrowed),
@@ -211,21 +224,20 @@ impl CommandDef {
// Generate some stuff based on the config
for cmd in &config.launch_menu {
- let label = match cmd.label.as_ref() {
- Some(label) => label.to_string(),
- None => match cmd.args.as_ref() {
- Some(args) => args.join(" "),
- None => "(default shell)".to_string(),
- },
+ let brief = || {
+ let mut args = fluent_bundle::FluentArgs::new();
+ args.set("label", launch_menu_label(cmd));
+ tr_args("command-launch-menu-new-tab", &args)
};
result.push(ExpandedCommand {
- brief: format!("{label} (New Tab)").into(),
+ brief: brief().into(),
doc: "".into(),
keys: vec![],
action: KeyAssignment::SpawnCommandInNewTab(cmd.clone()),
menubar: &["Shell"],
icon: Some("md_tab_plus".into()),
accessory: None,
+ english_brief: in_english(brief),
});
}
@@ -252,7 +264,8 @@ impl CommandDef {
if dom.spawnable() {
if dom.state() == DomainState::Attached {
result.push(ExpandedCommand {
- brief: format!("New Tab (Domain {label})").into(),
+ brief: named("command-new-tab-in-domain", label).into(),
+ english_brief: in_english(|| named("command-new-tab-in-domain", label)),
doc: "".into(),
keys: vec![],
action: KeyAssignment::SpawnCommandInNewTab(SpawnCommand {
@@ -265,7 +278,8 @@ impl CommandDef {
});
} else {
result.push(ExpandedCommand {
- brief: format!("Attach Domain {label}").into(),
+ brief: named("command-attach-domain", label).into(),
+ english_brief: in_english(|| named("command-attach-domain", label)),
doc: "".into(),
keys: vec![],
action: KeyAssignment::AttachDomain(name.to_string()),
@@ -286,7 +300,8 @@ impl CommandDef {
continue;
}
result.push(ExpandedCommand {
- brief: format!("Detach Domain {label}").into(),
+ brief: named("command-detach-domain", label).into(),
+ english_brief: in_english(|| named("command-detach-domain", label)),
doc: "".into(),
keys: vec![],
action: KeyAssignment::DetachDomain(SpawnTabDomain::DomainName(
@@ -303,7 +318,10 @@ impl CommandDef {
for workspace in mux.iter_workspaces() {
if workspace != active_workspace {
result.push(ExpandedCommand {
- brief: format!("Switch to workspace {workspace}").into(),
+ brief: named("command-switch-to-workspace", &workspace).into(),
+ english_brief: in_english(|| {
+ named("command-switch-to-workspace", &workspace)
+ }),
doc: "".into(),
keys: vec![],
action: KeyAssignment::SwitchToWorkspace {
@@ -317,7 +335,8 @@ impl CommandDef {
}
}
result.push(ExpandedCommand {
- brief: "Create new Workspace".into(),
+ brief: tr("command-create-new-workspace").into(),
+ english_brief: in_english(|| tr("command-create-new-workspace")),
doc: "".into(),
keys: vec![],
action: KeyAssignment::SwitchToWorkspace {
@@ -344,6 +363,7 @@ impl CommandDef {
result.push(ExpandedCommand {
brief: cmd.brief.into(),
doc: cmd.doc.into(),
+ english_brief: english_brief_of(&entry.action),
keys: vec![(*mods, keycode.clone())],
action: entry.action.clone(),
menubar: cmd.menubar,
@@ -365,6 +385,7 @@ impl CommandDef {
result.push(ExpandedCommand {
brief: cmd.brief.into(),
doc: cmd.doc.into(),
+ english_brief: english_brief_of(&entry.action),
keys: vec![],
action: entry.action.clone(),
menubar: cmd.menubar,
@@ -416,6 +437,7 @@ impl CommandDef {
let main_menu = match Menu::get_main_menu() {
Some(existing) => {
+ drop_renamed_menus(&existing);
mark_candidates(
&existing,
&mut candidates_for_removal,
@@ -449,7 +471,8 @@ impl CommandDef {
continue;
}
- let mut submenu = main_menu.get_or_create_sub_menu(&cmd.menubar[0], |menu| {
+ let shown = menu_title(cmd.menubar[0]);
+ let mut submenu = main_menu.get_or_create_sub_menu(&shown, |menu| {
if cmd.menubar[0] == "Window" {
menu.assign_as_windows_menu();
// macOS will insert stuff at the top and bottom, so we add
@@ -458,8 +481,11 @@ impl CommandDef {
} else if cmd.menubar[0] == "ThinkTerm" {
menu.assign_as_app_menu();
- let about_item =
- MenuItem::new_with("About ThinkTerm", Some(thinkterm_about_sel), "");
+ let about_item = MenuItem::new_with(
+ &tr("menu-bar-about"),
+ Some(thinkterm_about_sel),
+ "",
+ );
about_item.set_target_application_delegate();
about_item.set_system_symbol_image("info.circle");
@@ -468,7 +494,7 @@ impl CommandDef {
let services_menu = Menu::new_with_title("Services");
services_menu.assign_as_services_menu();
- let services_item = MenuItem::new_with("Services", None, "");
+ let services_item = MenuItem::new_with(&tr("menu-bar-services"), None, "");
menu.add_item(&services_item);
services_item.set_sub_menu(&services_menu);
@@ -480,7 +506,7 @@ impl CommandDef {
// Fill out any submenu hierarchy
for sub_title in cmd.menubar.iter().skip(1) {
- submenu = submenu.get_or_create_sub_menu(sub_title, |_menu| {});
+ submenu = submenu.get_or_create_sub_menu(&menu_title(sub_title), |_menu| {});
}
let mut candidate = inputmap.locate_app_wide_key_assignment(&cmd.action);
@@ -583,6 +609,86 @@ impl CommandDef {
}
}
+/// The fixed English names that place a command in the menu bar, and the
+/// keys they are shown by. They stay the commands' identity; only what is
+/// shown follows the language.
+const MENU_TITLES: &[(&str, &str)] = &[
+ ("Shell", "menu-bar-shell"),
+ ("Edit", "menu-bar-edit"),
+ ("View", "menu-bar-view"),
+ ("Window", "menu-bar-window"),
+ ("Help", "menu-bar-help"),
+ ("Attach", "menu-bar-attach"),
+ ("Detach", "menu-bar-detach"),
+ ("Copy Mode", "menu-bar-copy-mode"),
+ ("Font Size", "menu-bar-font-size"),
+ ("Level", "menu-bar-level"),
+ ("Move Tab", "menu-bar-move-tab"),
+ ("Resize Pane", "menu-bar-resize-pane"),
+ ("Rotate Pane", "menu-bar-rotate-pane"),
+ ("Select Pane", "menu-bar-select-pane"),
+ ("Select Tab", "menu-bar-select-tab"),
+ ("Select Window", "menu-bar-select-window"),
+ ("Workspace", "menu-bar-workspace"),
+];
+
+/// A menu bar name as shown; the app's own menu keeps the app's name.
+pub fn menu_title(name: &str) -> String {
+ match MENU_TITLES.iter().find(|(english, _)| *english == name) {
+ Some((_, id)) => tr(id),
+ None => name.to_string(),
+ }
+}
+
+/// Menus are found again by their title, so after a change of language the
+/// old ones would linger, emptied, beside the new. Drop each one named in
+/// another language: the commands in it are rebuilt under the new title.
+#[cfg(target_os = "macos")]
+fn drop_renamed_menus(menu: &window::os::macos::menu::Menu) {
+ let current: Vec<String> = MENU_TITLES.iter().map(|(_, id)| tr(id)).collect();
+ let mut stale = vec![];
+ for (_, id) in MENU_TITLES {
+ for title in thinkterm_i18n::tr_every_locale(id) {
+ if !current.contains(&title) && !stale.contains(&title) {
+ stale.push(title);
+ }
+ }
+ }
+ drop_menus_titled(menu, &stale);
+
+ // The two the app menu is built with once are renamed where they stand.
+ let Some(app_menu) = menu.item_at_index(0).and_then(|item| item.get_sub_menu()) else {
+ return;
+ };
+ for id in ["menu-bar-about", "menu-bar-services"] {
+ let current = tr(id);
+ for title in thinkterm_i18n::tr_every_locale(id) {
+ if title != current {
+ if let Some(item) = app_menu.item_with_title(&title) {
+ item.set_title(&current);
+ }
+ }
+ }
+ }
+}
+
+#[cfg(target_os = "macos")]
+fn drop_menus_titled(menu: &window::os::macos::menu::Menu, stale: &[String]) {
+ for title in stale {
+ while let Some(item) = menu.item_with_title(title) {
+ if item.get_sub_menu().is_none() {
+ break;
+ }
+ menu.remove_item(&item);
+ }
+ }
+ for item in menu.items() {
+ if let Some(submenu) = item.get_sub_menu() {
+ drop_menus_titled(&submenu, stale);
+ }
+ }
+}
+
/// Given "1" return "1st", "2" -> "2nd" and so on
fn english_ordinal(n: isize) -> String {
let n = n.to_string();
@@ -597,6 +703,48 @@ fn english_ordinal(n: isize) -> String {
}
}
+/// `name` again in English, unless that is what the interface shows
+/// already; see `ExpandedCommand::english_brief`.
+fn in_english(name: impl FnOnce() -> String) -> Option<Cow<'static, str>> {
+ (crate::i18n::current_locale() != "en-US").then(|| crate::i18n::in_english(name).into())
+}
+
+fn english_brief_of(action: &KeyAssignment) -> Option<Cow<'static, str>> {
+ in_english(|| {
+ derive_command_from_key_assignment(action)
+ .map(|def| def.brief.into_owned())
+ .unwrap_or_default()
+ })
+}
+
+/// A command name that carries a domain's, workspace's or other name.
+fn named(id: &str, name: &str) -> String {
+ let mut args = fluent_bundle::FluentArgs::new();
+ args.set("name", name.to_string());
+ tr_args(id, &args)
+}
+
+/// A command name that carries a number, and for English its ordinal.
+fn counted(id: &str, n: i64, ordinal: Option<&str>) -> String {
+ let mut args = fluent_bundle::FluentArgs::new();
+ args.set("n", n);
+ if let Some(ordinal) = ordinal {
+ args.set("ordinal", ordinal.to_string());
+ }
+ tr_args(id, &args)
+}
+
+/// What a launch menu entry is called: its label, else its command line.
+pub fn launch_menu_label(cmd: &SpawnCommand) -> String {
+ match cmd.label.as_ref() {
+ Some(label) => label.to_string(),
+ None => match cmd.args.as_ref() {
+ Some(args) => args.join(" "),
+ None => tr("command-default-shell"),
+ },
+ }
+}
+
fn spawn_command_from_action(action: &KeyAssignment) -> Option<&SpawnCommand> {
match action {
SplitPane(config::keyassignment::SplitPane { command, .. }) => Some(command),
@@ -623,7 +771,7 @@ fn label_string(action: &KeyAssignment, candidate: String) -> String {
pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<CommandDef> {
Some(match action {
PasteFrom(ClipboardPasteSource::PrimarySelection) => CommandDef {
- brief: "Paste primary selection".into(),
+ brief: tr("command-paste-primary-selection").into(),
doc: "Pastes text from the primary selection".into(),
keys: vec![(Modifiers::SHIFT, "Insert".into())],
args: &[ArgType::ActivePane],
@@ -635,7 +783,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
destination: ClipboardCopyDestination::PrimarySelection,
}
| CopyTo(ClipboardCopyDestination::PrimarySelection) => CommandDef {
- brief: "Copy to primary selection".into(),
+ brief: tr("command-copy-to-primary-selection").into(),
doc: "Copies text to the primary selection".into(),
keys: vec![(Modifiers::CTRL, "Insert".into())],
args: &[ArgType::ActivePane],
@@ -647,7 +795,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
destination: ClipboardCopyDestination::Clipboard,
}
| CopyTo(ClipboardCopyDestination::Clipboard) => CommandDef {
- brief: "Copy to clipboard".into(),
+ brief: tr("command-copy-to-clipboard").into(),
doc: "Copies text to the clipboard".into(),
keys: vec![
(Modifiers::SUPER, "c".into()),
@@ -662,7 +810,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
destination: ClipboardCopyDestination::ClipboardAndPrimarySelection,
}
| CopyTo(ClipboardCopyDestination::ClipboardAndPrimarySelection) => CommandDef {
- brief: "Copy to clipboard and primary selection".into(),
+ brief: tr("command-copy-to-clipboard-and-primary-selection").into(),
doc: "Copies text to the clipboard and the primary selection".into(),
keys: vec![(Modifiers::CTRL, "Insert".into())],
args: &[ArgType::ActivePane],
@@ -670,7 +818,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_content_copy"),
},
PasteFrom(ClipboardPasteSource::Clipboard) => CommandDef {
- brief: "Paste from clipboard".into(),
+ brief: tr("command-paste-from-clipboard").into(),
doc: "Pastes text from the clipboard".into(),
keys: vec![
(Modifiers::SUPER, "v".into()),
@@ -681,7 +829,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_content_paste"),
},
ToggleFullScreen => CommandDef {
- brief: "Toggle full screen mode".into(),
+ brief: tr("command-toggle-full-screen-mode").into(),
doc: "Switch between normal and full screen mode".into(),
keys: vec![(Modifiers::ALT, "Return".into())],
args: &[ArgType::ActiveWindow],
@@ -689,7 +837,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_fullscreen"),
},
ToggleAlwaysOnTop => CommandDef {
- brief: "Toggle always on Top".into(),
+ brief: tr("command-toggle-always-on-top").into(),
doc: "Toggles the window between floating and non-floating states to stay on top of other windows.".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -698,7 +846,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
},
ToggleAlwaysOnBottom => CommandDef {
- brief: "Toggle always on Bottom".into(),
+ brief: tr("command-toggle-always-on-bottom").into(),
doc: "Toggles the window to remain behind all other windows.".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -706,7 +854,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
SetWindowLevel(WindowLevel::AlwaysOnTop) => CommandDef {
- brief: "Always on Top".into(),
+ brief: tr("command-always-on-top").into(),
doc: "Set the window level to be on top of other windows.".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -714,7 +862,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
SetWindowLevel(WindowLevel::Normal) => CommandDef {
- brief: "Normal".into(),
+ brief: tr("command-normal").into(),
doc: "Set window level to normal".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -722,7 +870,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
SetWindowLevel(WindowLevel::AlwaysOnBottom) => CommandDef {
- brief: "Always on Bottom".into(),
+ brief: tr("command-always-on-bottom").into(),
doc: "Set window to remain behind all other windows.".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -730,7 +878,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
Hide => CommandDef {
- brief: "Hide/Minimize Window".into(),
+ brief: tr("command-hide-minimize-window").into(),
doc: "Hides/Mimimizes the current window".into(),
keys: vec![(Modifiers::SUPER, "m".into())],
args: &[ArgType::ActiveWindow],
@@ -738,7 +886,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_window_minimize"),
},
Show => CommandDef {
- brief: "Show/Restore Window".into(),
+ brief: tr("command-show-restore-window").into(),
doc: "Show/Restore the current window".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -746,7 +894,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_window_restore"),
},
HideApplication => CommandDef {
- brief: "Hide Application".into(),
+ brief: tr("command-hide-application").into(),
doc: "Hides all of the windows of the application. \
This is macOS specific."
.into(),
@@ -756,7 +904,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
OpenSettings => CommandDef {
- brief: "Settings...".into(),
+ brief: tr("command-settings").into(),
doc: "Opens the ThinkTerm settings UI".into(),
keys: vec![(Modifiers::SUPER, ",".into())],
args: &[ArgType::ActiveWindow],
@@ -764,7 +912,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_settings_gear"),
},
QuitAndStopSessionServer => CommandDef {
- brief: "Quit and Stop Session Server".into(),
+ brief: tr("command-quit-and-stop-session-server").into(),
doc: "Quits ThinkTerm and stops the background session server; the terminals in it end".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -772,7 +920,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_power"),
},
CheckForUpdates => CommandDef {
- brief: "Check for Updates...".into(),
+ brief: tr("command-check-for-updates").into(),
doc: "Opens Settings on the Software Update page".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -780,7 +928,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_update"),
},
OpenSshHosts => CommandDef {
- brief: "Remote Hosts...".into(),
+ brief: tr("command-remote-hosts").into(),
doc: "Opens the ThinkTerm SSH host manager".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -788,7 +936,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_server_network"),
},
AddRemoteHost => CommandDef {
- brief: "Add Remote Host...".into(),
+ brief: tr("command-add-remote-host").into(),
// Says SSH so that typing it in the palette still finds this.
doc: "Opens the ThinkTerm SSH host manager on a blank host".into(),
keys: vec![],
@@ -797,7 +945,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_earth"),
},
ToggleLiveOverview => CommandDef {
- brief: "Live Overview".into(),
+ brief: tr("command-live-overview").into(),
doc: "Shows all live ThinkTerm threads grouped by Space".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -805,7 +953,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_multiple_windows"),
},
OpenThreadSearch => CommandDef {
- brief: "Find Thread".into(),
+ brief: tr("command-find-thread").into(),
doc: "Searches every saved thread and jumps to the one picked".into(),
keys: vec![
// Off macOS Ctrl+P is the shell's previous command, so the
@@ -819,7 +967,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_search"),
},
ToggleWorkspaceSidebar => CommandDef {
- brief: "Toggle Left Sidebar".into(),
+ brief: tr("command-toggle-left-sidebar").into(),
doc: "Shows or hides the left sidebar".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -827,7 +975,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_layout_sidebar_left"),
},
ToggleRightSidebar => CommandDef {
- brief: "Toggle Right Sidebar".into(),
+ brief: tr("command-toggle-right-sidebar").into(),
doc: "Shows or hides the right sidebar".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -835,7 +983,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_layout_sidebar_right"),
},
CreateWorkspaceThreadInActiveProject => CommandDef {
- brief: "New Thread".into(),
+ brief: tr("command-new-thread").into(),
doc: "Starts a thread in the project the sidebar has active".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -843,7 +991,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_add"),
},
ActivateSpaceRelative(-1) => CommandDef {
- brief: "Previous Space".into(),
+ brief: tr("command-previous-space").into(),
doc: "Moves this window to the Space before it, as a sidebar swipe does".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -851,7 +999,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_chevron_left"),
},
ActivateSpaceRelative(1) => CommandDef {
- brief: "Next Space".into(),
+ brief: tr("command-next-space").into(),
doc: "Moves this window to the Space after it, as a sidebar swipe does".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -859,7 +1007,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_chevron_right"),
},
ActivateSpaceRelative(n) => CommandDef {
- brief: format!("Move {n} Spaces").into(),
+ brief: counted("command-move-spaces", *n as i64, None).into(),
doc: "Moves this window that many Spaces along, as sidebar swipes do".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -867,7 +1015,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
SpawnWindow => CommandDef {
- brief: "New Window".into(),
+ brief: tr("command-new-window").into(),
doc: "Launches the default program into a new window".into(),
keys: vec![(Modifiers::SUPER, "n".into())],
args: &[],
@@ -875,7 +1023,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_empty_window"),
},
ClearScrollback(ScrollbackEraseMode::ScrollbackOnly) => CommandDef {
- brief: "Clear scrollback".into(),
+ brief: tr("command-clear-scrollback").into(),
doc: "Clears any text that has scrolled out of the \
viewport of the current pane"
.into(),
@@ -885,7 +1033,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_clear_all"),
},
ClearScrollback(ScrollbackEraseMode::ScrollbackAndViewport) => CommandDef {
- brief: "Clear the scrollback and viewport".into(),
+ brief: tr("command-clear-the-scrollback-and-viewport").into(),
doc: "Removes all content from the screen and scrollback".into(),
keys: vec![],
args: &[ArgType::ActivePane],
@@ -893,7 +1041,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_clear_all"),
},
Search(Pattern::CurrentSelectionOrEmptyString) => CommandDef {
- brief: "Search pane output".into(),
+ brief: tr("command-search-pane-output").into(),
doc: "Enters the search mode UI for the current pane".into(),
keys: vec![(Modifiers::SUPER, "f".into())],
args: &[ArgType::ActivePane],
@@ -901,7 +1049,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("oct_search"),
},
Search(_) => CommandDef {
- brief: "Search pane output".into(),
+ brief: tr("command-search-pane-output").into(),
doc: "Enters the search mode UI for the current pane".into(),
keys: vec![],
args: &[ArgType::ActivePane],
@@ -909,7 +1057,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("oct_search"),
},
ShowDebugOverlay => CommandDef {
- brief: "Show debug overlay".into(),
+ brief: tr("command-show-debug-overlay").into(),
doc: "Activates the debug overlay and Lua REPL".into(),
keys: vec![(Modifiers::CTRL.union(Modifiers::SHIFT), "l".into())],
args: &[ArgType::ActiveWindow],
@@ -917,7 +1065,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_debug"),
},
InputSelector(_) => CommandDef {
- brief: "Prompt the user to choose from a list".into(),
+ brief: tr("command-prompt-the-user-to-choose-from-a-list").into(),
doc: "Activates the selector overlay and wait for input".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -925,7 +1073,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
Confirmation(_) => CommandDef {
- brief: "Prompt the user for confirmation".into(),
+ brief: tr("command-prompt-the-user-for-confirmation").into(),
doc: "Activates the confirmation overlay and wait for input".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -933,7 +1081,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
PromptInputLine(_) => CommandDef {
- brief: "Prompt the user for a line of text".into(),
+ brief: tr("command-prompt-the-user-for-a-line-of-text").into(),
doc: "Activates the prompt overlay and wait for input".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -941,7 +1089,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
PromptRenameTab => CommandDef {
- brief: "Rename Tab".into(),
+ brief: tr("command-rename-tab").into(),
doc: "Prompts for a new title for the current tab".into(),
keys: vec![],
args: &[ArgType::ActiveTab],
@@ -949,7 +1097,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_edit"),
},
PromptRenamePaneTab(_) => CommandDef {
- brief: "Rename Pane Tab".into(),
+ brief: tr("command-rename-pane-tab").into(),
doc: "Prompts for a new title for the pane-local tab".into(),
keys: vec![],
args: &[ArgType::ActivePane],
@@ -957,7 +1105,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_edit"),
},
PromptRenameProject(_) => CommandDef {
- brief: "Rename Workspace".into(),
+ brief: tr("command-rename-workspace").into(),
doc: "Prompts for a new name for the ThinkTerm workspace".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -965,7 +1113,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_edit"),
},
RevealProjectInFolder(_) => CommandDef {
- brief: "Reveal in Folder".into(),
+ brief: tr("command-reveal-in-folder").into(),
doc: "Reveals the ThinkTerm workspace folder in the system file manager".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -973,7 +1121,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_folder_open"),
},
GrantProjectFolderAccess(_) => CommandDef {
- brief: "Grant Folder Access".into(),
+ brief: tr("command-grant-folder-access").into(),
doc: "Asks macOS to grant ThinkTerm access to the Project folder, then opens the Project".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -981,7 +1129,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_folder_open"),
},
OpenFileWith { .. } => CommandDef {
- brief: "Open File With Application".into(),
+ brief: tr("command-open-file-with-application").into(),
doc: "Opens a file with a selected application".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -989,7 +1137,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_open_in_new"),
},
OpenFileWithSystemDefault(_) => CommandDef {
- brief: "Open File".into(),
+ brief: tr("command-open-file").into(),
doc: "Opens a file with the system default application".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -997,7 +1145,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_open_in_new"),
},
PickOpenFileWithApp(_) => CommandDef {
- brief: "Open File With Other Application".into(),
+ brief: tr("command-open-file-with-other-application").into(),
doc: "Prompts for an application to open a file with".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1005,7 +1153,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_open_in_new"),
},
RevealFileInFolder(_) => CommandDef {
- brief: "Reveal File in Folder".into(),
+ brief: tr("command-reveal-file-in-folder").into(),
doc: "Reveals a file in the system file manager".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1013,7 +1161,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_folder_open"),
},
RenameSidebarFile(_) => CommandDef {
- brief: "Rename File".into(),
+ brief: tr("command-rename-file").into(),
doc: "Renames a file from the sidebar file list".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1021,7 +1169,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_edit"),
},
TrashSidebarFile(_) => CommandDef {
- brief: "Move File to Trash".into(),
+ brief: tr("command-move-file-to-trash").into(),
doc: "Moves a file from the sidebar file list to the system trash".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1029,7 +1177,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_delete"),
},
CopyFilePathToClipboard(_) => CommandDef {
- brief: "Copy File Path".into(),
+ brief: tr("command-copy-file-path").into(),
doc: "Copies a file path to the clipboard".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1037,7 +1185,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_content_copy"),
},
PromptRenameWorkspaceThread(_) => CommandDef {
- brief: "Rename Thread".into(),
+ brief: tr("command-rename-thread").into(),
doc: "Prompts for a new name for the ThinkTerm thread".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1045,7 +1193,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_edit"),
},
PromptRenameSpace(_) => CommandDef {
- brief: "Rename Space".into(),
+ brief: tr("command-rename-space").into(),
doc: "Prompts for a new name for the ThinkTerm space".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1053,7 +1201,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_edit"),
},
CreateSpace => CommandDef {
- brief: "New Space".into(),
+ brief: tr("command-new-space").into(),
doc: "Creates a new ThinkTerm space".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1061,7 +1209,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_add"),
},
CreateSpaceOnDomain(_) => CommandDef {
- brief: "New Space Here".into(),
+ brief: tr("command-new-space-here").into(),
doc: "Creates a new ThinkTerm space on this mux server".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1069,7 +1217,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_add"),
},
SwitchSpace(_) => CommandDef {
- brief: "Switch Space".into(),
+ brief: tr("command-switch-space").into(),
doc: "Switches the active ThinkTerm space for this window".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1077,7 +1225,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
DeleteSpace(_) => CommandDef {
- brief: "Delete Space".into(),
+ brief: tr("command-delete-space").into(),
doc: "Deletes a ThinkTerm space and its workspace/thread records".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1085,7 +1233,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_delete"),
},
DeleteSpaceEverywhere(_) => CommandDef {
- brief: "Delete Space Everywhere".into(),
+ brief: tr("command-delete-space-everywhere").into(),
doc: "Deletes the Space on the mux server that hosts it, so it \
disappears from every device"
.into(),
@@ -1095,7 +1243,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_delete"),
},
DeleteSpaceAndRemoteSessions(_) => CommandDef {
- brief: "Delete Space & End Remote Sessions".into(),
+ brief: tr("command-delete-space-end-remote-sessions").into(),
doc: "Kills the Space's sessions on the remote mux server, then \
deletes the Space everywhere"
.into(),
@@ -1105,7 +1253,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_delete"),
},
CreateWorkspaceThread(_) => CommandDef {
- brief: "New Thread".into(),
+ brief: tr("command-new-thread").into(),
doc: "Creates a new ThinkTerm thread for the workspace".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1113,7 +1261,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_add"),
},
ToggleWorkspaceThreadsCollapsed(_) => CommandDef {
- brief: "Collapse or Expand Threads".into(),
+ brief: tr("command-collapse-or-expand-threads").into(),
doc: "Toggles the ThinkTerm workspace thread list".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1121,7 +1269,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
RemoveProject(_) => CommandDef {
- brief: "Remove Workspace".into(),
+ brief: tr("command-remove-workspace").into(),
doc: "Removes the ThinkTerm workspace from the sidebar".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1129,7 +1277,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_delete"),
},
ArchiveProject(_) => CommandDef {
- brief: "Archive Workspace".into(),
+ brief: tr("command-archive-workspace").into(),
doc: "Closes the workspace's panes and hides it from the sidebar; \
its threads and layouts are kept for unarchiving"
.into(),
@@ -1139,7 +1287,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
UnarchiveProject(_) => CommandDef {
- brief: "Unarchive Workspace".into(),
+ brief: tr("command-unarchive-workspace").into(),
doc: "Restores an archived workspace to the sidebar".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1147,7 +1295,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ArchiveActiveProject => CommandDef {
- brief: "Archive Active Workspace".into(),
+ brief: tr("command-archive-active-workspace").into(),
doc: "Closes the active workspace's panes and hides it from the \
sidebar; its threads and layouts are kept for unarchiving"
.into(),
@@ -1157,7 +1305,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ToggleShowArchivedProjects => CommandDef {
- brief: "Show Archived Workspaces".into(),
+ brief: tr("command-show-archived-workspaces").into(),
doc: "Reveals archived workspaces at the bottom of the sidebar \
until toggled off or the window closes"
.into(),
@@ -1167,7 +1315,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ConnectWorkspaceThread(_) => CommandDef {
- brief: "Connect Thread".into(),
+ brief: tr("command-connect-thread").into(),
doc: "Connects or reconnects the ThinkTerm remote thread".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1175,7 +1323,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
DisconnectWorkspaceThread(_) => CommandDef {
- brief: "Disconnect Thread".into(),
+ brief: tr("command-disconnect-thread").into(),
doc: "Disconnects the remote session while keeping the ThinkTerm thread".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1183,7 +1331,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ToggleWorkspaceThreadPinned(_) => CommandDef {
- brief: "Pin Thread".into(),
+ brief: tr("command-pin-thread").into(),
doc: "Toggles the pinned state for the ThinkTerm thread".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1191,7 +1339,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
DeleteWorkspaceThread(_) => CommandDef {
- brief: "Delete Thread".into(),
+ brief: tr("command-delete-thread").into(),
doc: "Deletes the ThinkTerm thread from the thread store".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1199,7 +1347,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
MarkWorkspaceThreadUnread(_) => CommandDef {
- brief: "Mark Thread as Unread".into(),
+ brief: tr("command-mark-thread-as-unread").into(),
doc: "Marks the ThinkTerm thread as unread".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1207,7 +1355,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
QuickSelect => CommandDef {
- brief: "Enter QuickSelect mode".into(),
+ brief: tr("command-enter-quickselect-mode").into(),
doc: "Activates the quick selection UI for the current pane".into(),
keys: vec![(Modifiers::CTRL.union(Modifiers::SHIFT), "Space".into())],
args: &[ArgType::ActivePane],
@@ -1215,7 +1363,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
QuickSelectArgs(_) => CommandDef {
- brief: "Enter QuickSelect mode".into(),
+ brief: tr("command-enter-quickselect-mode").into(),
doc: "Activates the quick selection UI for the current pane".into(),
keys: vec![],
args: &[ArgType::ActivePane],
@@ -1223,7 +1371,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
CharSelect(_) => CommandDef {
- brief: "Enter Emoji / Character selection mode".into(),
+ brief: tr("command-enter-emoji-character-selection-mode").into(),
doc: "Activates the character selection UI for the current pane".into(),
keys: vec![(Modifiers::CTRL.union(Modifiers::SHIFT), "u".into())],
args: &[ArgType::ActivePane],
@@ -1234,7 +1382,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
mode: PaneSelectMode::Activate,
..
}) => CommandDef {
- brief: "Enter Pane selection mode".into(),
+ brief: tr("command-enter-pane-selection-mode").into(),
doc: "Activates the pane selection UI".into(),
keys: vec![], // FIXME: find a new assignment
args: &[ArgType::ActivePane],
@@ -1245,7 +1393,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
mode: PaneSelectMode::SwapWithActive,
..
}) => CommandDef {
- brief: "Swap a pane with the active pane".into(),
+ brief: tr("command-swap-a-pane-with-the-active-pane").into(),
doc: "Activates the pane selection UI".into(),
keys: vec![], // FIXME: find a new assignment
args: &[ArgType::ActivePane],
@@ -1256,7 +1404,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
mode: PaneSelectMode::SwapWithActiveKeepFocus,
..
}) => CommandDef {
- brief: "Swap a pane with the active pane, keeping focus".into(),
+ brief: tr("command-swap-a-pane-with-the-active-pane-keeping-focus").into(),
doc: "Activates the pane selection UI".into(),
keys: vec![], // FIXME: find a new assignment
args: &[ArgType::ActivePane],
@@ -1267,7 +1415,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
mode: PaneSelectMode::MoveToNewTab,
..
}) => CommandDef {
- brief: "Move a pane into its own tab".into(),
+ brief: tr("command-move-a-pane-into-its-own-tab").into(),
doc: "Activates the pane selection UI".into(),
keys: vec![], // FIXME: find a new assignment
args: &[ArgType::ActivePane],
@@ -1278,7 +1426,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
mode: PaneSelectMode::MoveToNewWindow,
..
}) => CommandDef {
- brief: "Move a pane into its own window".into(),
+ brief: tr("command-move-a-pane-into-its-own-window").into(),
doc: "Activates the pane selection UI".into(),
keys: vec![], // FIXME: find a new assignment
args: &[ArgType::ActivePane],
@@ -1286,7 +1434,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_multiple_windows"),
},
DecreaseFontSize => CommandDef {
- brief: "Decrease font size".into(),
+ brief: tr("command-decrease-font-size").into(),
doc: "Scales the font size smaller by 10%".into(),
keys: vec![
(Modifiers::SUPER, "-".into()),
@@ -1297,7 +1445,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_format_size"),
},
IncreaseFontSize => CommandDef {
- brief: "Increase font size".into(),
+ brief: tr("command-increase-font-size").into(),
doc: "Scales the font size larger by 10%".into(),
keys: vec![
(Modifiers::SUPER, "=".into()),
@@ -1308,7 +1456,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_format_size"),
},
ResetFontSize => CommandDef {
- brief: "Reset font size".into(),
+ brief: tr("command-reset-font-size").into(),
doc: "Restores the font size to match your configuration file".into(),
keys: vec![
(Modifiers::SUPER, "0".into()),
@@ -1319,7 +1467,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_format_size"),
},
ResetFontAndWindowSize => CommandDef {
- brief: "Reset the window and font size".into(),
+ brief: tr("command-reset-the-window-and-font-size").into(),
doc: "Restores the original window and font size".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1327,7 +1475,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_format_size"),
},
SpawnTabToRight(_) => CommandDef {
- brief: "New Terminal Tab to Right".into(),
+ brief: tr("command-new-terminal-tab-to-right").into(),
doc: "Create a new tab immediately to the right of the current tab".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1335,7 +1483,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_tab_plus"),
},
SpawnTab(SpawnTabDomain::CurrentPaneDomain) => CommandDef {
- brief: "New Tab".into(),
+ brief: tr("command-new-tab").into(),
doc: "Create a new tab in the same domain as the current pane".into(),
keys: vec![(Modifiers::SUPER, "t".into())],
args: &[ArgType::ActiveWindow],
@@ -1343,7 +1491,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_tab_plus"),
},
SpawnTab(SpawnTabDomain::DefaultDomain) => CommandDef {
- brief: "New Tab (Default Domain)".into(),
+ brief: tr("command-new-tab-default-domain").into(),
doc: "Create a new tab in the default domain".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1387,7 +1535,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_open_in_new"),
},
ActivateTab(-1) => CommandDef {
- brief: "Activate right-most tab".into(),
+ brief: tr("command-activate-right-most-tab").into(),
doc: "Activates the tab on the far right".into(),
keys: vec![(Modifiers::SUPER, "9".into())],
args: &[ArgType::ActiveWindow],
@@ -1403,7 +1551,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
vec![]
};
CommandDef {
- brief: format!("Activate {ordinal} Tab").into(),
+ brief: counted("command-activate-tab", n as i64 + 1, Some(&ordinal)).into(),
doc: format!("Activates the {ordinal} tab").into(),
keys,
args: &[ArgType::ActiveWindow],
@@ -1456,7 +1604,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
CloseCurrentTab { confirm: true } => CommandDef {
- brief: "Close current Tab".into(),
+ brief: tr("command-close-current-tab").into(),
doc: "Closes the current tab, terminating all the \
processes that are running in its panes."
.into(),
@@ -1466,7 +1614,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_close_box_outline"),
},
CloseCurrentTab { confirm: false } => CommandDef {
- brief: "Close current Tab".into(),
+ brief: tr("command-close-current-tab").into(),
doc: "Closes the current tab, terminating all the \
processes that are running in its panes."
.into(),
@@ -1476,7 +1624,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_close_box_outline"),
},
CloseCurrentPane { confirm: true } => CommandDef {
- brief: "Close current Pane".into(),
+ brief: tr("command-close-current-pane").into(),
doc: "Closes the current pane, terminating the \
processes that are running inside it."
.into(),
@@ -1486,7 +1634,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_close_box_outline"),
},
CloseCurrentPane { confirm: false } => CommandDef {
- brief: "Close current Pane".into(),
+ brief: tr("command-close-current-pane").into(),
doc: "Closes the current pane, terminating the \
processes that are running inside it."
.into(),
@@ -1499,7 +1647,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
let n = *n;
let ordinal = english_ordinal(n as isize + 1);
CommandDef {
- brief: format!("Activate {ordinal} Window").into(),
+ brief: counted("command-activate-window", n as i64 + 1, Some(&ordinal)).into(),
doc: format!("Activates the {ordinal} window").into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1508,7 +1656,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
}
}
ActivateWindowRelative(-1) => CommandDef {
- brief: "Activate the preceeding window".into(),
+ brief: tr("command-activate-the-preceeding-window").into(),
doc: "Activates the preceeding window. If this is the first \
window then cycles around and activates last window"
.into(),
@@ -1518,7 +1666,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ActivateWindowRelative(1) => CommandDef {
- brief: "Activate the next window".into(),
+ brief: tr("command-activate-the-next-window").into(),
doc: "Activates the next window. If this is the last \
window then cycles around and activates first window"
.into(),
@@ -1548,7 +1696,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
}
}
ActivateWindowRelativeNoWrap(-1) => CommandDef {
- brief: "Activate the preceeding window".into(),
+ brief: tr("command-activate-the-preceeding-window").into(),
doc: "Activates the preceeding window, stopping at the first \
window"
.into(),
@@ -1558,7 +1706,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ActivateWindowRelativeNoWrap(1) => CommandDef {
- brief: "Activate the next window".into(),
+ brief: tr("command-activate-the-next-window").into(),
doc: "Activates the next window, stopping at the last \
window"
.into(),
@@ -1584,7 +1732,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
}
}
ActivateTabRelative(-1) => CommandDef {
- brief: "Activate the tab to the left".into(),
+ brief: tr("command-activate-the-tab-to-the-left").into(),
doc: "Activates the tab to the left. If this is the left-most \
tab then cycles around and activates the right-most tab"
.into(),
@@ -1598,7 +1746,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ActivateTabRelative(1) => CommandDef {
- brief: "Activate the tab to the right".into(),
+ brief: tr("command-activate-the-tab-to-the-right").into(),
doc: "Activates the tab to the right. If this is the right-most \
tab then cycles around and activates the left-most tab"
.into(),
@@ -1628,7 +1776,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
}
}
ActivateTabRelativeNoWrap(-1) => CommandDef {
- brief: "Activate the tab to the left (no wrapping)".into(),
+ brief: tr("command-activate-the-tab-to-the-left-no-wrapping").into(),
doc: "Activates the tab to the left. Stopping at the left-most tab".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1636,7 +1784,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ActivateTabRelativeNoWrap(1) => CommandDef {
- brief: "Activate the tab to the right (no wrapping)".into(),
+ brief: tr("command-activate-the-tab-to-the-right-no-wrapping").into(),
doc: "Activates the tab to the right. Stopping at the right-most tab".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1656,7 +1804,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
}
}
ReloadConfiguration => CommandDef {
- brief: "Reload configuration".into(),
+ brief: tr("command-reload-configuration").into(),
doc: "Reloads the configuration file".into(),
keys: vec![(Modifiers::SUPER, "r".into())],
args: &[],
@@ -1664,7 +1812,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_reload"),
},
QuitApplication => CommandDef {
- brief: "Quit ThinkTerm".into(),
+ brief: tr("command-quit-thinkterm").into(),
doc: "Quits ThinkTerm".into(),
keys: vec![(Modifiers::SUPER, "q".into())],
args: &[],
@@ -1672,7 +1820,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("oct_stop"),
},
MoveTabRelative(-1) => CommandDef {
- brief: "Move tab one place to the left".into(),
+ brief: tr("command-move-tab-one-place-to-the-left").into(),
doc: "Rearranges the tabs so that the current tab moves \
one place to the left"
.into(),
@@ -1682,7 +1830,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("fa_long_arrow_left"),
},
MoveTabRelative(1) => CommandDef {
- brief: "Move tab one place to the right".into(),
+ brief: tr("command-move-tab-one-place-to-the-right").into(),
doc: "Rearranges the tabs so that the current tab moves \
one place to the right"
.into(),
@@ -1730,7 +1878,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
let amount = amount.into_inner();
if amount == -1.0 {
CommandDef {
- brief: "Scroll Up One Page".into(),
+ brief: tr("command-scroll-up-one-page").into(),
doc: "Scrolls the viewport up by 1 page".into(),
keys: vec![(Modifiers::SHIFT, "PageUp".into())],
args: &[ArgType::ActivePane],
@@ -1739,7 +1887,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
}
} else if amount == 1.0 {
CommandDef {
- brief: "Scroll Down One Page".into(),
+ brief: tr("command-scroll-down-one-page").into(),
doc: "Scrolls the viewport down by 1 page".into(),
keys: vec![(Modifiers::SHIFT, "PageDown".into())],
args: &[ArgType::ActivePane],
@@ -1815,7 +1963,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ScrollToBottom => CommandDef {
- brief: "Scroll to the bottom".into(),
+ brief: tr("command-scroll-to-the-bottom").into(),
doc: "Scrolls to the bottom of the viewport".into(),
keys: vec![],
args: &[ArgType::ActivePane],
@@ -1823,7 +1971,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_format_align_bottom"),
},
ScrollToTop => CommandDef {
- brief: "Scroll to the top".into(),
+ brief: tr("command-scroll-to-the-top").into(),
doc: "Scrolls to the top of the viewport".into(),
keys: vec![],
args: &[ArgType::ActivePane],
@@ -1831,7 +1979,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_format_align_top"),
},
ActivateCopyMode => CommandDef {
- brief: "Activate Copy Mode".into(),
+ brief: tr("command-activate-copy-mode").into(),
doc: "Enter mouse-less copy mode to select text using only \
the keyboard"
.into(),
@@ -1844,7 +1992,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
domain: SpawnTabDomain::CurrentPaneDomain,
..
}) => CommandDef {
- brief: label_string(action, "Split Vertically (Top/Bottom)".to_string()).into(),
+ brief: label_string(action, tr("command-split-vertically")).into(),
doc: "Split the current pane vertically into two panes, by spawning \
the default program into the bottom half"
.into(),
@@ -1862,7 +2010,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
domain: SpawnTabDomain::CurrentPaneDomain,
..
}) => CommandDef {
- brief: label_string(action, "Split Horizontally (Left/Right)".to_string()).into(),
+ brief: label_string(action, tr("command-split-horizontally")).into(),
doc: "Split the current pane horizontally into two panes, by spawning \
the default program into the right hand side"
.into(),
@@ -1877,7 +2025,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_split_horizontal"),
},
SplitHorizontal(_) => CommandDef {
- brief: label_string(action, "Split Horizontally (Left/Right)".to_string()).into(),
+ brief: label_string(action, tr("command-split-horizontally")).into(),
doc: "Split the current pane horizontally into two panes, by spawning \
the default program into the right hand side"
.into(),
@@ -1887,7 +2035,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_split_horizontal"),
},
SplitVertical(_) => CommandDef {
- brief: label_string(action, "Split Vertically (Top/Bottom)".to_string()).into(),
+ brief: label_string(action, tr("command-split-vertically")).into(),
doc: "Split the current pane veritically into two panes, by spawning \
the default program into the bottom"
.into(),
@@ -1897,7 +2045,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_split_vertical"),
},
AdjustPaneSize(PaneDirection::Left, amount) => CommandDef {
- brief: format!("Resize Pane {amount} cell(s) to the Left").into(),
+ brief: counted("command-resize-pane-left", *amount as i64, None).into(),
doc: "Adjusts the closest split divider to the left".into(),
keys: vec![(
Modifiers::CTRL
@@ -1910,7 +2058,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
AdjustPaneSize(PaneDirection::Right, amount) => CommandDef {
- brief: format!("Resize Pane {amount} cell(s) to the Right").into(),
+ brief: counted("command-resize-pane-right", *amount as i64, None).into(),
doc: "Adjusts the closest split divider to the right".into(),
keys: vec![(
Modifiers::CTRL
@@ -1923,7 +2071,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
AdjustPaneSize(PaneDirection::Up, amount) => CommandDef {
- brief: format!("Resize Pane {amount} cell(s) Upwards").into(),
+ brief: counted("command-resize-pane-up", *amount as i64, None).into(),
doc: "Adjusts the closest split divider towards the top".into(),
keys: vec![(
Modifiers::CTRL
@@ -1936,7 +2084,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
AdjustPaneSize(PaneDirection::Down, amount) => CommandDef {
- brief: format!("Resize Pane {amount} cell(s) Downwards").into(),
+ brief: counted("command-resize-pane-down", *amount as i64, None).into(),
doc: "Adjusts the closest split divider towards the bottom".into(),
keys: vec![(
Modifiers::CTRL
@@ -1951,7 +2099,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
AdjustPaneSize(PaneDirection::Next | PaneDirection::Prev, _) => return None,
ActivatePaneDirection(PaneDirection::Next | PaneDirection::Prev) => return None,
ActivatePaneDirection(PaneDirection::Left) => CommandDef {
- brief: "Activate Pane Left".into(),
+ brief: tr("command-activate-pane-left").into(),
doc: "Activates the pane to the left of the current pane".into(),
keys: vec![(Modifiers::CTRL.union(Modifiers::SHIFT), "LeftArrow".into())],
args: &[ArgType::ActivePane],
@@ -1959,7 +2107,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("fa_long_arrow_left"),
},
ActivatePaneDirection(PaneDirection::Right) => CommandDef {
- brief: "Activate Pane Right".into(),
+ brief: tr("command-activate-pane-right").into(),
doc: "Activates the pane to the right of the current pane".into(),
keys: vec![(Modifiers::CTRL.union(Modifiers::SHIFT), "RightArrow".into())],
args: &[ArgType::ActivePane],
@@ -1967,7 +2115,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("fa_long_arrow_right"),
},
ActivatePaneDirection(PaneDirection::Up) => CommandDef {
- brief: "Activate Pane Up".into(),
+ brief: tr("command-activate-pane-up").into(),
doc: "Activates the pane to the top of the current pane".into(),
keys: vec![(Modifiers::CTRL.union(Modifiers::SHIFT), "UpArrow".into())],
args: &[ArgType::ActivePane],
@@ -1975,7 +2123,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("fa_long_arrow_up"),
},
ActivatePaneDirection(PaneDirection::Down) => CommandDef {
- brief: "Activate Pane Down".into(),
+ brief: tr("command-activate-pane-down").into(),
doc: "Activates the pane to the bottom of the current pane".into(),
keys: vec![(Modifiers::CTRL.union(Modifiers::SHIFT), "DownArrow".into())],
args: &[ArgType::ActivePane],
@@ -1983,7 +2131,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("fa_long_arrow_down"),
},
TogglePaneZoomState => CommandDef {
- brief: "Toggle Pane Zoom".into(),
+ brief: tr("command-toggle-pane-zoom").into(),
doc: "Toggles the zoom state for the current pane".into(),
keys: vec![(Modifiers::CTRL.union(Modifiers::SHIFT), "z".into())],
args: &[ArgType::ActivePane],
@@ -1991,7 +2139,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_fullscreen"),
},
ActivateLastTab => CommandDef {
- brief: "Activate the last active tab".into(),
+ brief: tr("command-activate-the-last-active-tab").into(),
doc: "If there was no prior active tab, has no effect.".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -1999,7 +2147,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ClearKeyTableStack => CommandDef {
- brief: "Clear the key table stack".into(),
+ brief: tr("command-clear-the-key-table-stack").into(),
doc: "Removes all entries from the stack".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -2007,7 +2155,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
OpenLinkAtMouseCursor => CommandDef {
- brief: "Open link at mouse cursor".into(),
+ brief: tr("command-open-link-at-mouse-cursor").into(),
doc: "If there is no link under the mouse cursor, has no effect.".into(),
keys: vec![],
args: &[ArgType::ActivePane],
@@ -2015,7 +2163,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ShowLauncherArgs(_) | ShowLauncher => CommandDef {
- brief: "Show the launcher".into(),
+ brief: tr("command-show-the-launcher").into(),
doc: "Shows the launcher menu".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -2023,7 +2171,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ShowTabNavigator => CommandDef {
- brief: "Navigate tabs".into(),
+ brief: tr("command-navigate-tabs").into(),
doc: "Shows the tab navigator".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -2031,7 +2179,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("cod_list_flat"),
},
DetachDomain(SpawnTabDomain::CurrentPaneDomain) => CommandDef {
- brief: "Detach the domain of the active pane".into(),
+ brief: tr("command-detach-the-domain-of-the-active-pane").into(),
doc: "Detaches (disconnects from) the domain of the active pane".into(),
keys: vec![],
args: &[ArgType::ActivePane],
@@ -2039,7 +2187,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_pipe_disconnected"),
},
DetachDomain(SpawnTabDomain::DefaultDomain) => CommandDef {
- brief: "Detach the default domain".into(),
+ brief: tr("command-detach-the-default-domain").into(),
doc: "Detaches (disconnects from) the default domain".into(),
keys: vec![],
args: &[ArgType::ActivePane],
@@ -2064,7 +2212,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
},
OpenUri(uri) => match uri.as_ref() {
"https://github.com/RoversX/thinkterm" => CommandDef {
- brief: "Documentation".into(),
+ brief: tr("command-documentation").into(),
doc: "Visit the ThinkTerm project page".into(),
keys: vec![],
args: &[],
@@ -2072,7 +2220,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_help"),
},
"https://github.com/RoversX/thinkterm/discussions/" => CommandDef {
- brief: "Discuss on GitHub".into(),
+ brief: tr("command-discuss-on-github").into(),
doc: "Visit ThinkTerm's GitHub discussions".into(),
keys: vec![],
args: &[],
@@ -2080,7 +2228,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("oct_comment_discussion"),
},
"https://github.com/RoversX/thinkterm/issues/" => CommandDef {
- brief: "Search or report issue on GitHub".into(),
+ brief: tr("command-search-or-report-issue-on-github").into(),
doc: "Visit ThinkTerm's GitHub issues".into(),
keys: vec![],
args: &[],
@@ -2129,7 +2277,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_keyboard_variant"),
},
Nop => CommandDef {
- brief: "Does nothing".into(),
+ brief: tr("command-does-nothing").into(),
doc: "Has no effect".into(),
keys: vec![],
args: &[],
@@ -2173,7 +2321,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ClearSelection => CommandDef {
- brief: "Clears the selection in the current pane".into(),
+ brief: tr("command-clears-the-selection-in-the-current-pane").into(),
doc: "Clears the selection in the current pane".into(),
keys: vec![],
args: &[],
@@ -2341,7 +2489,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
PopKeyTable => CommandDef {
- brief: "Pop the current key table".into(),
+ brief: tr("command-pop-the-current-key-table").into(),
doc: "Pop the current key table".into(),
keys: vec![],
args: &[ArgType::ActivePane],
@@ -2365,7 +2513,11 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
RotatePanes(direction) => CommandDef {
- brief: format!("Rotate panes {direction:?}").into(),
+ brief: match direction {
+ RotationDirection::Clockwise => tr("command-rotate-panes-clockwise"),
+ RotationDirection::CounterClockwise => tr("command-rotate-panes-counter-clockwise"),
+ }
+ .into(),
doc: format!("Rotate panes {direction:?}").into(),
keys: vec![],
args: &[ArgType::ActivePane],
@@ -2391,7 +2543,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
}
}
ResetTerminal => CommandDef {
- brief: "Reset the terminal emulation state in the current pane".into(),
+ brief: tr("command-reset-the-terminal-emulation-state-in-the-current-pane").into(),
doc: "Reset the terminal emulation state in the current pane".into(),
keys: vec![],
args: &[ArgType::ActivePane],
@@ -2399,7 +2551,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: None,
},
ActivateCommandPalette => CommandDef {
- brief: "Activate Command Palette".into(),
+ brief: tr("command-activate-command-palette").into(),
doc: "Shows the command palette modal".into(),
keys: vec![
(Modifiers::CTRL.union(Modifiers::SHIFT), "p".into()),
@@ -2430,7 +2582,7 @@ pub fn derive_command_from_key_assignment(action: &KeyAssignment) -> Option<Comm
icon: Some("md_palette"),
},
ActivateWorkspaceThread { .. } => CommandDef {
- brief: "Open thread".into(),
+ brief: tr("command-open-thread").into(),
doc: "Switch to a saved thread, changing Space when needed".into(),
keys: vec![],
args: &[ArgType::ActiveWindow],
@@ -2588,3 +2740,13 @@ fn compute_default_actions() -> Vec<KeyAssignment> {
OpenLinkAtMouseCursor,
];
}
+
+#[cfg(test)]
+mod tests {
+ #[test]
+ fn every_menu_title_has_an_english_text() {
+ for (_, id) in super::MENU_TITLES {
+ assert!(thinkterm_i18n::has_key(id), "{} has no en-US text", id);
+ }
+ }
+}
diff --git a/wezterm-gui/src/download.rs b/wezterm-gui/src/download.rs
index 181b3ae3..527de880 100644
--- a/wezterm-gui/src/download.rs
+++ b/wezterm-gui/src/download.rs
@@ -73,9 +73,11 @@ pub fn save_to_downloads(orig_name: Option<String>, data: &[u8]) -> anyhow::Resu
.with_context(|| format!("writing {} of data to {}", data.len(), name.display()))?;
let url = format!("file://{}", name.display());
+ let mut args = fluent_bundle::FluentArgs::new();
+ args.set("path", name.display().to_string());
wezterm_toast_notification::persistent_toast_notification_with_click_to_open_url(
- "Download completed",
- &format!("Downloaded {}", name.display()),
+ &crate::i18n::tr("download-completed"),
+ &crate::i18n::tr_args("download-completed-body", &args),
&url,
);
diff --git a/wezterm-gui/src/i18n.rs b/wezterm-gui/src/i18n.rs
index f7eae248..a9595ce7 100644
--- a/wezterm-gui/src/i18n.rs
+++ b/wezterm-gui/src/i18n.rs
@@ -5,8 +5,8 @@
use crate::native_settings::{NativeLanguagePreference, ThinkTermNativeSettings};
pub(crate) use thinkterm_i18n::{
- current_locale, language_option_label, tr, tr_args, LanguageOption, LANGUAGE_OPTIONS,
- SYSTEM_PREFERENCE,
+ current_locale, in_english, language_option_label, tr, tr_args, LanguageOption,
+ LANGUAGE_OPTIONS, SYSTEM_PREFERENCE,
};
fn legacy_preference(language: NativeLanguagePreference) -> &'static str {
@@ -42,7 +42,17 @@ pub(crate) fn install() {
}
pub(crate) fn activate_preference(preference: &str) -> &'static str {
- thinkterm_i18n::activate_preference(preference, &system_locales())
+ let before = current_locale();
+ let locale = thinkterm_i18n::activate_preference(preference, &system_locales());
+ if locale != before {
+ // Windows repaint in the new language; the menu bar is built once
+ // and has to be told.
+ promise::spawn::spawn_into_main_thread(async {
+ crate::commands::CommandDef::recreate_menubar(&config::configuration());
+ })
+ .detach();
+ }
+ locale
}
pub(crate) fn activate_from_settings(settings: &ThinkTermNativeSettings) -> &'static str {
@@ -117,22 +127,36 @@ mod tests {
continue;
}
let text = std::fs::read_to_string(&path).expect("source readable");
- for (idx, _) in text.match_indices("tr(") {
- // Covers tr and the *_tr helpers: all funnel through a
- // fluent key as the first argument. Anything else whose
- // name merely ends in "tr" (push_str, …) is skipped by
- // requiring the identifier to be tr or *_tr. The key
- // may sit on the next line, so whitespace between the
- // paren and the literal is skipped.
+ for (needle, idx) in ["tr(", "tr_args(", "named(", "counted("]
+ .iter()
+ .copied()
+ .flat_map(|needle| {
+ text.match_indices(needle)
+ .map(move |(idx, _)| (needle, idx))
+ })
+ {
+ // Covers tr and the *_tr helpers, tr_args, and the
+ // command name helpers: all funnel through a fluent key
+ // as the first argument. Anything else whose name merely
+ // ends in "tr" (push_str, …) is skipped by requiring the
+ // identifier to be one of those. The key may sit on the
+ // next line, so whitespace between the paren and the
+ // literal is skipped.
+ let name_end = idx + needle.len() - 1;
let ident_start = text[..idx]
.rfind(|c: char| !(c.is_ascii_alphanumeric() || c == '_'))
.map(|p| p + 1)
.unwrap_or(0);
- let ident = &text[ident_start..idx + 2];
- if ident != "tr" && !ident.ends_with("_tr") {
+ let ident = &text[ident_start..name_end];
+ let wanted = if needle == "tr(" {
+ ident == "tr" || ident.ends_with("_tr")
+ } else {
+ ident == &needle[..needle.len() - 1]
+ };
+ if !wanted {
continue;
}
- let after_paren = &text[idx + 3..];
+ let after_paren = &text[name_end + 1..];
let literal = after_paren.trim_start();
let Some(literal) = literal.strip_prefix('"') else {
continue;
diff --git a/wezterm-gui/src/termwindow/palette.rs b/wezterm-gui/src/termwindow/palette.rs
index 31589ed9..6dcd2ecf 100644
--- a/wezterm-gui/src/termwindow/palette.rs
+++ b/wezterm-gui/src/termwindow/palette.rs
@@ -42,14 +42,14 @@ const MAX_RECENTS: usize = 200;
pub(crate) fn save_recent(command: &ExpandedCommand) -> anyhow::Result<()> {
let mut recents = load_recents().unwrap_or_else(|_| vec![]);
- if let Some(recent_idx) = recents.iter().position(|r| r.brief == command.brief) {
+ if let Some(recent_idx) = recents.iter().position(|r| r.brief == command.recent_key()) {
let recent = recents.get_mut(recent_idx).unwrap();
recent.frecency.register_access();
} else {
let mut frecency = Frecency::new();
frecency.register_access();
recents.push(Recent {
- brief: command.brief.to_string(),
+ brief: command.recent_key().to_string(),
frecency,
});
}
@@ -74,7 +74,7 @@ pub(crate) fn save_recent(command: &ExpandedCommand) -> anyhow::Result<()> {
Ok(())
}
-/// Frecency score per command brief, from `recent-commands.json`. Empty when
+/// Frecency score per `ExpandedCommand::recent_key`, from `recent-commands.json`. Empty when
/// nothing has been recorded yet (or the file is unreadable).
pub(crate) fn frecency_scores() -> HashMap<String, f64> {
let mut scores = HashMap::new();
@@ -132,6 +132,7 @@ pub(crate) fn build_commands(
menubar: &[],
icon: entry.icon.map(Cow::Owned),
accessory: None,
+ english_brief: None,
});
}
}
@@ -151,7 +152,7 @@ pub(crate) fn build_commands(
let scores = frecency_scores();
commands.sort_by(|a, b| {
- match (scores.get(&*a.brief), scores.get(&*b.brief)) {
+ match (scores.get(a.recent_key()), scores.get(b.recent_key())) {
// Want descending frecency score, so swap a<->b
// for the compare here
(Some(a), Some(b)) => match b.partial_cmp(a) {
diff --git a/wezterm-gui/src/termwindow/remote_files.rs b/wezterm-gui/src/termwindow/remote_files.rs
index baddae50..3518ee16 100644
--- a/wezterm-gui/src/termwindow/remote_files.rs
+++ b/wezterm-gui/src/termwindow/remote_files.rs
@@ -669,7 +669,11 @@ pub(crate) trait RemoteFileBackend: Send + Sync {
overwrite: bool,
) -> TransferFuture {
let _ = (local, remote, progress, overwrite);
- Box::pin(async { Err(TransferFailure::new("This connection cannot upload files")) })
+ Box::pin(async {
+ Err(TransferFailure::new(crate::i18n::tr(
+ "remote-files-cannot-upload",
+ )))
+ })
}
/// Create a remote directory, treating "it is already a directory" as
@@ -682,7 +686,7 @@ pub(crate) trait RemoteFileBackend: Send + Sync {
/// told apart from a permission problem.
fn create_directory(&self, remote: RemotePath) -> RemoteFuture<()> {
let _ = remote;
- Box::pin(async { Err("This connection cannot create directories".to_string()) })
+ Box::pin(async { Err(crate::i18n::tr("remote-files-cannot-create-folders")) })
}
/// Fetch `remote` into `local`, returning the number of bytes written.
@@ -694,9 +698,9 @@ pub(crate) trait RemoteFileBackend: Send + Sync {
) -> TransferFuture {
let _ = (remote, local, progress);
Box::pin(async {
- Err(TransferFailure::new(
- "This connection cannot download files",
- ))
+ Err(TransferFailure::new(crate::i18n::tr(
+ "remote-files-cannot-download",
+ )))
})
}
@@ -714,9 +718,9 @@ pub(crate) trait RemoteFileBackend: Send + Sync {
) -> TransferFuture {
let _ = (remote, sink, progress);
Box::pin(async {
- Err(TransferFailure::new(
- "This connection cannot download files",
- ))
+ Err(TransferFailure::new(crate::i18n::tr(
+ "remote-files-cannot-download",
+ )))
})
}
@@ -734,7 +738,7 @@ pub(crate) trait RemoteFileBackend: Send + Sync {
/// `upload_file`: only a backend that can actually delete should claim to.
fn remove_file(&self, remote: RemotePath) -> RemoteFuture<()> {
let _ = remote;
- Box::pin(async { Err("This connection cannot delete files".to_string()) })
+ Box::pin(async { Err(crate::i18n::tr("remote-files-cannot-delete-files")) })
}
/// Delete an EMPTY remote directory. Recursion is the caller's job: the
@@ -742,7 +746,7 @@ pub(crate) trait RemoteFileBackend: Send + Sync {
/// its per-directory round trips and its cancellation points.
fn remove_directory(&self, remote: RemotePath) -> RemoteFuture<()> {
let _ = remote;
- Box::pin(async { Err("This connection cannot delete folders".to_string()) })
+ Box::pin(async { Err(crate::i18n::tr("remote-files-cannot-delete-folders")) })
}
/// Rename `from` to `to` WITHOUT overwriting: a `to` that already exists
@@ -751,7 +755,7 @@ pub(crate) trait RemoteFileBackend: Send + Sync {
/// check followed by a potentially-overwriting rename.
fn rename(&self, from: RemotePath, to: RemotePath) -> RemoteFuture<()> {
let _ = (from, to);
- Box::pin(async { Err("This connection cannot rename".to_string()) })
+ Box::pin(async { Err(crate::i18n::tr("remote-files-cannot-rename")) })
}
/// Create a remote directory, failing if ANYTHING already has that name.
@@ -759,7 +763,7 @@ pub(crate) trait RemoteFileBackend: Send + Sync {
/// "New Folder" must mint something new, never adopt a neighbour.
fn create_directory_exclusive(&self, remote: RemotePath) -> RemoteFuture<()> {
let _ = remote;
- Box::pin(async { Err("This connection cannot create directories".to_string()) })
+ Box::pin(async { Err(crate::i18n::tr("remote-files-cannot-create-folders")) })
}
/// Runs `command`, a line for the remote user's shell, keeping at most
@@ -768,13 +772,13 @@ pub(crate) trait RemoteFileBackend: Send + Sync {
/// default refuses, as the other operations beyond reading do.
fn run(&self, command: String, limit: usize, wait: Duration) -> RemoteFuture<RemoteRun> {
let _ = (command, limit, wait);
- Box::pin(async { Err("This connection cannot run programs".to_string()) })
+ Box::pin(async { Err(crate::i18n::tr("remote-files-cannot-run")) })
}
/// What is at `path`, a link not followed: `None` when nothing is.
fn stat(&self, path: String) -> RemoteFuture<Option<RemoteStat>> {
let _ = path;
- Box::pin(async { Err("This connection cannot look at files".to_string()) })
+ Box::pin(async { Err(crate::i18n::tr("remote-files-cannot-look")) })
}
/// Every file under `root` for search, listed on the remote host by
@@ -808,16 +812,34 @@ const REMOTE_LISTING_GRACE_SECS: u64 = 15;
/// A listing given up on. The remote may ignore the hangup sent after it, in
/// which case its reader stays blocked until the connection goes, so this is
/// not retried as the query changes.
-pub(crate) const REMOTE_LISTING_TIMED_OUT: &str = "The remote file listing timed out";
-const REMOTE_LISTING_EXEC_FAILED: &str = "Unable to run the remote file listing";
-const REMOTE_LISTING_READ_FAILED: &str = "Reading the remote file listing failed";
+/// These three are told apart by their words. A failure is kept while the
+/// language may change, so it is recognized in every language.
+pub(crate) fn remote_listing_timed_out() -> String {
+ crate::i18n::tr("remote-files-listing-timed-out")
+}
+pub(crate) fn remote_listing_is_timed_out(message: &str) -> bool {
+ thinkterm_i18n::tr_every_locale("remote-files-listing-timed-out")
+ .iter()
+ .any(|text| message == text)
+}
+fn remote_listing_failed_with(message: &str, id: &str) -> bool {
+ thinkterm_i18n::tr_every_locale(id)
+ .iter()
+ .any(|text| message.starts_with(text.as_str()))
+}
+fn remote_listing_exec_failed() -> String {
+ crate::i18n::tr("remote-files-listing-exec-failed")
+}
+fn remote_listing_read_failed() -> String {
+ crate::i18n::tr("remote-files-listing-read-failed")
+}
/// Whether a listing failure came from the connection itself rather than
/// from what the remote printed. Only those may retire the pooled connection:
/// the remote's own words, a stray "broken pipe" among them, must not.
pub(crate) fn remote_listing_failure_is_transport(message: &str) -> bool {
- message.starts_with(REMOTE_LISTING_EXEC_FAILED)
- || message.starts_with(REMOTE_LISTING_READ_FAILED)
+ remote_listing_failed_with(message, "remote-files-listing-exec-failed")
+ || remote_listing_failed_with(message, "remote-files-listing-read-failed")
}
/// Quote `value` for a POSIX shell: the command line an ssh exec runs goes
@@ -963,9 +985,11 @@ fn interpret_remote_listing(
}
let detail = stderr.trim();
Err(if detail.is_empty() {
- "The remote host did not return a file listing".to_string()
+ crate::i18n::tr("remote-files-listing-empty")
} else {
- format!("The remote host could not list files: {detail}")
+ let mut args = fluent_bundle::FluentArgs::new();
+ args.set("detail", detail.to_string());
+ crate::i18n::tr_args("remote-files-listing-refused", &args)
})
}
@@ -990,11 +1014,11 @@ fn run_remote_listing(
let read = (&mut stdout)
.take(REMOTE_LISTING_MAX_BYTES + 1)
.read_to_end(&mut out)
- .map_err(|err| format!("{REMOTE_LISTING_READ_FAILED}: {err}"));
+ .map_err(|err| format!("{}: {err}", remote_listing_read_failed()));
if read.is_err() || out.len() as u64 > REMOTE_LISTING_MAX_BYTES {
let _ = child.kill();
drain_remote(stdout);
- let failed = read.and(Err("The remote file listing is too large".to_string()));
+ let failed = read.and(Err(crate::i18n::tr("remote-files-listing-too-large")));
return (failed, true);
}
let err = stderr.join().unwrap_or_default();
@@ -1338,7 +1362,7 @@ impl RemoteFileBackend for SftpRemoteFileBackend {
} = session
.exec(&command, None)
.await
- .map_err(|err| format!("{REMOTE_LISTING_EXEC_FAILED}: {err:#}"))?;
+ .map_err(|err| format!("{}: {err:#}", remote_listing_exec_failed()))?;
// The remote walk stops itself at its time limit, but only between
// entries; one stuck on a dead mount must not hold the search.
let mut killer = portable_pty::ChildKiller::clone_killer(&child);
@@ -1349,7 +1373,7 @@ impl RemoteFileBackend for SftpRemoteFileBackend {
))
.await;
let _ = killer.kill();
- (Err(REMOTE_LISTING_TIMED_OUT.to_string()), true)
+ (Err(remote_listing_timed_out()), true)
};
let (listing, killed) = smol::future::or(listing, timeout).await;
close_remote_exec(stdin, killed);
diff --git a/wezterm-gui/src/termwindow/remote_walk.rs b/wezterm-gui/src/termwindow/remote_walk.rs
index 263133e9..68f9edf6 100644
--- a/wezterm-gui/src/termwindow/remote_walk.rs
+++ b/wezterm-gui/src/termwindow/remote_walk.rs
@@ -293,8 +293,8 @@ async fn plan_remote_walk_with_rules(
.list_directory(dir, remaining.saturating_add(1))
.await?;
if listing.truncated || listing.entries.len() > remaining {
- return Err(format!(
- "That folder holds more than {REMOTE_WALK_ENTRY_LIMIT} items"
+ return Err(crate::termwindow::transfer_walk::too_many_entries(
+ REMOTE_WALK_ENTRY_LIMIT,
));
}
let mut materialized_names = HashSet::new();
@@ -309,13 +309,12 @@ async fn plan_remote_walk_with_rules(
}
if let Some(key) = name_rules.collision_key(&entry.name) {
if !materialized_names.insert(key) {
- return Err(format!(
- "The names in {} collide on this computer",
+ return Err(names_collide(
entry
.path
.parent()
.unwrap_or_else(|| entry.path.clone())
- .as_str()
+ .as_str(),
));
}
}
@@ -358,10 +357,15 @@ async fn plan_remote_walk_with_rules(
}
fn cannot_store_locally(path: &RemotePath) -> String {
- format!(
- "The name of {} cannot be used on this computer",
- path.as_str()
- )
+ let mut args = fluent_bundle::FluentArgs::new();
+ args.set("path", path.as_str().to_string());
+ crate::i18n::tr_args("transfer-name-unusable", &args)
+}
+
+fn names_collide(folder: impl std::fmt::Display) -> String {
+ let mut args = fluent_bundle::FluentArgs::new();
+ args.set("folder", folder.to_string());
+ crate::i18n::tr_args("transfer-names-collide", &args)
}
#[cfg(test)]
diff --git a/wezterm-gui/src/termwindow/render/paint.rs b/wezterm-gui/src/termwindow/render/paint.rs
index 4afe1208..717a259d 100644
--- a/wezterm-gui/src/termwindow/render/paint.rs
+++ b/wezterm-gui/src/termwindow/render/paint.rs
@@ -767,13 +767,48 @@ pub(crate) fn sticky_allow_images(
}
}
+/// What the cover over a terminal says, in the user's language. The gate's
+/// own `overlay_message` is the English the TUI shows.
+fn gate_message(gate: &wezterm_client::domain::RemoteFrontendGate) -> Option<(String, String)> {
+ use crate::i18n::{tr, tr_args};
+ use wezterm_client::domain::RemoteFrontendGate::*;
+ Some(match gate {
+ Visible => return None,
+ Claimable { owner: Some(owner) } => {
+ let hostname = owner.hostname.trim();
+ let title = if hostname.is_empty() {
+ tr("terminal-gate-busy")
+ } else {
+ let mut args = fluent_bundle::FluentArgs::new();
+ args.set("host", hostname.to_string());
+ tr_args("terminal-gate-busy-on", &args)
+ };
+ (title, tr("terminal-gate-busy-hint"))
+ }
+ Claimable { owner: None } => (tr("terminal-gate-free"), tr("terminal-gate-free-hint")),
+ Connecting => (
+ tr("terminal-gate-connecting"),
+ tr("terminal-gate-wait-hint"),
+ ),
+ Reconnecting => (
+ tr("terminal-gate-reconnecting"),
+ tr("terminal-gate-reconnecting-hint"),
+ ),
+ Offline => (
+ tr("terminal-gate-offline"),
+ tr("terminal-gate-offline-hint"),
+ ),
+ Syncing => (tr("terminal-gate-syncing"), tr("terminal-gate-wait-hint")),
+ })
+}
+
impl crate::TermWindow {
fn paint_frontend_handoff_overlay(
&mut self,
layers: &mut TripleLayerQuadAllocator<'_>,
) -> anyhow::Result<bool> {
let gate = self.frontend_terminal_gate();
- let Some((title, hint)) = gate.overlay_message() else {
+ let Some((title, hint)) = gate_message(&gate) else {
return Ok(false);
};
let now = Instant::now();
@@ -876,7 +911,7 @@ impl crate::TermWindow {
if !gate.is_claimable() && !syncing_in_view {
return Ok(false);
}
- let Some((title, hint)) = gate.overlay_message() else {
+ let Some((title, hint)) = gate_message(&gate) else {
return Ok(false);
};
let text = format!("{title} \u{2014} {hint}");
diff --git a/wezterm-gui/src/termwindow/transfer_walk.rs b/wezterm-gui/src/termwindow/transfer_walk.rs
index 772e79ca..5b774a4c 100644
--- a/wezterm-gui/src/termwindow/transfer_walk.rs
+++ b/wezterm-gui/src/termwindow/transfer_walk.rs
@@ -70,16 +70,23 @@ pub(crate) enum TransferPlanError {
Unreadable(String),
}
+/// "That folder holds more than N items", for a walk here or on a remote.
+pub(crate) fn too_many_entries(limit: usize) -> String {
+ let mut args = fluent_bundle::FluentArgs::new();
+ args.set("limit", limit);
+ crate::i18n::tr_args("transfer-too-many-items", &args)
+}
+
impl TransferPlanError {
pub(crate) fn message(&self) -> String {
match self {
- Self::DestinationInsideSource => {
- "Cannot copy a folder into itself or into one of its own subfolders".to_string()
- }
- Self::TooManyEntries(limit) => {
- format!("That folder holds more than {limit} items")
+ Self::DestinationInsideSource => crate::i18n::tr("transfer-into-itself"),
+ Self::TooManyEntries(limit) => too_many_entries(*limit),
+ Self::Unreadable(path) => {
+ let mut args = fluent_bundle::FluentArgs::new();
+ args.set("path", path.to_string());
+ crate::i18n::tr_args("transfer-unreadable", &args)
}
- Self::Unreadable(path) => format!("Unable to read {path}"),
}
}
}
diff --git a/wezterm-gui/src/termwindow/ui/command_palette.rs b/wezterm-gui/src/termwindow/ui/command_palette.rs
index dd5dbfa5..5ff00b60 100644
--- a/wezterm-gui/src/termwindow/ui/command_palette.rs
+++ b/wezterm-gui/src/termwindow/ui/command_palette.rs
@@ -486,10 +486,21 @@ fn item_label(item: &PaletteItem) -> &str {
}
}
+fn menu_path(cmd: &ExpandedCommand, separator: &str) -> String {
+ cmd.menubar
+ .iter()
+ .map(|name| crate::commands::menu_title(name))
+ .collect::<Vec<_>>()
+ .join(separator)
+}
+
fn item_haystack(item: &PaletteItem) -> String {
match item {
+ // The menu path in English as well as shown, so English words
+ // still find a command whatever the language.
PaletteItem::Leaf(cmd) => format!(
- "{}: {}. {} {:?}",
+ "{} {}: {}. {} {:?}",
+ menu_path(cmd, " "),
cmd.menubar.join(" "),
cmd.brief,
cmd.doc,
@@ -655,13 +666,17 @@ fn family_child(mut cmd: ExpandedCommand, kind: PaletteGroupKind) -> ExpandedCom
_ => None,
}
}
- (_, PaletteGroupKind::LaunchMenu) => cmd
- .brief
- .strip_suffix(" (New Tab)")
- .map(|label| label.to_string()),
+ (KeyAssignment::SpawnCommandInNewTab(spawn), PaletteGroupKind::LaunchMenu) => {
+ Some(crate::commands::launch_menu_label(spawn))
+ }
_ => None,
};
if let Some(short) = short {
+ // Still remembered by its full name: that is what the palette's
+ // order looks its score up by.
+ if cmd.english_brief.is_none() {
+ cmd.english_brief = Some(cmd.brief.clone());
+ }
cmd.brief = short.into();
}
cmd
@@ -921,6 +936,7 @@ fn thread_leaf(entry: ThreadSearchEntry, archived_suffix: &str) -> (ExpandedComm
menubar: &[],
icon: Some(icon.into()),
accessory: Some(entry.space_name.into()),
+ english_brief: None,
},
haystack,
)
@@ -1347,6 +1363,7 @@ impl crate::TermWindow {
menubar: &[],
icon: None,
accessory: None,
+ english_brief: None,
}));
for name in names {
items.push(PaletteItem::Leaf(ExpandedCommand {
@@ -1357,6 +1374,7 @@ impl crate::TermWindow {
menubar: &[],
icon: None,
accessory: None,
+ english_brief: None,
}));
}
@@ -1399,6 +1417,7 @@ impl crate::TermWindow {
menubar: &[],
icon: None,
accessory: None,
+ english_brief: None,
})
})
.collect();
@@ -2324,7 +2343,7 @@ impl crate::TermWindow {
let prefix = if cmd.menubar.is_empty() {
None
} else {
- Some(format!("{} › ", cmd.menubar.join(" › ")))
+ Some(format!("{} › ", menu_path(cmd, " › ")))
};
(
row_icon(cmd, &palette),
@@ -2704,6 +2723,7 @@ mod tests {
menubar: &[],
icon: None,
accessory: None,
+ english_brief: None,
})
}
diff --git a/wezterm-gui/src/termwindow/ui/plugin_panel.rs b/wezterm-gui/src/termwindow/ui/plugin_panel.rs
index a0aef870..bf837e8e 100644
--- a/wezterm-gui/src/termwindow/ui/plugin_panel.rs
+++ b/wezterm-gui/src/termwindow/ui/plugin_panel.rs
@@ -903,7 +903,7 @@ impl TermWindow {
fn plugin_panel_reach(&mut self) -> Result<Reach, String> {
let pane_id = self
.get_active_pane_no_overlay()
- .ok_or_else(|| "no terminal is beside the panel".to_string())?
+ .ok_or_else(|| crate::i18n::tr("plugin-answer-no-terminal"))?
.pane_id();
self.plugin_panel_reach_of(pane_id).clone()
}
@@ -940,9 +940,9 @@ impl TermWindow {
let target = match self.active_remote_project_for_files() {
Ok(Some(target)) => target,
found => {
- let why = found.err().unwrap_or_else(|| {
- "the terminal beside the panel runs on this machine".to_string()
- });
+ let why = found
+ .err()
+ .unwrap_or_else(|| crate::i18n::tr("plugin-answer-local-terminal"));
self.plugin_panel_reach = Some((pane_id, Instant::now(), Err(why)));
return;
}
@@ -989,7 +989,7 @@ impl TermWindow {
fn plugin_remote_reach(&self) -> Result<Reach, String> {
let target = self
.active_remote_project_for_files()?
- .ok_or_else(|| "the terminal beside the panel runs on this machine".to_string())?;
+ .ok_or_else(|| crate::i18n::tr("plugin-answer-local-terminal"))?;
Self::reach_of(&target)
}
@@ -1022,11 +1022,11 @@ impl TermWindow {
// Asked for the terminal's machine before it moved to another: not
// done where it is now.
if reach.machine != machine {
- let why = "the terminal beside the panel is on another machine now";
+ let why = crate::i18n::tr("plugin-answer-moved");
return plugins::answer(view, id, &Answer::failed(why));
}
if !remote_source_is_authorized(&reach.source_key) {
- let why = format!("ThinkTerm is not connected to {}", reach.host);
+ let why = not_connected_to(&reach.host);
let connect = Connect {
host: reach.host,
machine: reach.machine,
@@ -1121,7 +1121,11 @@ impl TermWindow {
PanelNews::Remote { id, machine, ask } => {
if self.plugin_view_numbered(view).is_none() {
// A view this window let go of meanwhile.
- return plugins::answer(view, id, &Answer::failed("the panel closed"));
+ return plugins::answer(
+ view,
+ id,
+ &Answer::failed(crate::i18n::tr("plugin-answer-closed")),
+ );
}
return self.plugin_panel_ask(view, id, machine, ask);
}
@@ -1883,6 +1887,14 @@ impl TermWindow {
}
}
+/// Why an ask about another machine is not done: no connection to it yet.
+/// A plugin shows it as it is, so it is in the user's language.
+fn not_connected_to(host: &str) -> String {
+ let mut args = fluent_bundle::FluentArgs::new();
+ args.set("host", host.to_string());
+ crate::i18n::tr_args("plugin-answer-not-connected", &args)
+}
+
/// Takes `cost` quads from `budget`; none, and false, when it has not that
/// many left.
fn spend(budget: &mut usize, cost: usize) -> bool {
@@ -2042,7 +2054,7 @@ async fn ask_there(reach: Reach, ask: Ask) -> Answer {
Ok(lease) => lease,
Err(RemoteAcquireError::Failed(why)) => return Answer::failed(why),
Err(RemoteAcquireError::NotConnected) => {
- return Answer::failed(format!("ThinkTerm is not connected to {}", reach.host))
+ return Answer::failed(not_connected_to(&reach.host))
}
};
let backend = lease.backend();
diff --git a/wezterm-gui/src/termwindow/ui/right_sidebar.rs b/wezterm-gui/src/termwindow/ui/right_sidebar.rs
index f26a6138..5115b817 100644
--- a/wezterm-gui/src/termwindow/ui/right_sidebar.rs
+++ b/wezterm-gui/src/termwindow/ui/right_sidebar.rs
@@ -17660,7 +17660,7 @@ impl crate::TermWindow {
// timeout only by a refresh or reconnect.
RemoteFileSearchStatus::Failed(message) => {
query_changed
- && message != crate::termwindow::remote_files::REMOTE_LISTING_TIMED_OUT
+ && !crate::termwindow::remote_files::remote_listing_is_timed_out(message)
}
};
if needs_listing {
diff --git a/window/Cargo.toml b/window/Cargo.toml
index 31e5d250..964762be 100644
--- a/window/Cargo.toml
+++ b/window/Cargo.toml
@@ -104,3 +104,4 @@ objc.workspace = true
objc2.workspace = true
objc2-core-graphics.workspace = true
plist.workspace = true
+thinkterm-i18n.workspace = true
diff --git a/window/src/os/macos/app.rs b/window/src/os/macos/app.rs
index 92186537..03dad3b2 100644
--- a/window/src/os/macos/app.rs
+++ b/window/src/os/macos/app.rs
@@ -47,10 +47,10 @@ extern "C" fn application_should_terminate(
WindowCloseConfirmation::AlwaysPrompt => {
let alert: id = msg_send![class!(NSAlert), alloc];
let alert: id = msg_send![alert, init];
- let message_text = nsstring("Terminate ThinkTerm?");
- let info_text = nsstring("Detach and close all panes and terminate ThinkTerm?");
- let cancel = nsstring("Cancel");
- let ok = nsstring("Ok");
+ let message_text = nsstring(&thinkterm_i18n::tr("quit-confirm-title"));
+ let info_text = nsstring(&thinkterm_i18n::tr("quit-confirm-detail"));
+ let cancel = nsstring(&thinkterm_i18n::tr("quit-confirm-cancel"));
+ let ok = nsstring(&thinkterm_i18n::tr("quit-confirm-ok"));
let () = msg_send![alert, setMessageText: message_text];
let () = msg_send![alert, setInformativeText: info_text];
@@ -255,8 +255,11 @@ extern "C" fn application_dock_menu(
_app: *mut Object,
) -> *mut Object {
let dock_menu = Menu::new_with_title("");
- let new_window_item =
- MenuItem::new_with("New Window", Some(sel!(weztermPerformKeyAssignment:)), "");
+ let new_window_item = MenuItem::new_with(
+ &thinkterm_i18n::tr("command-new-window"),
+ Some(sel!(weztermPerformKeyAssignment:)),
+ "",
+ );
new_window_item
.set_represented_item(RepresentedItem::KeyAssignment(KeyAssignment::SpawnWindow));
dock_menu.add_item(&new_window_item);