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.

Add multilingual UI support and refine sidebar dragging

RoversX83df59080a9a
diff --git a/Cargo.lock b/Cargo.lock
index a666558f..a03d7c95 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1795,6 +1795,41 @@ dependencies = [
"num-traits",
]
+[[package]]
+name = "fluent-bundle"
+version = "0.16.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "01203cb8918f5711e73891b347816d932046f95f54207710bda99beaeb423bf4"
+dependencies = [
+ "fluent-langneg",
+ "fluent-syntax",
+ "intl-memoizer",
+ "intl_pluralrules",
+ "rustc-hash 2.1.1",
+ "self_cell",
+ "smallvec",
+ "unic-langid",
+]
+
+[[package]]
+name = "fluent-langneg"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7eebbe59450baee8282d71676f3bfed5689aeab00b27545e83e5f14b1195e8b0"
+dependencies = [
+ "unic-langid",
+]
+
+[[package]]
+name = "fluent-syntax"
+version = "0.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "54f0d287c53ffd184d04d8677f590f4ac5379785529e5e08b1c8083acdd5c198"
+dependencies = [
+ "memchr",
+ "thiserror 2.0.17",
+]
+
[[package]]
name = "flume"
version = "0.11.1"
@@ -2801,6 +2836,25 @@ dependencies = [
"syn 2.0.110",
]
+[[package]]
+name = "intl-memoizer"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "310da2e345f5eb861e7a07ee182262e94975051db9e4223e909ba90f392f163f"
+dependencies = [
+ "type-map",
+ "unic-langid",
+]
+
+[[package]]
+name = "intl_pluralrules"
+version = "7.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "078ea7b7c29a2b4df841a7f6ac8775ff6074020c6776d48491ce2268e068f972"
+dependencies = [
+ "unic-langid",
+]
+
[[package]]
name = "intrusive-collections"
version = "0.9.7"
@@ -5152,6 +5206,12 @@ dependencies = [
"libc",
]
+[[package]]
+name = "self_cell"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2ab42ca02749e120097e328d91d415325bdf43b1c72c4c8badf37375fe40a813"
+
[[package]]
name = "semver"
version = "1.0.27"
@@ -5759,6 +5819,15 @@ dependencies = [
"syn 2.0.110",
]
+[[package]]
+name = "sys-locale"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4"
+dependencies = [
+ "libc",
+]
+
[[package]]
name = "system-configuration"
version = "0.6.1"
@@ -6117,6 +6186,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869"
dependencies = [
"displaydoc",
+ "serde_core",
"zerovec",
]
@@ -6596,6 +6666,15 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
+[[package]]
+name = "type-map"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cb30dbbd9036155e74adad6812e9898d03ec374946234fbcebd5dfc7b9187b90"
+dependencies = [
+ "rustc-hash 2.1.1",
+]
+
[[package]]
name = "typeid"
version = "1.0.3"
@@ -6633,6 +6712,24 @@ dependencies = [
"libc",
]
+[[package]]
+name = "unic-langid"
+version = "0.9.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a28ba52c9b05311f4f6e62d5d9d46f094bd6e84cb8df7b3ef952748d752a7d05"
+dependencies = [
+ "unic-langid-impl",
+]
+
+[[package]]
+name = "unic-langid-impl"
+version = "0.9.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dce1bf08044d4b7a94028c93786f8566047edc11110595914de93362559bc658"
+dependencies = [
+ "tinystr",
+]
+
[[package]]
name = "unicase"
version = "2.8.1"
@@ -7337,6 +7434,8 @@ dependencies = [
"fastrand",
"filedescriptor",
"finl_unicode",
+ "fluent-bundle",
+ "fluent-langneg",
"frecency",
"futures",
"hdrhistogram",
@@ -7373,6 +7472,7 @@ dependencies = [
"shared_library",
"shlex 1.3.0",
"smol",
+ "sys-locale",
"tabout",
"tempfile",
"terminfo",
@@ -7384,6 +7484,7 @@ dependencies = [
"tiny-skia",
"trash",
"umask",
+ "unic-langid",
"unicode-linebreak",
"unicode-normalization",
"unicode-segmentation",
@@ -8754,6 +8855,7 @@ version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002"
dependencies = [
+ "serde",
"yoke",
"zerofrom",
"zerovec-derive",
diff --git a/Cargo.toml b/Cargo.toml
index 76d90677..2d8d766f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -97,6 +97,8 @@ filesystem = { path = "lua-api-crates/filesystem" }
finl_unicode = { version = "1.3", git="https://github.com/wez/finl_unicode.git", branch="no_std" , default-features=false, features=["categories", "grapheme_clusters"]}
fixed = "1.23"
fixedbitset = {version="0.4", default-features=false}
+fluent-bundle = "0.16"
+fluent-langneg = "0.13"
flume = "0.11"
fnv = "1.0"
foreign-types = "0.5"
@@ -218,6 +220,7 @@ tabout = { path = "tabout" }
tar = "0.4"
tempfile = "3.20"
terminfo = "0.9"
+sys-locale = "0.3"
termios = "0.3"
termwiz = { version="0.24.0", path = "termwiz" }
termwiz-funcs = { path = "lua-api-crates/termwiz-funcs" }
@@ -233,6 +236,7 @@ umask = { path = "umask" }
unicode-normalization = "0.1.24"
unicode-segmentation = "1.12"
unicode-width = "0.2"
+unic-langid = "0.9"
url = "2"
url-funcs = { path = "lua-api-crates/url-funcs" }
utf8parse = "0.2"
diff --git a/wezterm-gui/Cargo.toml b/wezterm-gui/Cargo.toml
index ae696c21..c30a5cba 100644
--- a/wezterm-gui/Cargo.toml
+++ b/wezterm-gui/Cargo.toml
@@ -55,6 +55,8 @@ euclid.workspace = true
fastrand.workspace = true
filedescriptor.workspace = true
finl_unicode.workspace = true
+fluent-bundle.workspace = true
+fluent-langneg.workspace = true
frecency.workspace = true
futures.workspace = true
hdrhistogram.workspace = true
@@ -90,6 +92,7 @@ smol.workspace = true
tabout.workspace = true
tempfile.workspace = true
terminfo.workspace = true
+sys-locale.workspace = true
termwiz-funcs.workspace = true
termwiz.workspace = true
textwrap.workspace = true
@@ -102,6 +105,7 @@ unicode-normalization.workspace = true
unicode-linebreak = "0.1"
unicode-segmentation.workspace = true
unicode-width.workspace = true
+unic-langid.workspace = true
uuid = { workspace = true, features = ["v4"] }
percent-encoding.workspace = true
url-funcs.workspace = true
diff --git a/wezterm-gui/i18n/en-US.ftl b/wezterm-gui/i18n/en-US.ftl
new file mode 100644
index 00000000..adb37066
--- /dev/null
+++ b/wezterm-gui/i18n/en-US.ftl
@@ -0,0 +1,363 @@
+language-system = Follow System
+language-system-resolved = Follow System ({ $language })
+settings-window-title = ThinkTerm Settings
+settings-language = Language
+settings-language-description = Changes the language of ThinkTerm's interface immediately.
+settings-language-changed = Interface language changed to { $language }.
+settings-language-save-error = Unable to save language setting: { $error }
+common-on = On
+common-off = Off
+common-hidden = Hidden
+common-file = File
+common-defaults = Defaults
+common-found = Found
+common-missing = Missing
+common-error = Error
+common-parsed = Parsed
+common-idle = Idle
+common-empty = Empty
+common-independent = Independent
+common-required = Required
+common-not-required = Not required
+common-choose = Choose…
+common-reset = Reset
+common-clear = Clear
+common-select-all = Select All
+common-minutes = { $count } min
+common-points = { $value } pt
+settings-section-general = General
+settings-section-appearance = Appearance
+settings-section-terminal = Terminal
+settings-section-workspaces = Workspaces
+settings-section-keymap = Keymap
+settings-section-compatibility = Compatibility
+settings-section-developer = Developer
+settings-section-about = About
+settings-search-placeholder = Search settings…
+settings-search-no-results = No settings found
+settings-keymap-description = Keyboard shortcuts and command palette actions.
+settings-about-description = ThinkTerm version, project information, and app metadata.
+settings-general-heading = Configuration
+settings-config-source = Config Source
+settings-native-settings = ThinkTerm Native Settings
+settings-native-settings-default = Defaults; optional file at { $path }
+settings-native-settings-description = Small ThinkTerm-native state; terminal config stays in ThinkTerm's own thinkterm.lua.
+settings-theme-mode = Theme Mode
+settings-theme-description = ThinkTerm-native window appearance preference.
+settings-theme-system = System
+settings-theme-light = Light
+settings-theme-dark = Dark
+settings-theme-changed = Theme mode is now { $mode }.
+settings-theme-save-error = Unable to save theme mode: { $error }
+settings-main-renderer = Main Window Renderer
+settings-main-renderer-description = Applies to the main terminal window after restart.
+settings-restore-window-frame = Restore Main Window Frame
+settings-restore-window-frame-description = macOS restores the last main terminal window size and position.
+settings-restart = Restart
+settings-restart-app = Restart ThinkTerm
+settings-restart-status = Renderer change status: { $status }.
+settings-quit = Quit
+settings-quit-description = Close all ThinkTerm windows and exit the app.
+settings-quit-app = Quit ThinkTerm
+settings-appearance-theme-heading = Theme
+settings-app-icon = App Icon
+settings-app-icon-description = Switch the running Dock and app switcher icon.
+settings-app-icon-note = Currently only works on macOS.
+settings-app-icon-simple = Simple
+settings-app-icon-classic = Classic
+settings-effective-color-scheme = Effective Color Scheme
+settings-effective-color-scheme-description = Resolved through the WezTerm-compatible config path.
+settings-typography-heading = Typography
+settings-font-size-settings = Settings UI Font Size
+settings-font-size-settings-description = Controls the Settings window chrome and content text.
+settings-font-size-home = Home Font Size
+settings-font-size-home-description = Controls the main home/content view text.
+settings-font-size-right-sidebar = Right Sidebar Font Size
+settings-font-size-right-sidebar-description = Follows Home Font Size until set — files, notes and snippets panel.
+settings-font-size-workspace-sidebar = Workspace Sidebar Font Size
+settings-font-size-workspace-sidebar-description = Saved separately for the main workspace sidebar.
+settings-font-size-tab-bar = Tab Bar Font Size
+settings-font-size-tab-bar-description = Saved separately for the top terminal tab bar.
+settings-font-size-pane-header = Pane Header Font Size
+settings-font-size-pane-header-description = Saved separately for split-pane header labels.
+settings-font-weight = Settings UI Font Weight
+settings-font-weight-description = Controls the Settings window chrome and content text weight.
+settings-workspaces-heading = Remote Files
+settings-sftp-idle = Remote Files Connection Idle Timeout
+settings-sftp-idle-description = Disconnects an unused SFTP session; directory and preview data are released immediately.
+settings-download-folder = Download Folder
+settings-system-download-folder = Use the System Downloads Folder
+settings-system-download-folder-description = Clears the chosen folder so downloads follow this computer's own setting.
+settings-remote-drop-destination = Remote Drop Destination
+settings-remote-drop-destination-description = Where files dropped onto a remote terminal are uploaded. Use cwd for the shell's current directory.
+settings-terminal-heading = Effective terminal config
+settings-terminal-font-size = Font Size
+settings-terminal-font-size-description = Current effective value from the WezTerm-compatible config.
+settings-terminal-font-family = Font Family
+settings-terminal-font-family-description = Current primary terminal font family.
+settings-terminal-native-font-size = ThinkTerm Font Size
+settings-terminal-native-font-size-description = Saved locally and applied immediately to open terminal windows.
+settings-terminal-native-font-family = Native Font Family
+settings-terminal-native-font-family-description = Local quick-setting draft. Persistence and terminal application are pending.
+settings-bottom-quote = Bottom Quote
+settings-bottom-quote-description = Shows a small quote in the existing bottom gutter.
+settings-quote-font-size = Quote Font Size
+settings-quote-font-size-description = Changes only the painted quote text; gutter height stays unchanged.
+settings-quote-rotation = Quote Rotation
+settings-quote-rotation-description = Timed rotates in order; pseudo-random picks a stable quote per interval.
+settings-quote-mode-timed = Timed
+settings-quote-mode-random = Pseudo-random
+settings-quote-interval = Quote Interval
+settings-quote-interval-description = Controls how often the bottom quote rotates.
+settings-open-quotes-json = Open Quotes JSON
+settings-reset-quotes-json = Reset Quotes JSON
+settings-compatibility-description = ThinkTerm uses its own WezTerm-compatible config. Existing WezTerm files are optional import sources, not shared live state.
+settings-thinkterm-config = ThinkTerm Config
+settings-thinkterm-config-missing = Not created yet; target is { $path }
+settings-wezterm-source = WezTerm Source
+settings-wezterm-source-missing = No existing WezTerm config found
+settings-loaded-source = Loaded Source
+settings-not-loaded = Not loaded yet
+settings-loaded-source-warnings = { $source } ({ $count } warnings)
+settings-importable-fields = Importable Fields
+settings-importable-fields-description = Choose exactly which source config values ThinkTerm should copy.
+settings-no-fields-loaded = No fields loaded
+settings-fields-selected = { $selected } of { $total } selected
+settings-detected-fields = Detected Fields
+settings-load-source-description = Load a WezTerm source config to inspect importable fields.
+settings-load-wezterm-source = Load WezTerm Source
+settings-import-selected = Import Selected
+settings-open-wezterm-source = Open WezTerm Source
+settings-open-thinkterm-config = Open ThinkTerm Config
+sidebar-default-space = Default
+sidebar-connecting = Connecting…
+sidebar-reconnect = Reconnect
+sidebar-new-thread = New Thread
+sidebar-pinned = Pinned
+sidebar-workspaces = Workspaces
+sidebar-settings = Settings
+menu-rename-project = Rename Project…
+menu-new-thread = New Thread
+menu-toggle-threads = Collapse / Expand Threads
+menu-remove-project = Remove Project
+menu-space-occupied = { $name } (occupied)
+menu-space-remote = { $name } (Remote)
+menu-new-space = New Space
+menu-rename-space = Rename Space…
+menu-rename-named-space = Rename “{ $name }”…
+menu-disconnect-space = Disconnect “{ $name }” (Server Keeps Running)
+menu-delete-space = Delete “{ $name }”
+menu-delete-space-and-sessions = Delete “{ $name }” & End Remote Sessions
+menu-delete-other-space = Delete Other Space
+menu-status-running = Running
+menu-status-attention = Needs Attention
+menu-status-done = Done
+menu-status-idle = Idle
+menu-group-by = Group by
+menu-workspace = Workspace
+menu-show = Show
+menu-status = Status
+menu-no-notifications = No notifications
+menu-disconnect-thread = Disconnect Thread
+menu-connect-thread = Connect Thread
+menu-pin-thread = Pin Thread
+menu-unpin-thread = Unpin Thread
+menu-rename-thread = Rename Thread…
+menu-delete-thread = Delete Thread
+menu-mark-unread = Mark as Unread
+menu-rename-tab = Rename Tab…
+menu-close-tabs-left = Close Tabs to Left
+menu-close-tabs-right = Close Tabs to Right
+menu-close-other-tabs = Close Other Tabs
+menu-move-tab-left = Move Tab Left
+menu-move-tab-right = Move Tab Right
+menu-new-terminal-tab-right = New Terminal Tab to Right
+menu-zoom-pane = Zoom Pane
+menu-copy = Copy
+menu-paste = Paste
+menu-cut = Cut
+menu-delete = Delete
+menu-select-all = Select All
+menu-undo = Undo
+menu-redo = Redo
+menu-split-right = Split Right
+menu-split-left = Split Left
+menu-split-down = Split Down
+menu-split-up = Split Up
+menu-reset-terminal = Reset Terminal
+menu-ignore-spelling = Ignore Spelling
+menu-learn-spelling = Learn Spelling
+menu-look-up = Look Up
+right-mode-files = Files
+right-mode-notes = Notes
+right-mode-snippets = Snippets
+right-preview-truncated = Preview truncated to 256 KiB
+right-loading-preview = Loading file preview…
+right-window-unavailable = Window is unavailable
+right-preview-error = Unable to load file preview: { $error }
+right-open = Open
+right-copy-path = Copy Path
+right-rename = Rename…
+right-move-trash = Move to Trash
+right-open-with = Open With { $app }
+right-open-with-other = Open With Other…
+right-create-vault = Create Vault
+right-create = Create
+right-choose-vault = Choose Vault
+right-choose = Choose
+right-source-mode = Source Mode
+right-show-vault-sidebar = Show Vault Sidebar
+right-hide-vault-sidebar = Hide Vault Sidebar
+right-show-vault = Show Vault
+right-hide-vault = Hide Vault
+right-new-note = New Note
+right-save = Save
+right-choose-another-vault = Choose Another Vault…
+right-vault = Vault
+right-notes-open-error = Unable to open Notes
+right-choose-existing-vault = Choose Existing Vault…
+right-create-new-vault = Create New Vault…
+right-laying-out-note = Laying out note…
+right-opening-note = Opening note…
+right-notes-first-use = Choose an existing Vault or create a new one to start Notes.
+right-no-active-project = No active Project in this Space.
+right-indexing-vault = Indexing Vault…
+right-not-connected = Not connected
+right-connect = Connect
+right-connecting = Connecting…
+right-connection-failed = Connection failed
+right-retry = Retry
+right-remote-files = Remote Files
+right-loading-remote-directory = Loading remote directory…
+right-more-entries = More entries are not shown
+right-more-transfer = 1 more transfer
+right-more-transfers = { $count } more transfers
+right-filter-files = Filter files
+right-indexing-files = Indexing files…
+right-searching-files = Searching files…
+right-no-matching-files = No matching files
+right-new-snippet = New Snippet
+right-search = Search
+right-no-snippets = No snippets
+right-no-matching-snippets = No matching snippets
+right-edit-snippet = Edit Snippet
+right-snippet = Snippet
+right-personal-vault = Personal vault
+right-action-description = Action description
+right-action-description-placeholder = Describe this action
+right-script-required = Script *
+right-script-placeholder = Type command or script
+right-run = Run
+right-download = Download
+right-new-folder = New Folder
+right-delete = Delete…
+right-copy-all = Copy All
+right-dismiss = Dismiss
+right-cancel = Cancel
+right-replace-conflicts = Replace { $count } existing files
+right-skip-conflicts = Skip { $count } existing files
+right-cancel-copy = Cancel the copy
+right-confirm-download = Download { $count } items
+right-confirm-delete-items = Delete { $count } items permanently
+right-confirm-delete-name = Delete “{ $name }” permanently
+right-confirm-upload = Upload { $count } items
+ssh-hosts-title = SSH Hosts
+ssh-no-hosts = No hosts yet. Click + to add.
+ssh-select-host = Select a host, or click + to add a new one.
+ssh-search = Search hosts…
+ssh-system-hosts = System SSH ({ $count })
+ssh-edit-host = Edit Host
+ssh-new-host = New Host
+ssh-field-name = Name
+ssh-field-host = Host
+ssh-field-port = Port
+ssh-field-user = User
+ssh-field-password = Password
+ssh-field-identity = Identity file
+ssh-field-workspace = Workspace
+ssh-group-connection = Connection
+ssh-group-authentication = Authentication
+ssh-group-session = Session
+ssh-detect-os = Detect OS on connect
+ssh-use-mosh = Connect with Mosh
+ssh-use-mux = ThinkTerm Connect (persistent mux)
+ssh-advanced = Advanced (ssh_config options)
+ssh-add-option = + Add option
+ssh-save-open = Save & Open
+ssh-save = Save
+ssh-cancel = Cancel
+ssh-error-host-required = Host is required
+ssh-error-port-number = Port must be a number
+ssh-error-mosh-command = Mosh server command is required
+ssh-error-host-missing = Host no longer exists
+ssh-error-save = Failed to save host: { $error }
+ssh-error-encrypt = Failed to encrypt password: { $error }
+remote-thread-connecting-to = Connecting to { $endpoint }…
+remote-thread-not-connected = This SSH thread is not connected.
+remote-thread-connection = Connection
+remote-thread-project = Project
+remote-thread-endpoint = Endpoint
+remote-thread-thread = Thread
+remote-thread-connecting = { $frame } Connecting…
+remote-thread-transport-elapsed = Transport: { $transport } · elapsed { $seconds }s
+remote-thread-failed = The connection failed.
+remote-thread-failed-detail = Transport: { $transport } · retry, or cancel to dismiss.
+remote-thread-mosh-detail = Starts mosh-server over SSH, then opens mosh-client.
+remote-thread-ssh-detail = Opens a ThinkTerm SSH session.
+remote-thread-transport = Transport: { $transport }
+remote-thread-connect = Connect
+remote-thread-delete = Delete Thread
+remote-thread-cancel = Cancel
+remote-thread-retry = Retry
+remote-thread-stale = This saved SSH thread no longer exists.
+remote-thread-host-stale = The saved SSH host for this thread no longer exists.
+menu-reveal-finder = Reveal in Finder
+menu-reveal-explorer = Show in File Explorer
+menu-reveal-folder = Show in Folder
+settings-developer-description = Keep normal Settings clean. Enable developer mode to reveal internal pages. Memory sampling still has to be started manually.
+settings-developer-mode = Developer Mode
+settings-developer-mode-description = Shows internal Settings pages for UI tuning and memory diagnostics.
+settings-fallback-menu = Use Fallback Context Menu
+settings-fallback-menu-description = On macOS, route right-click menus through the app-rendered fallback for local testing.
+settings-developer-tabs = Visible Developer Tabs
+settings-developer-tabs-description = UI Kit and Memory/Input tabs are shown here; diagnostics do not run automatically.
+settings-developer-tabs-value = UI Kit, Memory/Input
+settings-onboarding-launcher = Onboarding
+settings-onboarding-launcher-description = Open the setup wizard without changing the saved seen version.
+settings-onboarding-launcher-value = Manual test entry
+settings-disable-developer = Disable Developer Mode
+settings-enable-developer = Enable Developer Mode
+settings-show-onboarding = Show Onboarding Now
+settings-config-source-file = File: { $path }
+settings-config-source-default = No config file loaded; using built-in defaults
+settings-config-source-overridden = No config file loaded; command-line overrides or --skip-config are active
+settings-status-saved = { $setting } saved.
+settings-status-save-error = Unable to save { $setting }: { $error }
+settings-status-value-now = { $setting } is now { $value }.
+settings-status-value-reset = { $setting } reset to { $value }.
+settings-status-terminal-saved = Terminal settings saved; font size applied to open windows.
+settings-status-terminal-error = Unable to save terminal settings: { $error }
+settings-status-quote-error = Unable to save bottom quote setting: { $error }
+settings-status-quote-enabled = Bottom quote enabled.
+settings-status-quote-disabled = Bottom quote disabled.
+settings-status-sftp-idle = Remote Files idle timeout is now { $count } minutes.
+settings-status-sftp-error = Unable to save Remote Files idle timeout: { $error }
+settings-system-default-path = { $path } (system default)
+settings-no-downloads-folder = No Downloads folder found
+settings-download-picker-title = Choose a download folder
+settings-status-download-path = Downloads are saved to { $path }
+settings-status-download-error = Unable to save the download folder: { $error }
+settings-status-window-restore-on = Main window frame restore enabled for new macOS windows.
+settings-status-window-restore-off = Main window frame restore disabled for new macOS windows.
+settings-status-window-restore-error = Unable to save window restore setting: { $error }
+settings-status-renderer = Main window renderer set to { $renderer }; restart ThinkTerm to apply it.
+settings-status-renderer-error = Unable to save renderer setting: { $error }
+settings-status-restarting = Restarting ThinkTerm…
+settings-status-restart-error = Unable to restart ThinkTerm: { $error }
+settings-status-quitting = Quitting ThinkTerm…
+settings-status-opening-quotes = Opening bottom quotes JSON { $path }
+settings-status-open-quotes-error = Unable to prepare bottom quotes JSON: { $error }
+settings-status-reset-quotes = Reset bottom quotes JSON { $path }
+settings-status-reset-quotes-error = Unable to reset bottom quotes JSON: { $error }
+settings-status-app-icon = App icon is now { $icon }.
+settings-status-app-icon-error = Unable to save app icon: { $error }
diff --git a/wezterm-gui/i18n/fr-FR.ftl b/wezterm-gui/i18n/fr-FR.ftl
new file mode 100644
index 00000000..433a998c
--- /dev/null
+++ b/wezterm-gui/i18n/fr-FR.ftl
@@ -0,0 +1,363 @@
+language-system = Suivre le système
+language-system-resolved = Suivre le système ({ $language })
+settings-window-title = Réglages de ThinkTerm
+settings-language = Langue
+settings-language-description = Change immédiatement la langue de l’interface de ThinkTerm.
+settings-language-changed = La langue de l’interface est maintenant { $language }.
+settings-language-save-error = Impossible d’enregistrer la langue : { $error }
+common-on = Activé
+common-off = Désactivé
+common-hidden = Masqué
+common-file = Fichier
+common-defaults = Valeurs par défaut
+common-found = Trouvé
+common-missing = Manquant
+common-error = Erreur
+common-parsed = Analysé
+common-idle = Inactif
+common-empty = Vide
+common-independent = Indépendant
+common-required = Requis
+common-not-required = Non requis
+common-choose = Choisir…
+common-reset = Réinitialiser
+common-clear = Effacer
+common-select-all = Tout sélectionner
+common-minutes = { $count } min
+common-points = { $value } pt
+settings-section-general = Général
+settings-section-appearance = Apparence
+settings-section-terminal = Terminal
+settings-section-workspaces = Espaces de travail
+settings-section-keymap = Raccourcis clavier
+settings-section-compatibility = Compatibilité
+settings-section-developer = Développeur
+settings-section-about = À propos
+settings-search-placeholder = Rechercher dans les réglages…
+settings-search-no-results = Aucun réglage trouvé
+settings-keymap-description = Raccourcis clavier et actions de la palette de commandes.
+settings-about-description = Version de ThinkTerm, informations du projet et métadonnées de l’application.
+settings-general-heading = Configuration
+settings-config-source = Source de configuration
+settings-native-settings = Réglages natifs de ThinkTerm
+settings-native-settings-default = Valeurs par défaut ; fichier facultatif à l’emplacement { $path }
+settings-native-settings-description = Petit état natif de ThinkTerm ; la configuration du terminal reste dans le fichier thinkterm.lua propre à ThinkTerm.
+settings-theme-mode = Mode du thème
+settings-theme-description = Préférence d’apparence native des fenêtres ThinkTerm.
+settings-theme-system = Système
+settings-theme-light = Clair
+settings-theme-dark = Sombre
+settings-theme-changed = Le thème est maintenant { $mode }.
+settings-theme-save-error = Impossible d’enregistrer le thème : { $error }
+settings-main-renderer = Moteur de rendu de la fenêtre principale
+settings-main-renderer-description = S’applique à la fenêtre principale du terminal après redémarrage.
+settings-restore-window-frame = Restaurer la taille et la position de la fenêtre principale
+settings-restore-window-frame-description = macOS restaure la dernière taille et position de la fenêtre principale du terminal.
+settings-restart = Redémarrer
+settings-restart-app = Redémarrer ThinkTerm
+settings-restart-status = État du changement de moteur de rendu : { $status }.
+settings-quit = Quitter
+settings-quit-description = Fermer toutes les fenêtres ThinkTerm et quitter l’application.
+settings-quit-app = Quitter ThinkTerm
+settings-appearance-theme-heading = Thème
+settings-app-icon = Icône de l’application
+settings-app-icon-description = Changer l’icône affichée dans le Dock et le sélecteur d’applications.
+settings-app-icon-note = Fonctionne actuellement uniquement sur macOS.
+settings-app-icon-simple = Simple
+settings-app-icon-classic = Classique
+settings-effective-color-scheme = Jeu de couleurs actif
+settings-effective-color-scheme-description = Déterminé par le chemin de configuration compatible WezTerm.
+settings-typography-heading = Typographie
+settings-font-size-settings = Taille de police des réglages
+settings-font-size-settings-description = Contrôle l’habillage et le texte de la fenêtre Réglages.
+settings-font-size-home = Taille de police de l’accueil
+settings-font-size-home-description = Contrôle le texte de l’accueil et de la vue principale.
+settings-font-size-right-sidebar = Taille de police de la barre latérale droite
+settings-font-size-right-sidebar-description = Suit la taille de l’accueil tant qu’elle n’est pas définie — panneau des fichiers, notes et extraits.
+settings-font-size-workspace-sidebar = Taille de police de la barre des espaces de travail
+settings-font-size-workspace-sidebar-description = Enregistrée séparément pour la barre latérale principale des espaces de travail.
+settings-font-size-tab-bar = Taille de police de la barre d’onglets
+settings-font-size-tab-bar-description = Enregistrée séparément pour la barre d’onglets du terminal.
+settings-font-size-pane-header = Taille de police des en-têtes de volet
+settings-font-size-pane-header-description = Enregistrée séparément pour les libellés des volets scindés.
+settings-font-weight = Graisse de la police des réglages
+settings-font-weight-description = Contrôle la graisse de l’habillage et du texte de la fenêtre Réglages.
+settings-workspaces-heading = Fichiers distants
+settings-sftp-idle = Délai d’inactivité de la connexion aux fichiers distants
+settings-sftp-idle-description = Déconnecte une session SFTP inutilisée et libère immédiatement les données de répertoire et d’aperçu.
+settings-download-folder = Dossier de téléchargement
+settings-system-download-folder = Utiliser le dossier Téléchargements du système
+settings-system-download-folder-description = Efface le dossier choisi afin que les téléchargements suivent le réglage de cet ordinateur.
+settings-remote-drop-destination = Destination du dépôt distant
+settings-remote-drop-destination-description = Emplacement d’envoi des fichiers déposés sur un terminal distant. Utilisez cwd pour le dossier courant du shell.
+settings-terminal-heading = Configuration effective du terminal
+settings-terminal-font-size = Taille de police
+settings-terminal-font-size-description = Valeur effective actuelle issue de la configuration compatible WezTerm.
+settings-terminal-font-family = Famille de police
+settings-terminal-font-family-description = Police principale actuelle du terminal.
+settings-terminal-native-font-size = Taille de police ThinkTerm
+settings-terminal-native-font-size-description = Enregistrée localement et appliquée immédiatement aux fenêtres de terminal ouvertes.
+settings-terminal-native-font-family = Famille de police native
+settings-terminal-native-font-family-description = Brouillon de réglage rapide local. L’enregistrement et l’application au terminal sont à venir.
+settings-bottom-quote = Citation inférieure
+settings-bottom-quote-description = Affiche une courte citation dans la marge inférieure existante.
+settings-quote-font-size = Taille de la citation
+settings-quote-font-size-description = Modifie uniquement le texte de la citation ; la hauteur de la marge reste inchangée.
+settings-quote-rotation = Rotation des citations
+settings-quote-rotation-description = Le mode chronologique suit l’ordre ; le pseudo-aléatoire choisit une citation stable par intervalle.
+settings-quote-mode-timed = Chronologique
+settings-quote-mode-random = Pseudo-aléatoire
+settings-quote-interval = Intervalle des citations
+settings-quote-interval-description = Contrôle la fréquence de rotation de la citation inférieure.
+settings-open-quotes-json = Ouvrir le JSON des citations
+settings-reset-quotes-json = Réinitialiser le JSON des citations
+settings-compatibility-description = ThinkTerm utilise sa propre configuration compatible WezTerm. Les fichiers WezTerm existants sont des sources d’import facultatives, pas un état partagé en direct.
+settings-thinkterm-config = Configuration ThinkTerm
+settings-thinkterm-config-missing = Pas encore créée ; cible : { $path }
+settings-wezterm-source = Source WezTerm
+settings-wezterm-source-missing = Aucune configuration WezTerm existante trouvée
+settings-loaded-source = Source chargée
+settings-not-loaded = Pas encore chargée
+settings-loaded-source-warnings = { $source } ({ $count } avertissements)
+settings-importable-fields = Champs importables
+settings-importable-fields-description = Choisissez précisément les valeurs de la configuration source que ThinkTerm doit copier.
+settings-no-fields-loaded = Aucun champ chargé
+settings-fields-selected = { $selected } sur { $total } sélectionnés
+settings-detected-fields = Champs détectés
+settings-load-source-description = Chargez une configuration source WezTerm pour examiner les champs importables.
+settings-load-wezterm-source = Charger la source WezTerm
+settings-import-selected = Importer la sélection
+settings-open-wezterm-source = Ouvrir la source WezTerm
+settings-open-thinkterm-config = Ouvrir la configuration ThinkTerm
+sidebar-default-space = Par défaut
+sidebar-connecting = Connexion…
+sidebar-reconnect = Reconnecter
+sidebar-new-thread = Nouvelle session
+sidebar-pinned = Épinglées
+sidebar-workspaces = Espaces de travail
+sidebar-settings = Réglages
+menu-rename-project = Renommer le projet…
+menu-new-thread = Nouvelle session
+menu-toggle-threads = Réduire / développer les sessions
+menu-remove-project = Supprimer le projet
+menu-space-occupied = { $name } (occupé)
+menu-space-remote = { $name } (distant)
+menu-new-space = Nouvel espace
+menu-rename-space = Renommer l’espace…
+menu-rename-named-space = Renommer « { $name } »…
+menu-disconnect-space = Déconnecter « { $name } » (le serveur reste actif)
+menu-delete-space = Supprimer « { $name } »
+menu-delete-space-and-sessions = Supprimer « { $name } » et terminer les sessions distantes
+menu-delete-other-space = Supprimer un autre espace
+menu-status-running = En cours
+menu-status-attention = Attention requise
+menu-status-done = Terminé
+menu-status-idle = Inactif
+menu-group-by = Regrouper par
+menu-workspace = Espace de travail
+menu-show = Afficher
+menu-status = État
+menu-no-notifications = Aucune notification
+menu-disconnect-thread = Déconnecter la session
+menu-connect-thread = Connecter la session
+menu-pin-thread = Épingler la session
+menu-unpin-thread = Désépingler la session
+menu-rename-thread = Renommer la session…
+menu-delete-thread = Supprimer la session
+menu-mark-unread = Marquer comme non lue
+menu-rename-tab = Renommer l’onglet…
+menu-close-tabs-left = Fermer les onglets à gauche
+menu-close-tabs-right = Fermer les onglets à droite
+menu-close-other-tabs = Fermer les autres onglets
+menu-move-tab-left = Déplacer l’onglet à gauche
+menu-move-tab-right = Déplacer l’onglet à droite
+menu-new-terminal-tab-right = Nouvel onglet de terminal à droite
+menu-zoom-pane = Agrandir le volet
+menu-copy = Copier
+menu-paste = Coller
+menu-cut = Couper
+menu-delete = Supprimer
+menu-select-all = Tout sélectionner
+menu-undo = Annuler
+menu-redo = Rétablir
+menu-split-right = Scinder à droite
+menu-split-left = Scinder à gauche
+menu-split-down = Scinder en bas
+menu-split-up = Scinder en haut
+menu-reset-terminal = Réinitialiser le terminal
+menu-ignore-spelling = Ignorer l’orthographe
+menu-learn-spelling = Mémoriser l’orthographe
+menu-look-up = Rechercher
+right-mode-files = Fichiers
+right-mode-notes = Notes
+right-mode-snippets = Extraits
+right-preview-truncated = Aperçu limité à 256 Kio
+right-loading-preview = Chargement de l’aperçu du fichier…
+right-window-unavailable = La fenêtre n’est pas disponible
+right-preview-error = Impossible de charger l’aperçu : { $error }
+right-open = Ouvrir
+right-copy-path = Copier le chemin
+right-rename = Renommer…
+right-move-trash = Placer dans la corbeille
+right-open-with = Ouvrir avec { $app }
+right-open-with-other = Ouvrir avec une autre application…
+right-create-vault = Créer un coffre
+right-create = Créer
+right-choose-vault = Choisir un coffre
+right-choose = Choisir
+right-source-mode = Mode source
+right-show-vault-sidebar = Afficher la barre du coffre
+right-hide-vault-sidebar = Masquer la barre du coffre
+right-show-vault = Afficher le coffre
+right-hide-vault = Masquer le coffre
+right-new-note = Nouvelle note
+right-save = Enregistrer
+right-choose-another-vault = Choisir un autre coffre…
+right-vault = Coffre
+right-notes-open-error = Impossible d’ouvrir les Notes
+right-choose-existing-vault = Choisir un coffre existant…
+right-create-new-vault = Créer un nouveau coffre…
+right-laying-out-note = Mise en page de la note…
+right-opening-note = Ouverture de la note…
+right-notes-first-use = Choisissez un coffre existant ou créez-en un pour commencer à utiliser les Notes.
+right-no-active-project = Aucun projet actif dans cet espace.
+right-indexing-vault = Indexation du coffre…
+right-not-connected = Non connecté
+right-connect = Connecter
+right-connecting = Connexion…
+right-connection-failed = Échec de la connexion
+right-retry = Réessayer
+right-remote-files = Fichiers distants
+right-loading-remote-directory = Chargement du dossier distant…
+right-more-entries = D’autres éléments ne sont pas affichés
+right-more-transfer = 1 transfert supplémentaire
+right-more-transfers = { $count } transferts supplémentaires
+right-filter-files = Filtrer les fichiers
+right-indexing-files = Indexation des fichiers…
+right-searching-files = Recherche de fichiers…
+right-no-matching-files = Aucun fichier correspondant
+right-new-snippet = Nouvel extrait
+right-search = Rechercher
+right-no-snippets = Aucun extrait
+right-no-matching-snippets = Aucun extrait correspondant
+right-edit-snippet = Modifier l’extrait
+right-snippet = Extrait
+right-personal-vault = Coffre personnel
+right-action-description = Description de l’action
+right-action-description-placeholder = Décrivez cette action
+right-script-required = Script *
+right-script-placeholder = Saisissez une commande ou un script
+right-run = Exécuter
+right-download = Télécharger
+right-new-folder = Nouveau dossier
+right-delete = Supprimer…
+right-copy-all = Tout copier
+right-dismiss = Fermer
+right-cancel = Annuler
+right-replace-conflicts = Remplacer { $count } fichiers existants
+right-skip-conflicts = Ignorer { $count } fichiers existants
+right-cancel-copy = Annuler la copie
+right-confirm-download = Télécharger { $count } éléments
+right-confirm-delete-items = Supprimer définitivement { $count } éléments
+right-confirm-delete-name = Supprimer définitivement « { $name } »
+right-confirm-upload = Envoyer { $count } éléments
+ssh-hosts-title = Hôtes SSH
+ssh-no-hosts = Aucun hôte. Cliquez sur + pour en ajouter un.
+ssh-select-host = Sélectionnez un hôte ou cliquez sur + pour en ajouter un.
+ssh-search = Rechercher des hôtes…
+ssh-system-hosts = SSH système ({ $count })
+ssh-edit-host = Modifier l’hôte
+ssh-new-host = Nouvel hôte
+ssh-field-name = Nom
+ssh-field-host = Hôte
+ssh-field-port = Port
+ssh-field-user = Utilisateur
+ssh-field-password = Mot de passe
+ssh-field-identity = Fichier d’identité
+ssh-field-workspace = Espace de travail
+ssh-group-connection = Connexion
+ssh-group-authentication = Authentification
+ssh-group-session = Session
+ssh-detect-os = Détecter le système à la connexion
+ssh-use-mosh = Se connecter avec Mosh
+ssh-use-mux = ThinkTerm Connect (mux persistant)
+ssh-advanced = Avancé (options ssh_config)
+ssh-add-option = + Ajouter une option
+ssh-save-open = Enregistrer et ouvrir
+ssh-save = Enregistrer
+ssh-cancel = Annuler
+ssh-error-host-required = L’hôte est obligatoire
+ssh-error-port-number = Le port doit être un nombre
+ssh-error-mosh-command = La commande du serveur Mosh est obligatoire
+ssh-error-host-missing = L’hôte n’existe plus
+ssh-error-save = Impossible d’enregistrer l’hôte : { $error }
+ssh-error-encrypt = Impossible de chiffrer le mot de passe : { $error }
+remote-thread-connecting-to = Connexion à { $endpoint }…
+remote-thread-not-connected = Cette session SSH n’est pas connectée.
+remote-thread-connection = Connexion
+remote-thread-project = Projet
+remote-thread-endpoint = Point de terminaison
+remote-thread-thread = Session
+remote-thread-connecting = { $frame } Connexion…
+remote-thread-transport-elapsed = Transport : { $transport } · { $seconds } s écoulées
+remote-thread-failed = La connexion a échoué.
+remote-thread-failed-detail = Transport : { $transport } · réessayez ou annulez pour fermer.
+remote-thread-mosh-detail = Démarre mosh-server via SSH, puis ouvre mosh-client.
+remote-thread-ssh-detail = Ouvre une session SSH ThinkTerm.
+remote-thread-transport = Transport : { $transport }
+remote-thread-connect = Connecter
+remote-thread-delete = Supprimer la session
+remote-thread-cancel = Annuler
+remote-thread-retry = Réessayer
+remote-thread-stale = Cette session SSH enregistrée n’existe plus.
+remote-thread-host-stale = L’hôte SSH enregistré pour cette session n’existe plus.
+menu-reveal-finder = Afficher dans le Finder
+menu-reveal-explorer = Afficher dans l’Explorateur de fichiers
+menu-reveal-folder = Afficher dans le dossier
+settings-developer-description = Gardez les réglages ordinaires simples. Activez le mode développeur pour afficher les pages internes. L’échantillonnage mémoire doit toujours être lancé manuellement.
+settings-developer-mode = Mode développeur
+settings-developer-mode-description = Affiche les pages internes de réglage de l’interface et de diagnostic mémoire.
+settings-fallback-menu = Utiliser le menu contextuel de secours
+settings-fallback-menu-description = Sur macOS, utilise le menu contextuel dessiné par l’application pour les tests locaux.
+settings-developer-tabs = Onglets développeur visibles
+settings-developer-tabs-description = Les onglets UI Kit et Mémoire/Entrée sont affichés ici ; les diagnostics ne démarrent pas automatiquement.
+settings-developer-tabs-value = UI Kit, Mémoire/Entrée
+settings-onboarding-launcher = Configuration initiale
+settings-onboarding-launcher-description = Ouvre l’assistant sans modifier la version enregistrée comme déjà vue.
+settings-onboarding-launcher-value = Accès de test manuel
+settings-disable-developer = Désactiver le mode développeur
+settings-enable-developer = Activer le mode développeur
+settings-show-onboarding = Afficher la configuration initiale
+settings-config-source-file = Fichier : { $path }
+settings-config-source-default = Aucun fichier chargé ; utilisation des valeurs intégrées
+settings-config-source-overridden = Aucun fichier chargé ; des options de ligne de commande ou --skip-config sont actives
+settings-status-saved = { $setting } enregistré.
+settings-status-save-error = Impossible d’enregistrer { $setting } : { $error }
+settings-status-value-now = { $setting } est maintenant { $value }.
+settings-status-value-reset = { $setting } a été réinitialisé à { $value }.
+settings-status-terminal-saved = Réglages du terminal enregistrés ; taille de police appliquée aux fenêtres ouvertes.
+settings-status-terminal-error = Impossible d’enregistrer les réglages du terminal : { $error }
+settings-status-quote-error = Impossible d’enregistrer la citation inférieure : { $error }
+settings-status-quote-enabled = Citation inférieure activée.
+settings-status-quote-disabled = Citation inférieure désactivée.
+settings-status-sftp-idle = Le délai d’inactivité des fichiers distants est maintenant de { $count } minutes.
+settings-status-sftp-error = Impossible d’enregistrer le délai des fichiers distants : { $error }
+settings-system-default-path = { $path } (valeur système)
+settings-no-downloads-folder = Dossier Téléchargements introuvable
+settings-download-picker-title = Choisir un dossier de téléchargement
+settings-status-download-path = Les téléchargements sont enregistrés dans { $path }
+settings-status-download-error = Impossible d’enregistrer le dossier de téléchargement : { $error }
+settings-status-window-restore-on = Restauration de la taille et position activée pour les nouvelles fenêtres macOS.
+settings-status-window-restore-off = Restauration de la taille et position désactivée pour les nouvelles fenêtres macOS.
+settings-status-window-restore-error = Impossible d’enregistrer la restauration de fenêtre : { $error }
+settings-status-renderer = Moteur de rendu principal défini sur { $renderer } ; redémarrez ThinkTerm pour l’appliquer.
+settings-status-renderer-error = Impossible d’enregistrer le moteur de rendu : { $error }
+settings-status-restarting = Redémarrage de ThinkTerm…
+settings-status-restart-error = Impossible de redémarrer ThinkTerm : { $error }
+settings-status-quitting = Fermeture de ThinkTerm…
+settings-status-opening-quotes = Ouverture du JSON des citations : { $path }
+settings-status-open-quotes-error = Impossible de préparer le JSON des citations : { $error }
+settings-status-reset-quotes = JSON des citations réinitialisé : { $path }
+settings-status-reset-quotes-error = Impossible de réinitialiser le JSON des citations : { $error }
+settings-status-app-icon = L’icône de l’application est maintenant { $icon }.
+settings-status-app-icon-error = Impossible d’enregistrer l’icône : { $error }
diff --git a/wezterm-gui/i18n/ja-JP.ftl b/wezterm-gui/i18n/ja-JP.ftl
new file mode 100644
index 00000000..ec8511f2
--- /dev/null
+++ b/wezterm-gui/i18n/ja-JP.ftl
@@ -0,0 +1,363 @@
+language-system = システム設定に従う
+language-system-resolved = システム設定に従う({ $language })
+settings-window-title = ThinkTerm 設定
+settings-language = 言語
+settings-language-description = ThinkTerm のインターフェース言語をすぐに変更します。
+settings-language-changed = インターフェース言語を{ $language }に変更しました。
+settings-language-save-error = 言語設定を保存できません:{ $error }
+common-on = オン
+common-off = オフ
+common-hidden = 非表示
+common-file = ファイル
+common-defaults = デフォルト
+common-found = 検出済み
+common-missing = 見つかりません
+common-error = エラー
+common-parsed = 解析済み
+common-idle = 待機中
+common-empty = 空
+common-independent = 独立
+common-required = 必要
+common-not-required = 不要
+common-choose = 選択…
+common-reset = リセット
+common-clear = クリア
+common-select-all = すべて選択
+common-minutes = { $count } 分
+common-points = { $value } pt
+settings-section-general = 一般
+settings-section-appearance = 外観
+settings-section-terminal = ターミナル
+settings-section-workspaces = ワークスペース
+settings-section-keymap = キーマップ
+settings-section-compatibility = 互換性
+settings-section-developer = 開発者
+settings-section-about = 情報
+settings-search-placeholder = 設定を検索…
+settings-search-no-results = 設定が見つかりません
+settings-keymap-description = キーボードショートカットとコマンドパレットのアクションです。
+settings-about-description = ThinkTerm のバージョン、プロジェクト情報、アプリのメタデータです。
+settings-general-heading = 構成
+settings-config-source = 構成元
+settings-native-settings = ThinkTerm ネイティブ設定
+settings-native-settings-default = デフォルトを使用中。任意のファイル:{ $path }
+settings-native-settings-description = ThinkTerm 固有の小さな状態です。ターミナル設定は ThinkTerm 独自の thinkterm.lua に保存されます。
+settings-theme-mode = テーマモード
+settings-theme-description = ThinkTerm ネイティブウィンドウの外観設定です。
+settings-theme-system = システム
+settings-theme-light = ライト
+settings-theme-dark = ダーク
+settings-theme-changed = テーマモードを{ $mode}に変更しました。
+settings-theme-save-error = テーマモードを保存できません:{ $error }
+settings-main-renderer = メインウィンドウのレンダラー
+settings-main-renderer-description = 再起動後にメインターミナルウィンドウへ適用します。
+settings-restore-window-frame = メインウィンドウの位置とサイズを復元
+settings-restore-window-frame-description = macOS で前回のメインターミナルウィンドウのサイズと位置を復元します。
+settings-restart = 再起動
+settings-restart-app = ThinkTerm を再起動
+settings-restart-status = レンダラー変更の状態:{ $status }。
+settings-quit = 終了
+settings-quit-description = すべての ThinkTerm ウィンドウを閉じてアプリを終了します。
+settings-quit-app = ThinkTerm を終了
+settings-appearance-theme-heading = テーマ
+settings-app-icon = アプリアイコン
+settings-app-icon-description = 実行中の Dock とアプリスイッチャーのアイコンを変更します。
+settings-app-icon-note = 現在は macOS のみ対応しています。
+settings-app-icon-simple = シンプル
+settings-app-icon-classic = クラシック
+settings-effective-color-scheme = 有効なカラースキーム
+settings-effective-color-scheme-description = WezTerm 互換の構成経路を通じて決定されます。
+settings-typography-heading = タイポグラフィ
+settings-font-size-settings = 設定 UI のフォントサイズ
+settings-font-size-settings-description = 設定ウィンドウの外枠と本文を調整します。
+settings-font-size-home = ホームのフォントサイズ
+settings-font-size-home-description = メインのホーム/コンテンツビューを調整します。
+settings-font-size-right-sidebar = 右サイドバーのフォントサイズ
+settings-font-size-right-sidebar-description = 未設定時はホームに従います。ファイル、ノート、スニペットのパネル用です。
+settings-font-size-workspace-sidebar = ワークスペースサイドバーのフォントサイズ
+settings-font-size-workspace-sidebar-description = メインのワークスペースサイドバー用に個別保存します。
+settings-font-size-tab-bar = タブバーのフォントサイズ
+settings-font-size-tab-bar-description = 上部のターミナルタブバー用に個別保存します。
+settings-font-size-pane-header = ペインヘッダーのフォントサイズ
+settings-font-size-pane-header-description = 分割ペインのヘッダーラベル用に個別保存します。
+settings-font-weight = 設定 UI のフォントウェイト
+settings-font-weight-description = 設定ウィンドウの外枠と本文の太さを調整します。
+settings-workspaces-heading = リモートファイル
+settings-sftp-idle = リモートファイル接続のアイドルタイムアウト
+settings-sftp-idle-description = 未使用の SFTP セッションを切断し、ディレクトリとプレビューのデータをすぐ解放します。
+settings-download-folder = ダウンロードフォルダー
+settings-system-download-folder = システムのダウンロードフォルダーを使用
+settings-system-download-folder-description = 選択したフォルダーを解除し、このコンピューターの設定に従います。
+settings-remote-drop-destination = リモートへのドロップ先
+settings-remote-drop-destination-description = リモートターミナルへドロップしたファイルのアップロード先です。cwd でシェルの現在のディレクトリを指定できます。
+settings-terminal-heading = 有効なターミナル設定
+settings-terminal-font-size = フォントサイズ
+settings-terminal-font-size-description = WezTerm 互換設定から得た現在の有効値です。
+settings-terminal-font-family = フォントファミリー
+settings-terminal-font-family-description = 現在の主要なターミナルフォントです。
+settings-terminal-native-font-size = ThinkTerm のフォントサイズ
+settings-terminal-native-font-size-description = ローカルに保存し、開いているターミナルウィンドウへすぐ適用します。
+settings-terminal-native-font-family = ネイティブフォントファミリー
+settings-terminal-native-font-family-description = ローカルのクイック設定案です。保存とターミナルへの適用は未対応です。
+settings-bottom-quote = 下部の引用文
+settings-bottom-quote-description = 既存の下部余白に短い引用文を表示します。
+settings-quote-font-size = 引用文のフォントサイズ
+settings-quote-font-size-description = 引用文の文字だけを変更し、余白の高さは変えません。
+settings-quote-rotation = 引用文の切り替え
+settings-quote-rotation-description = 時間指定は順番に、疑似ランダムは間隔ごとに安定した引用文を選びます。
+settings-quote-mode-timed = 時間指定
+settings-quote-mode-random = 疑似ランダム
+settings-quote-interval = 引用文の間隔
+settings-quote-interval-description = 下部の引用文を切り替える頻度を調整します。
+settings-open-quotes-json = 引用文 JSON を開く
+settings-reset-quotes-json = 引用文 JSON をリセット
+settings-compatibility-description = ThinkTerm は独自の WezTerm 互換設定を使用します。既存の WezTerm ファイルは任意のインポート元であり、状態をリアルタイム共有しません。
+settings-thinkterm-config = ThinkTerm 設定
+settings-thinkterm-config-missing = 未作成です。作成先:{ $path }
+settings-wezterm-source = WezTerm ソース
+settings-wezterm-source-missing = 既存の WezTerm 設定が見つかりません
+settings-loaded-source = 読み込んだソース
+settings-not-loaded = 未読み込み
+settings-loaded-source-warnings = { $source }(警告 { $count } 件)
+settings-importable-fields = インポート可能な項目
+settings-importable-fields-description = ThinkTerm にコピーする元設定の値を正確に選択します。
+settings-no-fields-loaded = 項目が読み込まれていません
+settings-fields-selected = { $total } 件中 { $selected } 件を選択
+settings-detected-fields = 検出した項目
+settings-load-source-description = WezTerm の元設定を読み込み、インポート可能な項目を確認します。
+settings-load-wezterm-source = WezTerm ソースを読み込む
+settings-import-selected = 選択項目をインポート
+settings-open-wezterm-source = WezTerm ソースを開く
+settings-open-thinkterm-config = ThinkTerm 設定を開く
+sidebar-default-space = デフォルト
+sidebar-connecting = 接続中…
+sidebar-reconnect = 再接続
+sidebar-new-thread = 新しいセッション
+sidebar-pinned = ピン留め
+sidebar-workspaces = ワークスペース
+sidebar-settings = 設定
+menu-rename-project = プロジェクト名を変更…
+menu-new-thread = 新しいセッション
+menu-toggle-threads = セッションを折りたたむ/展開
+menu-remove-project = プロジェクトを削除
+menu-space-occupied = { $name }(使用中)
+menu-space-remote = { $name }(リモート)
+menu-new-space = 新しいスペース
+menu-rename-space = スペース名を変更…
+menu-rename-named-space = 「{ $name }」の名前を変更…
+menu-disconnect-space = 「{ $name }」を切断(サーバーは実行を継続)
+menu-delete-space = 「{ $name }」を削除
+menu-delete-space-and-sessions = 「{ $name }」を削除してリモートセッションを終了
+menu-delete-other-space = 別のスペースを削除
+menu-status-running = 実行中
+menu-status-attention = 要確認
+menu-status-done = 完了
+menu-status-idle = 待機中
+menu-group-by = グループ化
+menu-workspace = ワークスペース
+menu-show = 表示
+menu-status = 状態
+menu-no-notifications = 通知はありません
+menu-disconnect-thread = セッションを切断
+menu-connect-thread = セッションに接続
+menu-pin-thread = セッションをピン留め
+menu-unpin-thread = セッションのピン留めを解除
+menu-rename-thread = セッション名を変更…
+menu-delete-thread = セッションを削除
+menu-mark-unread = 未読にする
+menu-rename-tab = タブ名を変更…
+menu-close-tabs-left = 左側のタブを閉じる
+menu-close-tabs-right = 右側のタブを閉じる
+menu-close-other-tabs = 他のタブを閉じる
+menu-move-tab-left = タブを左へ移動
+menu-move-tab-right = タブを右へ移動
+menu-new-terminal-tab-right = 右側に新しいターミナルタブ
+menu-zoom-pane = ペインを拡大
+menu-copy = コピー
+menu-paste = ペースト
+menu-cut = カット
+menu-delete = 削除
+menu-select-all = すべて選択
+menu-undo = 元に戻す
+menu-redo = やり直す
+menu-split-right = 右に分割
+menu-split-left = 左に分割
+menu-split-down = 下に分割
+menu-split-up = 上に分割
+menu-reset-terminal = ターミナルをリセット
+menu-ignore-spelling = スペルを無視
+menu-learn-spelling = スペルを学習
+menu-look-up = 調べる
+right-mode-files = ファイル
+right-mode-notes = ノート
+right-mode-snippets = スニペット
+right-preview-truncated = プレビューは 256 KiB で切り詰められました
+right-loading-preview = ファイルプレビューを読み込み中…
+right-window-unavailable = ウィンドウを利用できません
+right-preview-error = ファイルプレビューを読み込めません:{ $error }
+right-open = 開く
+right-copy-path = パスをコピー
+right-rename = 名前を変更…
+right-move-trash = ゴミ箱に入れる
+right-open-with = { $app } で開く
+right-open-with-other = 別のアプリで開く…
+right-create-vault = 保管庫を作成
+right-create = 作成
+right-choose-vault = 保管庫を選択
+right-choose = 選択
+right-source-mode = ソースモード
+right-show-vault-sidebar = 保管庫サイドバーを表示
+right-hide-vault-sidebar = 保管庫サイドバーを非表示
+right-show-vault = 保管庫を表示
+right-hide-vault = 保管庫を非表示
+right-new-note = 新しいノート
+right-save = 保存
+right-choose-another-vault = 別の保管庫を選択…
+right-vault = 保管庫
+right-notes-open-error = ノートを開けません
+right-choose-existing-vault = 既存の保管庫を選択…
+right-create-new-vault = 新しい保管庫を作成…
+right-laying-out-note = ノートをレイアウト中…
+right-opening-note = ノートを開いています…
+right-notes-first-use = 既存の保管庫を選択するか、新規作成してノートを始めてください。
+right-no-active-project = このスペースにアクティブなプロジェクトがありません。
+right-indexing-vault = 保管庫を索引中…
+right-not-connected = 未接続
+right-connect = 接続
+right-connecting = 接続中…
+right-connection-failed = 接続に失敗しました
+right-retry = 再試行
+right-remote-files = リモートファイル
+right-loading-remote-directory = リモートディレクトリを読み込み中…
+right-more-entries = その他の項目は表示されません
+right-more-transfer = 他 1 件の転送
+right-more-transfers = 他 { $count } 件の転送
+right-filter-files = ファイルを絞り込む
+right-indexing-files = ファイルを索引中…
+right-searching-files = ファイルを検索中…
+right-no-matching-files = 一致するファイルはありません
+right-new-snippet = 新しいスニペット
+right-search = 検索
+right-no-snippets = スニペットはありません
+right-no-matching-snippets = 一致するスニペットはありません
+right-edit-snippet = スニペットを編集
+right-snippet = スニペット
+right-personal-vault = 個人用保管庫
+right-action-description = アクションの説明
+right-action-description-placeholder = このアクションを説明
+right-script-required = スクリプト *
+right-script-placeholder = コマンドまたはスクリプトを入力
+right-run = 実行
+right-download = ダウンロード
+right-new-folder = 新しいフォルダー
+right-delete = 削除…
+right-copy-all = すべてコピー
+right-dismiss = 閉じる
+right-cancel = キャンセル
+right-replace-conflicts = 既存のファイル { $count } 件を置換
+right-skip-conflicts = 既存のファイル { $count } 件をスキップ
+right-cancel-copy = コピーをキャンセル
+right-confirm-download = { $count } 項目をダウンロード
+right-confirm-delete-items = { $count } 項目を完全に削除
+right-confirm-delete-name = 「{ $name }」を完全に削除
+right-confirm-upload = { $count } 項目をアップロード
+ssh-hosts-title = SSH ホスト
+ssh-no-hosts = ホストはまだありません。+ をクリックして追加してください。
+ssh-select-host = ホストを選択するか、+ をクリックして追加してください。
+ssh-search = ホストを検索…
+ssh-system-hosts = システム SSH({ $count })
+ssh-edit-host = ホストを編集
+ssh-new-host = 新しいホスト
+ssh-field-name = 名前
+ssh-field-host = ホスト
+ssh-field-port = ポート
+ssh-field-user = ユーザー
+ssh-field-password = パスワード
+ssh-field-identity = Identity ファイル
+ssh-field-workspace = ワークスペース
+ssh-group-connection = 接続
+ssh-group-authentication = 認証
+ssh-group-session = セッション
+ssh-detect-os = 接続時に OS を検出
+ssh-use-mosh = Mosh で接続
+ssh-use-mux = ThinkTerm Connect(永続 mux)
+ssh-advanced = 詳細(ssh_config オプション)
+ssh-add-option = + オプションを追加
+ssh-save-open = 保存して開く
+ssh-save = 保存
+ssh-cancel = キャンセル
+ssh-error-host-required = ホストは必須です
+ssh-error-port-number = ポートは数値で入力してください
+ssh-error-mosh-command = Mosh サーバーコマンドは必須です
+ssh-error-host-missing = ホストは存在しません
+ssh-error-save = ホストを保存できません:{ $error }
+ssh-error-encrypt = パスワードを暗号化できません:{ $error }
+remote-thread-connecting-to = { $endpoint } に接続中…
+remote-thread-not-connected = この SSH セッションは接続されていません。
+remote-thread-connection = 接続
+remote-thread-project = プロジェクト
+remote-thread-endpoint = エンドポイント
+remote-thread-thread = セッション
+remote-thread-connecting = { $frame } 接続中…
+remote-thread-transport-elapsed = トランスポート:{ $transport } · 経過 { $seconds } 秒
+remote-thread-failed = 接続に失敗しました。
+remote-thread-failed-detail = トランスポート:{ $transport } · 再試行するか、キャンセルして閉じてください。
+remote-thread-mosh-detail = SSH 経由で mosh-server を起動し、mosh-client を開きます。
+remote-thread-ssh-detail = ThinkTerm SSH セッションを開きます。
+remote-thread-transport = トランスポート:{ $transport }
+remote-thread-connect = 接続
+remote-thread-delete = セッションを削除
+remote-thread-cancel = キャンセル
+remote-thread-retry = 再試行
+remote-thread-stale = 保存済みの SSH セッションは存在しません。
+remote-thread-host-stale = このセッションに保存された SSH ホストは存在しません。
+menu-reveal-finder = Finder に表示
+menu-reveal-explorer = エクスプローラーに表示
+menu-reveal-folder = フォルダーに表示
+settings-developer-description = 通常の設定をすっきり保ちます。開発者モードを有効にすると内部ページが表示されます。メモリ採取は引き続き手動で開始します。
+settings-developer-mode = 開発者モード
+settings-developer-mode-description = UI 調整とメモリ診断用の内部設定ページを表示します。
+settings-fallback-menu = 代替コンテキストメニューを使用
+settings-fallback-menu-description = macOS の右クリックメニューをアプリ描画版に切り替え、ローカルテストに使用します。
+settings-developer-tabs = 表示する開発者タブ
+settings-developer-tabs-description = UI Kit とメモリ/入力タブを表示します。診断は自動実行されません。
+settings-developer-tabs-value = UI Kit、メモリ/入力
+settings-onboarding-launcher = 初期設定
+settings-onboarding-launcher-description = 保存済みの完了バージョンを変えずに設定ウィザードを開きます。
+settings-onboarding-launcher-value = 手動テスト入口
+settings-disable-developer = 開発者モードを無効化
+settings-enable-developer = 開発者モードを有効化
+settings-show-onboarding = 初期設定を今すぐ表示
+settings-config-source-file = ファイル:{ $path }
+settings-config-source-default = 設定ファイルは未読み込みです。内蔵デフォルトを使用しています
+settings-config-source-overridden = 設定ファイルは未読み込みです。コマンドラインの上書きまたは --skip-config が有効です
+settings-status-saved = { $setting }を保存しました。
+settings-status-save-error = { $setting }を保存できません:{ $error }
+settings-status-value-now = { $setting }を{ $value }に変更しました。
+settings-status-value-reset = { $setting }を{ $value }にリセットしました。
+settings-status-terminal-saved = ターミナル設定を保存し、開いているウィンドウにフォントサイズを適用しました。
+settings-status-terminal-error = ターミナル設定を保存できません:{ $error }
+settings-status-quote-error = 下部の引用文設定を保存できません:{ $error }
+settings-status-quote-enabled = 下部の引用文を有効にしました。
+settings-status-quote-disabled = 下部の引用文を無効にしました。
+settings-status-sftp-idle = リモートファイルのアイドルタイムアウトは { $count } 分です。
+settings-status-sftp-error = リモートファイルのアイドルタイムアウトを保存できません:{ $error }
+settings-system-default-path = { $path }(システムのデフォルト)
+settings-no-downloads-folder = ダウンロードフォルダーが見つかりません
+settings-download-picker-title = ダウンロードフォルダーを選択
+settings-status-download-path = ダウンロードの保存先:{ $path }
+settings-status-download-error = ダウンロードフォルダーを保存できません:{ $error }
+settings-status-window-restore-on = 新しい macOS ウィンドウで位置とサイズの復元を有効にしました。
+settings-status-window-restore-off = 新しい macOS ウィンドウで位置とサイズの復元を無効にしました。
+settings-status-window-restore-error = ウィンドウ復元設定を保存できません:{ $error }
+settings-status-renderer = メインウィンドウのレンダラーを { $renderer } に設定しました。ThinkTerm の再起動後に適用されます。
+settings-status-renderer-error = レンダラー設定を保存できません:{ $error }
+settings-status-restarting = ThinkTerm を再起動しています…
+settings-status-restart-error = ThinkTerm を再起動できません:{ $error }
+settings-status-quitting = ThinkTerm を終了しています…
+settings-status-opening-quotes = 下部の引用文 JSON を開いています:{ $path }
+settings-status-open-quotes-error = 下部の引用文 JSON を準備できません:{ $error }
+settings-status-reset-quotes = 下部の引用文 JSON をリセットしました:{ $path }
+settings-status-reset-quotes-error = 下部の引用文 JSON をリセットできません:{ $error }
+settings-status-app-icon = アプリアイコンを{ $icon }に変更しました。
+settings-status-app-icon-error = アプリアイコンを保存できません:{ $error }
diff --git a/wezterm-gui/i18n/zh-CN.ftl b/wezterm-gui/i18n/zh-CN.ftl
new file mode 100644
index 00000000..ced33e29
--- /dev/null
+++ b/wezterm-gui/i18n/zh-CN.ftl
@@ -0,0 +1,363 @@
+language-system = 跟随系统
+language-system-resolved = 跟随系统({ $language })
+settings-window-title = ThinkTerm 设置
+settings-language = 语言
+settings-language-description = 立即更改 ThinkTerm 界面的显示语言。
+settings-language-changed = 界面语言已切换为{ $language }。
+settings-language-save-error = 无法保存语言设置:{ $error }
+common-on = 开
+common-off = 关
+common-hidden = 已隐藏
+common-file = 文件
+common-defaults = 默认值
+common-found = 已找到
+common-missing = 缺失
+common-error = 错误
+common-parsed = 已解析
+common-idle = 空闲
+common-empty = 空
+common-independent = 独立
+common-required = 需要
+common-not-required = 不需要
+common-choose = 选择…
+common-reset = 重置
+common-clear = 清除
+common-select-all = 全选
+common-minutes = { $count } 分钟
+common-points = { $value } 磅
+settings-section-general = 通用
+settings-section-appearance = 外观
+settings-section-terminal = 终端
+settings-section-workspaces = 工作区
+settings-section-keymap = 快捷键
+settings-section-compatibility = 兼容性
+settings-section-developer = 开发者
+settings-section-about = 关于
+settings-search-placeholder = 搜索设置…
+settings-search-no-results = 未找到设置
+settings-keymap-description = 键盘快捷键和命令面板操作。
+settings-about-description = ThinkTerm 版本、项目信息和应用元数据。
+settings-general-heading = 配置
+settings-config-source = 配置来源
+settings-native-settings = ThinkTerm 原生设置
+settings-native-settings-default = 使用默认值;可选文件位于 { $path }
+settings-native-settings-description = 少量 ThinkTerm 原生状态;终端配置仍保存在 ThinkTerm 自己的 thinkterm.lua 中。
+settings-theme-mode = 主题模式
+settings-theme-description = ThinkTerm 原生窗口外观偏好。
+settings-theme-system = 跟随系统
+settings-theme-light = 浅色
+settings-theme-dark = 深色
+settings-theme-changed = 主题模式已切换为{ $mode }。
+settings-theme-save-error = 无法保存主题模式:{ $error }
+settings-main-renderer = 主窗口渲染器
+settings-main-renderer-description = 重启后应用于主终端窗口。
+settings-restore-window-frame = 恢复主窗口位置与大小
+settings-restore-window-frame-description = macOS 会恢复上次主终端窗口的大小和位置。
+settings-restart = 重启
+settings-restart-app = 重启 ThinkTerm
+settings-restart-status = 渲染器更改状态:{ $status }。
+settings-quit = 退出
+settings-quit-description = 关闭所有 ThinkTerm 窗口并退出应用。
+settings-quit-app = 退出 ThinkTerm
+settings-appearance-theme-heading = 主题
+settings-app-icon = 应用图标
+settings-app-icon-description = 更改当前程序坞和应用切换器中的图标。
+settings-app-icon-note = 目前仅支持 macOS。
+settings-app-icon-simple = 简约
+settings-app-icon-classic = 经典
+settings-effective-color-scheme = 当前配色方案
+settings-effective-color-scheme-description = 通过 WezTerm 兼容配置解析。
+settings-typography-heading = 字体排版
+settings-font-size-settings = 设置界面字号
+settings-font-size-settings-description = 控制设置窗口框架和内容文字。
+settings-font-size-home = 主页字号
+settings-font-size-home-description = 控制主主页和内容视图文字。
+settings-font-size-right-sidebar = 右侧栏字号
+settings-font-size-right-sidebar-description = 未单独设置时跟随主页字号——用于文件、笔记和片段面板。
+settings-font-size-workspace-sidebar = 工作区侧栏字号
+settings-font-size-workspace-sidebar-description = 单独保存,用于主工作区侧栏。
+settings-font-size-tab-bar = 标签栏字号
+settings-font-size-tab-bar-description = 单独保存,用于终端顶部标签栏。
+settings-font-size-pane-header = 窗格标题字号
+settings-font-size-pane-header-description = 单独保存,用于分屏窗格标题。
+settings-font-weight = 设置界面字重
+settings-font-weight-description = 控制设置窗口框架和内容文字的粗细。
+settings-workspaces-heading = 远程文件
+settings-sftp-idle = 远程文件连接空闲超时
+settings-sftp-idle-description = 断开未使用的 SFTP 会话,并立即释放目录和预览数据。
+settings-download-folder = 下载文件夹
+settings-system-download-folder = 使用系统下载文件夹
+settings-system-download-folder-description = 清除所选文件夹,让下载遵循此电脑的系统设置。
+settings-remote-drop-destination = 远程拖放目标
+settings-remote-drop-destination-description = 拖到远程终端的文件上传位置。使用 cwd 表示 shell 当前目录。
+settings-terminal-heading = 当前终端配置
+settings-terminal-font-size = 字号
+settings-terminal-font-size-description = WezTerm 兼容配置中的当前有效值。
+settings-terminal-font-family = 字体
+settings-terminal-font-family-description = 当前主要终端字体。
+settings-terminal-native-font-size = ThinkTerm 字号
+settings-terminal-native-font-size-description = 本地保存,并立即应用于已打开的终端窗口。
+settings-terminal-native-font-family = 原生字体
+settings-terminal-native-font-family-description = 本地快速设置草稿;保存和应用到终端的功能尚未完成。
+settings-bottom-quote = 底部语录
+settings-bottom-quote-description = 在现有底部留白中显示一条小语录。
+settings-quote-font-size = 语录字号
+settings-quote-font-size-description = 只更改语录文字大小,不改变底部留白高度。
+settings-quote-rotation = 语录轮换
+settings-quote-rotation-description = 定时模式按顺序轮换;伪随机模式在每个间隔内固定选择一条。
+settings-quote-mode-timed = 定时
+settings-quote-mode-random = 伪随机
+settings-quote-interval = 语录间隔
+settings-quote-interval-description = 控制底部语录的轮换频率。
+settings-open-quotes-json = 打开语录 JSON
+settings-reset-quotes-json = 重置语录 JSON
+settings-compatibility-description = ThinkTerm 使用自己兼容 WezTerm 的配置。现有 WezTerm 文件仅作为可选导入来源,不会实时共享状态。
+settings-thinkterm-config = ThinkTerm 配置
+settings-thinkterm-config-missing = 尚未创建;目标位置为 { $path }
+settings-wezterm-source = WezTerm 来源
+settings-wezterm-source-missing = 未找到现有 WezTerm 配置
+settings-loaded-source = 已加载来源
+settings-not-loaded = 尚未加载
+settings-loaded-source-warnings = { $source }({ $count } 个警告)
+settings-importable-fields = 可导入字段
+settings-importable-fields-description = 精确选择 ThinkTerm 要复制的来源配置值。
+settings-no-fields-loaded = 未加载字段
+settings-fields-selected = 已选择 { $selected }/{ $total }
+settings-detected-fields = 检测到的字段
+settings-load-source-description = 加载 WezTerm 来源配置以查看可导入字段。
+settings-load-wezterm-source = 加载 WezTerm 来源
+settings-import-selected = 导入所选项
+settings-open-wezterm-source = 打开 WezTerm 来源
+settings-open-thinkterm-config = 打开 ThinkTerm 配置
+sidebar-default-space = 默认
+sidebar-connecting = 正在连接…
+sidebar-reconnect = 重新连接
+sidebar-new-thread = 新建会话
+sidebar-pinned = 已置顶
+sidebar-workspaces = 工作区
+sidebar-settings = 设置
+menu-rename-project = 重命名项目…
+menu-new-thread = 新建会话
+menu-toggle-threads = 折叠 / 展开会话
+menu-remove-project = 移除项目
+menu-space-occupied = { $name }(已被占用)
+menu-space-remote = { $name }(远程)
+menu-new-space = 新建空间
+menu-rename-space = 重命名空间…
+menu-rename-named-space = 重命名“{ $name }”…
+menu-disconnect-space = 断开“{ $name }”(服务器继续运行)
+menu-delete-space = 删除“{ $name }”
+menu-delete-space-and-sessions = 删除“{ $name }”并结束远程会话
+menu-delete-other-space = 删除其他空间
+menu-status-running = 运行中
+menu-status-attention = 需要关注
+menu-status-done = 已完成
+menu-status-idle = 空闲
+menu-group-by = 分组方式
+menu-workspace = 工作区
+menu-show = 显示
+menu-status = 状态
+menu-no-notifications = 没有通知
+menu-disconnect-thread = 断开会话
+menu-connect-thread = 连接会话
+menu-pin-thread = 置顶会话
+menu-unpin-thread = 取消置顶会话
+menu-rename-thread = 重命名会话…
+menu-delete-thread = 删除会话
+menu-mark-unread = 标记为未读
+menu-rename-tab = 重命名标签页…
+menu-close-tabs-left = 关闭左侧标签页
+menu-close-tabs-right = 关闭右侧标签页
+menu-close-other-tabs = 关闭其他标签页
+menu-move-tab-left = 标签页左移
+menu-move-tab-right = 标签页右移
+menu-new-terminal-tab-right = 在右侧新建终端标签页
+menu-zoom-pane = 放大窗格
+menu-copy = 复制
+menu-paste = 粘贴
+menu-cut = 剪切
+menu-delete = 删除
+menu-select-all = 全选
+menu-undo = 撤销
+menu-redo = 重做
+menu-split-right = 向右分屏
+menu-split-left = 向左分屏
+menu-split-down = 向下分屏
+menu-split-up = 向上分屏
+menu-reset-terminal = 重置终端
+menu-ignore-spelling = 忽略拼写
+menu-learn-spelling = 记住拼写
+menu-look-up = 查询
+right-mode-files = 文件
+right-mode-notes = 笔记
+right-mode-snippets = 片段
+right-preview-truncated = 预览已截断至 256 KiB
+right-loading-preview = 正在加载文件预览…
+right-window-unavailable = 窗口不可用
+right-preview-error = 无法加载文件预览:{ $error }
+right-open = 打开
+right-copy-path = 复制路径
+right-rename = 重命名…
+right-move-trash = 移到废纸篓
+right-open-with = 使用 { $app } 打开
+right-open-with-other = 使用其他应用打开…
+right-create-vault = 创建库
+right-create = 创建
+right-choose-vault = 选择库
+right-choose = 选择
+right-source-mode = 源码模式
+right-show-vault-sidebar = 显示库侧栏
+right-hide-vault-sidebar = 隐藏库侧栏
+right-show-vault = 显示库
+right-hide-vault = 隐藏库
+right-new-note = 新建笔记
+right-save = 保存
+right-choose-another-vault = 选择其他库…
+right-vault = 库
+right-notes-open-error = 无法打开笔记
+right-choose-existing-vault = 选择现有库…
+right-create-new-vault = 新建库…
+right-laying-out-note = 正在排版笔记…
+right-opening-note = 正在打开笔记…
+right-notes-first-use = 选择现有库或新建库以开始使用笔记。
+right-no-active-project = 此空间中没有活动项目。
+right-indexing-vault = 正在索引库…
+right-not-connected = 未连接
+right-connect = 连接
+right-connecting = 正在连接…
+right-connection-failed = 连接失败
+right-retry = 重试
+right-remote-files = 远程文件
+right-loading-remote-directory = 正在加载远程目录…
+right-more-entries = 更多条目未显示
+right-more-transfer = 还有 1 项传输
+right-more-transfers = 还有 { $count } 项传输
+right-filter-files = 筛选文件
+right-indexing-files = 正在索引文件…
+right-searching-files = 正在搜索文件…
+right-no-matching-files = 没有匹配的文件
+right-new-snippet = 新建片段
+right-search = 搜索
+right-no-snippets = 没有片段
+right-no-matching-snippets = 没有匹配的片段
+right-edit-snippet = 编辑片段
+right-snippet = 片段
+right-personal-vault = 个人库
+right-action-description = 操作说明
+right-action-description-placeholder = 描述此操作
+right-script-required = 脚本 *
+right-script-placeholder = 输入命令或脚本
+right-run = 运行
+right-download = 下载
+right-new-folder = 新建文件夹
+right-delete = 删除…
+right-copy-all = 全部复制
+right-dismiss = 关闭
+right-cancel = 取消
+right-replace-conflicts = 替换 { $count } 个现有文件
+right-skip-conflicts = 跳过 { $count } 个现有文件
+right-cancel-copy = 取消复制
+right-confirm-download = 下载 { $count } 个项目
+right-confirm-delete-items = 永久删除 { $count } 个项目
+right-confirm-delete-name = 永久删除“{ $name }”
+right-confirm-upload = 上传 { $count } 个项目
+ssh-hosts-title = SSH 主机
+ssh-no-hosts = 还没有主机。点击 + 添加。
+ssh-select-host = 选择主机,或点击 + 新建。
+ssh-search = 搜索主机…
+ssh-system-hosts = 系统 SSH({ $count })
+ssh-edit-host = 编辑主机
+ssh-new-host = 新建主机
+ssh-field-name = 名称
+ssh-field-host = 主机
+ssh-field-port = 端口
+ssh-field-user = 用户
+ssh-field-password = 密码
+ssh-field-identity = 身份文件
+ssh-field-workspace = 工作区
+ssh-group-connection = 连接
+ssh-group-authentication = 身份验证
+ssh-group-session = 会话
+ssh-detect-os = 连接时检测操作系统
+ssh-use-mosh = 使用 Mosh 连接
+ssh-use-mux = ThinkTerm Connect(持久 mux)
+ssh-advanced = 高级(ssh_config 选项)
+ssh-add-option = + 添加选项
+ssh-save-open = 保存并打开
+ssh-save = 保存
+ssh-cancel = 取消
+ssh-error-host-required = 必须填写主机
+ssh-error-port-number = 端口必须是数字
+ssh-error-mosh-command = 必须填写 Mosh 服务器命令
+ssh-error-host-missing = 主机已不存在
+ssh-error-save = 无法保存主机:{ $error }
+ssh-error-encrypt = 无法加密密码:{ $error }
+remote-thread-connecting-to = 正在连接到 { $endpoint }…
+remote-thread-not-connected = 此 SSH 会话尚未连接。
+remote-thread-connection = 连接
+remote-thread-project = 项目
+remote-thread-endpoint = 端点
+remote-thread-thread = 会话
+remote-thread-connecting = { $frame } 正在连接…
+remote-thread-transport-elapsed = 传输方式:{ $transport } · 已用 { $seconds } 秒
+remote-thread-failed = 连接失败。
+remote-thread-failed-detail = 传输方式:{ $transport } · 可重试,或取消并关闭。
+remote-thread-mosh-detail = 通过 SSH 启动 mosh-server,然后打开 mosh-client。
+remote-thread-ssh-detail = 打开 ThinkTerm SSH 会话。
+remote-thread-transport = 传输方式:{ $transport }
+remote-thread-connect = 连接
+remote-thread-delete = 删除会话
+remote-thread-cancel = 取消
+remote-thread-retry = 重试
+remote-thread-stale = 此已保存的 SSH 会话已不存在。
+remote-thread-host-stale = 此会话所保存的 SSH 主机已不存在。
+menu-reveal-finder = 在访达中显示
+menu-reveal-explorer = 在文件资源管理器中显示
+menu-reveal-folder = 在文件夹中显示
+settings-developer-description = 保持普通设置简洁。启用开发者模式可显示内部页面;内存采样仍需手动开始。
+settings-developer-mode = 开发者模式
+settings-developer-mode-description = 显示用于 UI 调整和内存诊断的内部设置页面。
+settings-fallback-menu = 使用备用上下文菜单
+settings-fallback-menu-description = 在 macOS 上将右键菜单切换为应用内绘制版本,以便本地测试。
+settings-developer-tabs = 可见的开发者标签页
+settings-developer-tabs-description = 此处会显示 UI Kit 和内存/输入标签页;诊断不会自动运行。
+settings-developer-tabs-value = UI Kit、内存/输入
+settings-onboarding-launcher = 初始设置
+settings-onboarding-launcher-description = 打开设置向导,但不更改已保存的完成版本。
+settings-onboarding-launcher-value = 手动测试入口
+settings-disable-developer = 关闭开发者模式
+settings-enable-developer = 启用开发者模式
+settings-show-onboarding = 立即显示初始设置
+settings-config-source-file = 文件:{ $path }
+settings-config-source-default = 未加载配置文件;正在使用内置默认值
+settings-config-source-overridden = 未加载配置文件;命令行覆盖或 --skip-config 正在生效
+settings-status-saved = 已保存{ $setting }。
+settings-status-save-error = 无法保存{ $setting }:{ $error }
+settings-status-value-now = { $setting }现为{ $value }。
+settings-status-value-reset = { $setting }已重置为{ $value }。
+settings-status-terminal-saved = 终端设置已保存;字号已应用到打开的窗口。
+settings-status-terminal-error = 无法保存终端设置:{ $error }
+settings-status-quote-error = 无法保存底部语录设置:{ $error }
+settings-status-quote-enabled = 已启用底部语录。
+settings-status-quote-disabled = 已关闭底部语录。
+settings-status-sftp-idle = 远程文件空闲超时现为 { $count } 分钟。
+settings-status-sftp-error = 无法保存远程文件空闲超时:{ $error }
+settings-system-default-path = { $path }(系统默认)
+settings-no-downloads-folder = 未找到“下载”文件夹
+settings-download-picker-title = 选择下载文件夹
+settings-status-download-path = 下载将保存到 { $path }
+settings-status-download-error = 无法保存下载文件夹:{ $error }
+settings-status-window-restore-on = 已为新的 macOS 窗口启用主窗口位置与大小恢复。
+settings-status-window-restore-off = 已为新的 macOS 窗口关闭主窗口位置与大小恢复。
+settings-status-window-restore-error = 无法保存窗口恢复设置:{ $error }
+settings-status-renderer = 主窗口渲染器已设为 { $renderer };重启 ThinkTerm 后生效。
+settings-status-renderer-error = 无法保存渲染器设置:{ $error }
+settings-status-restarting = 正在重启 ThinkTerm…
+settings-status-restart-error = 无法重启 ThinkTerm:{ $error }
+settings-status-quitting = 正在退出 ThinkTerm…
+settings-status-opening-quotes = 正在打开底部语录 JSON:{ $path }
+settings-status-open-quotes-error = 无法准备底部语录 JSON:{ $error }
+settings-status-reset-quotes = 已重置底部语录 JSON:{ $path }
+settings-status-reset-quotes-error = 无法重置底部语录 JSON:{ $error }
+settings-status-app-icon = 应用图标现为{ $icon }。
+settings-status-app-icon-error = 无法保存应用图标:{ $error }
diff --git a/wezterm-gui/src/i18n.rs b/wezterm-gui/src/i18n.rs
new file mode 100644
index 00000000..13b5a2f0
--- /dev/null
+++ b/wezterm-gui/src/i18n.rs
@@ -0,0 +1,329 @@
+use crate::native_settings::{NativeLanguagePreference, ThinkTermNativeSettings};
+use fluent_bundle::concurrent::FluentBundle;
+use fluent_bundle::{FluentArgs, FluentResource};
+use fluent_langneg::negotiate_languages;
+use fluent_langneg::NegotiationStrategy;
+use parking_lot::Mutex;
+use std::collections::HashSet;
+use std::sync::atomic::{AtomicUsize, Ordering};
+use std::sync::OnceLock;
+use unic_langid::LanguageIdentifier;
+
+pub(crate) const SYSTEM_PREFERENCE: &str = "system";
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub(crate) struct LanguageOption {
+ /// Stable value persisted in native settings.
+ pub preference: &'static str,
+ /// Language name written in that language. System is localized separately.
+ pub native_name: &'static str,
+}
+
+pub(crate) const LANGUAGE_OPTIONS: &[LanguageOption] = &[
+ LanguageOption {
+ preference: SYSTEM_PREFERENCE,
+ native_name: "System",
+ },
+ LanguageOption {
+ preference: "en-US",
+ native_name: "English",
+ },
+ LanguageOption {
+ preference: "zh-CN",
+ native_name: "简体中文",
+ },
+ LanguageOption {
+ preference: "ja-JP",
+ native_name: "日本語",
+ },
+ LanguageOption {
+ preference: "fr-FR",
+ native_name: "Français",
+ },
+];
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+struct Locale {
+ code: &'static str,
+ source: &'static str,
+}
+
+const EN_US: Locale = Locale {
+ code: "en-US",
+ source: include_str!("../i18n/en-US.ftl"),
+};
+const ZH_CN: Locale = Locale {
+ code: "zh-CN",
+ source: include_str!("../i18n/zh-CN.ftl"),
+};
+const JA_JP: Locale = Locale {
+ code: "ja-JP",
+ source: include_str!("../i18n/ja-JP.ftl"),
+};
+const FR_FR: Locale = Locale {
+ code: "fr-FR",
+ source: include_str!("../i18n/fr-FR.ftl"),
+};
+
+/// The one registry that drives negotiation, catalog construction and parity
+/// tests. Adding a locale is intentionally just a resource, one entry here,
+/// and one user-facing entry in `LANGUAGE_OPTIONS`.
+const SUPPORTED_LOCALES: &[Locale] = &[EN_US, ZH_CN, JA_JP, FR_FR];
+
+impl Locale {
+ fn index(self) -> usize {
+ SUPPORTED_LOCALES
+ .iter()
+ .position(|locale| locale.code == self.code)
+ .expect("locale must be registered")
+ }
+
+ fn from_code(code: &str) -> Option<Self> {
+ SUPPORTED_LOCALES
+ .iter()
+ .copied()
+ .find(|locale| locale.code.eq_ignore_ascii_case(code))
+ }
+}
+
+struct Catalog {
+ bundle: FluentBundle<FluentResource>,
+}
+
+struct Catalogs {
+ locales: Vec<Catalog>,
+}
+
+static CATALOGS: OnceLock<Catalogs> = OnceLock::new();
+static ACTIVE_LOCALE: OnceLock<AtomicUsize> = OnceLock::new();
+static REPORTED_ERRORS: OnceLock<Mutex<HashSet<String>>> = OnceLock::new();
+
+fn build_catalog(locale: Locale) -> Catalog {
+ let language_id: LanguageIdentifier = locale
+ .code
+ .parse()
+ .unwrap_or_else(|err| panic!("invalid built-in locale {}: {err}", locale.code));
+ let resource =
+ FluentResource::try_new(locale.source.to_string()).unwrap_or_else(|(_, errors)| {
+ panic!("invalid {} localization resource: {errors:?}", locale.code)
+ });
+ let mut bundle = FluentBundle::new_concurrent(vec![language_id]);
+ bundle.set_use_isolating(false);
+ bundle
+ .add_resource(resource)
+ .unwrap_or_else(|errors| panic!("invalid {} localization bundle: {errors:?}", locale.code));
+ Catalog { bundle }
+}
+
+fn catalogs() -> &'static Catalogs {
+ CATALOGS.get_or_init(|| Catalogs {
+ locales: SUPPORTED_LOCALES
+ .iter()
+ .copied()
+ .map(build_catalog)
+ .collect(),
+ })
+}
+
+fn report_once(message: String) {
+ let errors = REPORTED_ERRORS.get_or_init(|| Mutex::new(HashSet::new()));
+ if errors.lock().insert(message.clone()) {
+ log::error!("{message}");
+ }
+}
+
+fn legacy_preference(language: NativeLanguagePreference) -> &'static str {
+ match language {
+ NativeLanguagePreference::System => SYSTEM_PREFERENCE,
+ NativeLanguagePreference::English => "en-US",
+ NativeLanguagePreference::Chinese => "zh-CN",
+ NativeLanguagePreference::Japanese => "ja-JP",
+ }
+}
+
+pub(crate) fn configured_preference(settings: &ThinkTermNativeSettings) -> &str {
+ settings
+ .localization
+ .language
+ .as_deref()
+ .unwrap_or_else(|| legacy_preference(settings.onboarding.language))
+}
+
+fn negotiate(requested: impl IntoIterator<Item = String>) -> Locale {
+ let requested: Vec<LanguageIdentifier> = requested
+ .into_iter()
+ .filter_map(|locale| locale.parse().ok())
+ .collect();
+ let available: Vec<LanguageIdentifier> = SUPPORTED_LOCALES
+ .iter()
+ .copied()
+ .map(|locale| locale.code.parse().expect("built-in locale must parse"))
+ .collect();
+ let negotiated = negotiate_languages(
+ &requested,
+ &available,
+ Some(&available[EN_US.index()]),
+ NegotiationStrategy::Lookup,
+ );
+ negotiated
+ .first()
+ .and_then(|locale| Locale::from_code(&locale.to_string()))
+ .unwrap_or(EN_US)
+}
+
+fn resolve_preference(preference: &str) -> Locale {
+ if preference.eq_ignore_ascii_case(SYSTEM_PREFERENCE) {
+ return negotiate(sys_locale::get_locales());
+ }
+ negotiate(std::iter::once(preference.to_string()))
+}
+
+fn initial_locale() -> Locale {
+ let settings = crate::native_settings::load();
+ resolve_preference(configured_preference(&settings))
+}
+
+fn active_locale() -> Locale {
+ let index = ACTIVE_LOCALE
+ .get_or_init(|| AtomicUsize::new(initial_locale().index()))
+ .load(Ordering::Acquire);
+ SUPPORTED_LOCALES.get(index).copied().unwrap_or(EN_US)
+}
+
+pub(crate) fn current_locale() -> &'static str {
+ active_locale().code
+}
+
+pub(crate) fn activate_preference(preference: &str) -> &'static str {
+ let locale = resolve_preference(preference);
+ ACTIVE_LOCALE
+ .get_or_init(|| AtomicUsize::new(locale.index()))
+ .store(locale.index(), Ordering::Release);
+ locale.code
+}
+
+pub(crate) fn activate_from_settings(settings: &ThinkTermNativeSettings) -> &'static str {
+ activate_preference(configured_preference(settings))
+}
+
+fn format_for(locale: Locale, id: &'static str, args: Option<&FluentArgs<'_>>) -> Option<String> {
+ let catalog = &catalogs().locales[locale.index()];
+ let message = catalog.bundle.get_message(id)?;
+ let pattern = message.value()?;
+ let mut errors = vec![];
+ let value = catalog.bundle.format_pattern(pattern, args, &mut errors);
+ if !errors.is_empty() {
+ report_once(format!(
+ "unable to format localization key {id:?} for {}: {errors:?}",
+ locale.code
+ ));
+ return None;
+ }
+ Some(value.into_owned())
+}
+
+fn format(id: &'static str, args: Option<&FluentArgs<'_>>) -> String {
+ let locale = active_locale();
+ if let Some(value) = format_for(locale, id, args) {
+ return value;
+ }
+ if locale != EN_US {
+ report_once(format!(
+ "missing localization key {id:?} for {}; using en-US",
+ locale.code
+ ));
+ if let Some(value) = format_for(EN_US, id, args) {
+ return value;
+ }
+ }
+ report_once(format!("missing en-US localization key {id:?}"));
+ id.to_string()
+}
+
+pub(crate) fn tr(id: &'static str) -> String {
+ format(id, None)
+}
+
+pub(crate) fn tr_args(id: &'static str, args: &FluentArgs<'_>) -> String {
+ format(id, Some(args))
+}
+
+pub(crate) fn language_option_label(option: LanguageOption) -> String {
+ if option.preference == SYSTEM_PREFERENCE {
+ tr("language-system")
+ } else {
+ option.native_name.to_string()
+ }
+}
+
+pub(crate) fn configured_language_label(settings: &ThinkTermNativeSettings) -> String {
+ let preference = configured_preference(settings);
+ if preference.eq_ignore_ascii_case(SYSTEM_PREFERENCE) {
+ let mut args = FluentArgs::new();
+ args.set("language", native_name_for_locale(current_locale()));
+ tr_args("language-system-resolved", &args)
+ } else {
+ native_name_for_locale(resolve_preference(preference).code).to_string()
+ }
+}
+
+fn native_name_for_locale(locale: &str) -> &'static str {
+ LANGUAGE_OPTIONS
+ .iter()
+ .find(|option| option.preference.eq_ignore_ascii_case(locale))
+ .map(|option| option.native_name)
+ .unwrap_or("English")
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use std::collections::BTreeSet;
+
+ fn message_ids(source: &str) -> BTreeSet<String> {
+ source
+ .lines()
+ .filter(|line| !line.starts_with(char::is_whitespace) && !line.starts_with('#'))
+ .filter_map(|line| line.split_once('=').map(|(id, _)| id.trim().to_string()))
+ .filter(|id| !id.is_empty())
+ .collect()
+ }
+
+ #[test]
+ fn every_shipped_language_has_the_complete_key_set() {
+ let english = message_ids(EN_US.source);
+ assert!(!english.is_empty());
+ for locale in [ZH_CN, JA_JP, FR_FR] {
+ assert_eq!(message_ids(locale.source), english, "{}", locale.code);
+ }
+ }
+
+ #[test]
+ fn locale_negotiation_uses_supported_language_families() {
+ assert_eq!(negotiate(["zh-Hans-SG".to_string()]), ZH_CN);
+ assert_eq!(negotiate(["ja".to_string()]), JA_JP);
+ assert_eq!(negotiate(["fr-CA".to_string()]), FR_FR);
+ assert_eq!(negotiate(["en-GB".to_string()]), EN_US);
+ assert_eq!(negotiate(["de-DE".to_string()]), EN_US);
+ }
+
+ #[test]
+ fn new_language_setting_overrides_the_legacy_onboarding_value() {
+ let mut settings = ThinkTermNativeSettings::default();
+ settings.onboarding.language = NativeLanguagePreference::Japanese;
+ assert_eq!(configured_preference(&settings), "ja-JP");
+ settings.localization.language = Some("fr-FR".to_string());
+ assert_eq!(configured_preference(&settings), "fr-FR");
+ }
+
+ #[test]
+ fn fluent_arguments_can_be_reordered_by_a_translation() {
+ let mut args = FluentArgs::new();
+ args.set("name", "demo");
+ for locale in SUPPORTED_LOCALES.iter().copied() {
+ assert!(format_for(locale, "menu-space-occupied", Some(&args))
+ .expect("test key")
+ .contains("demo"));
+ }
+ }
+}
diff --git a/wezterm-gui/src/main.rs b/wezterm-gui/src/main.rs
index aa7d344f..6ec0f1b6 100644
--- a/wezterm-gui/src/main.rs
+++ b/wezterm-gui/src/main.rs
@@ -41,6 +41,7 @@ mod customglyph;
mod download;
mod frontend;
mod glyphcache;
+mod i18n;
mod input_diagnostics;
mod inputmap;
mod markdown_editor;
diff --git a/wezterm-gui/src/native_settings.rs b/wezterm-gui/src/native_settings.rs
index 3fdf35a1..bdc13484 100644
--- a/wezterm-gui/src/native_settings.rs
+++ b/wezterm-gui/src/native_settings.rs
@@ -173,13 +173,6 @@ impl Default for NativeBottomQuoteMode {
}
impl NativeBottomQuoteMode {
- pub(crate) fn label(self) -> &'static str {
- match self {
- Self::Timed => "Timed",
- Self::PseudoRandom => "Pseudo-random",
- }
- }
-
pub(crate) fn next(self) -> Self {
match self {
Self::Timed => Self::PseudoRandom,
@@ -311,6 +304,15 @@ impl Default for NativeWorkspaceSettings {
}
}
+/// Application-wide UI localization. `None` identifies a pre-localization
+/// settings file so the effective preference can be migrated from the legacy
+/// Onboarding-only value without mutating Onboarding itself.
+#[derive(Debug, Clone, Default, Deserialize, Serialize)]
+#[serde(default)]
+pub(crate) struct NativeLocalizationSettings {
+ pub(crate) language: Option<String>,
+}
+
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(default)]
pub(crate) struct ThinkTermNativeSettings {
@@ -320,6 +322,7 @@ pub(crate) struct ThinkTermNativeSettings {
pub(crate) chrome: NativeChromeSettings,
pub(crate) developer: NativeDeveloperSettings,
pub(crate) onboarding: NativeOnboardingSettings,
+ pub(crate) localization: NativeLocalizationSettings,
pub(crate) compatibility: NativeCompatibilitySettings,
pub(crate) window: NativeWindowSettings,
pub(crate) workspaces: NativeWorkspaceSettings,
@@ -334,6 +337,7 @@ impl Default for ThinkTermNativeSettings {
chrome: NativeChromeSettings::default(),
developer: NativeDeveloperSettings::default(),
onboarding: NativeOnboardingSettings::default(),
+ localization: NativeLocalizationSettings::default(),
compatibility: NativeCompatibilitySettings::default(),
window: NativeWindowSettings::default(),
workspaces: NativeWorkspaceSettings::default(),
@@ -491,6 +495,7 @@ pub(crate) fn effective_appearance() -> Appearance {
}
pub(crate) fn apply_to_app(settings: &ThinkTermNativeSettings) {
+ crate::i18n::activate_from_settings(settings);
if let Some(conn) = Connection::get() {
conn.set_preferred_appearance(settings.appearance.theme_mode.preferred_app_appearance());
}
@@ -780,4 +785,26 @@ mod tests {
DEFAULT_REMOTE_SFTP_IDLE_MINUTES
);
}
+
+ #[test]
+ fn older_settings_leave_application_language_unset_for_legacy_migration() {
+ let settings: ThinkTermNativeSettings = serde_json::from_str(r#"{"version":1}"#).unwrap();
+ assert_eq!(settings.localization.language, None);
+ }
+
+ #[test]
+ fn application_language_round_trips_independently_of_onboarding() {
+ let mut settings = ThinkTermNativeSettings::default();
+ settings.onboarding.language = NativeLanguagePreference::Japanese;
+ settings.localization.language = Some("fr-FR".to_string());
+
+ let encoded = serde_json::to_string(&settings).unwrap();
+ let decoded: ThinkTermNativeSettings = serde_json::from_str(&encoded).unwrap();
+
+ assert_eq!(decoded.localization.language.as_deref(), Some("fr-FR"));
+ assert_eq!(
+ decoded.onboarding.language,
+ NativeLanguagePreference::Japanese
+ );
+ }
}
diff --git a/wezterm-gui/src/settings_window.rs b/wezterm-gui/src/settings_window.rs
index 6e8389ce..dc517772 100644
--- a/wezterm-gui/src/settings_window.rs
+++ b/wezterm-gui/src/settings_window.rs
@@ -34,10 +34,11 @@ use window::{
};
use crate::native_settings::{
- NativeAppIcon, NativeRendererBackend, NativeThemeMode, ThinkTermNativeSettings,
- DEFAULT_HOME_FONT_SIZE, DEFAULT_PANE_HEADER_FONT_SIZE, DEFAULT_SETTINGS_FONT_SIZE,
- DEFAULT_SIDEBAR_FONT_SIZE, DEFAULT_TAB_FONT_SIZE,
+ NativeAppIcon, NativeBottomQuoteMode, NativeRendererBackend, NativeThemeMode,
+ ThinkTermNativeSettings, DEFAULT_HOME_FONT_SIZE, DEFAULT_PANE_HEADER_FONT_SIZE,
+ DEFAULT_SETTINGS_FONT_SIZE, DEFAULT_SIDEBAR_FONT_SIZE, DEFAULT_TAB_FONT_SIZE,
};
+use fluent_bundle::FluentArgs;
// All chrome geometry below is authored in 2x macOS backing pixels.
// settings_ui_scale_for_dpi maps it onto other platforms by treating the
@@ -163,18 +164,18 @@ const BASE_SECTIONS: &[SettingsSection] = &[
const DEVELOPER_SECTIONS: &[SettingsSection] = &[SettingsSection::UiKit, SettingsSection::Memory];
impl SettingsSection {
- fn label(self) -> &'static str {
+ fn label(self) -> String {
match self {
- Self::General => "General",
- Self::Appearance => "Appearance",
- Self::Terminal => "Terminal",
- Self::Workspaces => "Workspaces",
- Self::Keymap => "Keymap",
- Self::Compatibility => "Compatibility",
- Self::Developer => "Developer",
- Self::UiKit => "UI Kit",
- Self::Memory => "Memory",
- Self::About => "About",
+ Self::General => crate::i18n::tr("settings-section-general"),
+ Self::Appearance => crate::i18n::tr("settings-section-appearance"),
+ Self::Terminal => crate::i18n::tr("settings-section-terminal"),
+ Self::Workspaces => crate::i18n::tr("settings-section-workspaces"),
+ Self::Keymap => crate::i18n::tr("settings-section-keymap"),
+ Self::Compatibility => crate::i18n::tr("settings-section-compatibility"),
+ Self::Developer => crate::i18n::tr("settings-section-developer"),
+ Self::UiKit => "UI Kit".to_string(),
+ Self::Memory => "Memory".to_string(),
+ Self::About => crate::i18n::tr("settings-section-about"),
}
}
@@ -196,6 +197,7 @@ impl SettingsSection {
fn search_terms(self) -> &'static [&'static str] {
match self {
Self::General => &[
+ "Language",
"Config Source",
"ThinkTerm Native Settings",
"Theme Mode",
@@ -304,6 +306,60 @@ impl SettingsSection {
Self::About => &["About", "Version", "ThinkTerm"],
}
}
+
+ fn matches_search(self, query: &str) -> bool {
+ self.label().to_lowercase().contains(query)
+ || self
+ .search_terms()
+ .iter()
+ .any(|term| term.to_lowercase().contains(query))
+ || (self == Self::General
+ && crate::i18n::tr("settings-language")
+ .to_lowercase()
+ .contains(query))
+ }
+}
+
+#[cfg(test)]
+mod settings_search_tests {
+ use super::*;
+
+ #[test]
+ fn general_is_searchable_by_the_language_row_label() {
+ assert!(SettingsSection::General.matches_search("language"));
+ let localized_label = crate::i18n::tr("settings-language").to_lowercase();
+ assert!(SettingsSection::General.matches_search(&localized_label));
+ }
+}
+
+fn localized_theme_mode_label(mode: NativeThemeMode) -> String {
+ crate::i18n::tr(match mode {
+ NativeThemeMode::System => "settings-theme-system",
+ NativeThemeMode::Light => "settings-theme-light",
+ NativeThemeMode::Dark => "settings-theme-dark",
+ })
+}
+
+fn localized_app_icon_label(icon: NativeAppIcon) -> String {
+ crate::i18n::tr(match icon {
+ NativeAppIcon::Simple => "settings-app-icon-simple",
+ NativeAppIcon::Classic => "settings-app-icon-classic",
+ })
+}
+
+fn localized_quote_mode_label(mode: NativeBottomQuoteMode) -> String {
+ crate::i18n::tr(match mode {
+ NativeBottomQuoteMode::Timed => "settings-quote-mode-timed",
+ NativeBottomQuoteMode::PseudoRandom => "settings-quote-mode-random",
+ })
+}
+
+fn settings_tr(id: &'static str, values: &[(&'static str, String)]) -> String {
+ let mut args = FluentArgs::new();
+ for (name, value) in values {
+ args.set(*name, value.clone());
+ }
+ crate::i18n::tr_args(id, &args)
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -331,6 +387,8 @@ enum SettingsAction {
CopyInputDiagnostics,
ToggleThemeModeMenu,
SetThemeMode(NativeThemeMode),
+ ToggleLanguageMenu,
+ SetLanguage(&'static str),
ToggleAppIconMenu,
SetAppIcon(NativeAppIcon),
ToggleMainRendererMenu,
@@ -377,6 +435,7 @@ enum SettingsDrag {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum SettingsDropdown {
+ Language,
ThemeMode,
AppIcon,
MainRenderer,
@@ -723,28 +782,26 @@ const TYPOGRAPHY_FONT_AREAS: [ChromeFontArea; 6] = [
];
impl ChromeFontArea {
- fn label(self) -> &'static str {
- match self {
- Self::Settings => "Settings UI Font Size",
- Self::Home => "Home Font Size",
- Self::RightSidebar => "Right Sidebar Font Size",
- Self::Sidebar => "Workspace Sidebar Font Size",
- Self::TabBar => "Tab Bar Font Size",
- Self::PaneHeader => "Pane Header Font Size",
- }
+ fn localized_label(self) -> String {
+ crate::i18n::tr(match self {
+ Self::Settings => "settings-font-size-settings",
+ Self::Home => "settings-font-size-home",
+ Self::RightSidebar => "settings-font-size-right-sidebar",
+ Self::Sidebar => "settings-font-size-workspace-sidebar",
+ Self::TabBar => "settings-font-size-tab-bar",
+ Self::PaneHeader => "settings-font-size-pane-header",
+ })
}
- fn description(self) -> &'static str {
- match self {
- Self::Settings => "Controls the Settings window chrome and content text.",
- Self::Home => "Controls the main home/content view text.",
- Self::RightSidebar => {
- "Follows Home Font Size until set — files, notes and snippets panel."
- }
- Self::Sidebar => "Saved separately for the main workspace sidebar.",
- Self::TabBar => "Saved separately for the top terminal tab bar.",
- Self::PaneHeader => "Saved separately for split-pane header labels.",
- }
+ fn localized_description(self) -> String {
+ crate::i18n::tr(match self {
+ Self::Settings => "settings-font-size-settings-description",
+ Self::Home => "settings-font-size-home-description",
+ Self::RightSidebar => "settings-font-size-right-sidebar-description",
+ Self::Sidebar => "settings-font-size-workspace-sidebar-description",
+ Self::TabBar => "settings-font-size-tab-bar-description",
+ Self::PaneHeader => "settings-font-size-pane-header-description",
+ })
}
fn default_size(self) -> f64 {
@@ -1391,9 +1448,10 @@ impl SettingsWindow {
origin: GeometryOrigin::default(),
};
+ let title = crate::i18n::tr("settings-window-title");
let window = Window::new_window(
"thinkterm-settings",
- "ThinkTerm Settings",
+ &title,
geometry,
Some(&config),
Rc::clone(&fonts),
@@ -1405,7 +1463,7 @@ impl SettingsWindow {
)
.await?;
- window.set_title("ThinkTerm Settings");
+ window.set_title(&title);
let webgpu = match WebGpuState::new(&window, dimensions, &config).await {
Ok(webgpu) => Rc::new(webgpu),
Err(err) => {
@@ -1636,6 +1694,8 @@ impl SettingsWindow {
Some(
SettingsAction::ToggleThemeModeMenu
| SettingsAction::SetThemeMode(_)
+ | SettingsAction::ToggleLanguageMenu
+ | SettingsAction::SetLanguage(_)
| SettingsAction::ToggleAppIconMenu
| SettingsAction::SetAppIcon(_)
| SettingsAction::ToggleMainRendererMenu
@@ -2229,19 +2289,28 @@ impl SettingsWindow {
let current = self.current_bottom_quote_interval_minutes() as i32;
let value = (current + delta).clamp(1, 24 * 60) as u32;
self.native_settings.terminal.bottom_quote_interval_minutes = Some(value);
- self.save_and_apply_bottom_quote_settings(format!(
- "Bottom quote interval is now {}.",
- Self::format_bottom_quote_interval(value)
+ self.save_and_apply_bottom_quote_settings(settings_tr(
+ "settings-status-value-now",
+ &[
+ ("setting", crate::i18n::tr("settings-quote-interval")),
+ ("value", Self::format_bottom_quote_interval(value)),
+ ],
));
}
fn reset_bottom_quote_interval(&mut self) {
self.native_settings.terminal.bottom_quote_interval_minutes = None;
- self.save_and_apply_bottom_quote_settings(format!(
- "Bottom quote interval reset to {}.",
- Self::format_bottom_quote_interval(
- crate::native_settings::DEFAULT_BOTTOM_QUOTE_INTERVAL_MINUTES
- )
+ self.save_and_apply_bottom_quote_settings(settings_tr(
+ "settings-status-value-reset",
+ &[
+ ("setting", crate::i18n::tr("settings-quote-interval")),
+ (
+ "value",
+ Self::format_bottom_quote_interval(
+ crate::native_settings::DEFAULT_BOTTOM_QUOTE_INTERVAL_MINUTES,
+ ),
+ ),
+ ],
));
}
@@ -2268,10 +2337,14 @@ impl SettingsWindow {
match crate::native_settings::save(&self.native_settings) {
Ok(()) => {
crate::termwindow::remote_files::update_remote_connection_idle_timeout(value);
- self.status = format!("Remote Files idle timeout is now {value} minutes.");
+ self.status =
+ settings_tr("settings-status-sftp-idle", &[("count", value.to_string())]);
}
Err(err) => {
- self.status = format!("Unable to save Remote Files idle timeout: {err:#}");
+ self.status = settings_tr(
+ "settings-status-sftp-error",
+ &[("error", format!("{err:#}"))],
+ );
}
}
}
@@ -2289,8 +2362,11 @@ impl SettingsWindow {
return configured.to_string();
}
match crate::native_settings::effective_remote_download_directory() {
- Some(path) => format!("{} (system default)", path.display()),
- None => "No Downloads folder found".to_string(),
+ Some(path) => settings_tr(
+ "settings-system-default-path",
+ &[("path", path.display().to_string())],
+ ),
+ None => crate::i18n::tr("settings-no-downloads-folder"),
}
}
@@ -2303,8 +2379,8 @@ impl SettingsWindow {
let notify = window.clone();
window.pick_folder_async_with_options(
FolderPickerOptions {
- title: "Choose a download folder".to_string(),
- prompt: "Choose".to_string(),
+ title: crate::i18n::tr("settings-download-picker-title"),
+ prompt: crate::i18n::tr("common-choose"),
},
Box::new(move |path| {
// Cancelling the picker must leave the setting alone, so only
@@ -2330,13 +2406,16 @@ impl SettingsWindow {
match crate::native_settings::set_remote_download_directory(path) {
Ok(()) => {
self.native_settings = crate::native_settings::load();
- self.status = format!(
- "Downloads are saved to {}",
- self.remote_download_directory_label()
+ self.status = settings_tr(
+ "settings-status-download-path",
+ &[("path", self.remote_download_directory_label())],
);
}
Err(err) => {
- self.status = format!("Unable to save the download folder: {err:#}");
+ self.status = settings_tr(
+ "settings-status-download-error",
+ &[("error", format!("{err:#}"))],
+ );
}
}
}
@@ -2367,19 +2446,28 @@ impl SettingsWindow {
fn step_bottom_quote_font_size(&mut self, delta: f64) {
let value = (self.current_bottom_quote_font_size() + delta).clamp(6.0, 20.0);
self.native_settings.terminal.bottom_quote_font_size = Some(value);
- self.save_and_apply_bottom_quote_settings(format!(
- "Bottom quote font size is now {}.",
- Self::format_bottom_quote_font_size(value)
+ self.save_and_apply_bottom_quote_settings(settings_tr(
+ "settings-status-value-now",
+ &[
+ ("setting", crate::i18n::tr("settings-quote-font-size")),
+ ("value", Self::format_bottom_quote_font_size(value)),
+ ],
));
}
fn reset_bottom_quote_font_size(&mut self) {
self.native_settings.terminal.bottom_quote_font_size = None;
- self.save_and_apply_bottom_quote_settings(format!(
- "Bottom quote font size reset to {}.",
- Self::format_bottom_quote_font_size(
- crate::native_settings::DEFAULT_BOTTOM_QUOTE_FONT_SIZE
- )
+ self.save_and_apply_bottom_quote_settings(settings_tr(
+ "settings-status-value-reset",
+ &[
+ ("setting", crate::i18n::tr("settings-quote-font-size")),
+ (
+ "value",
+ Self::format_bottom_quote_font_size(
+ crate::native_settings::DEFAULT_BOTTOM_QUOTE_FONT_SIZE,
+ ),
+ ),
+ ],
));
}
@@ -2467,17 +2555,32 @@ impl SettingsWindow {
Ok(()) => {
if area == ChromeFontArea::Settings {
if let Err(err) = self.reload_settings_fonts() {
- self.status = format!("Unable to load Settings font: {err:#}");
+ self.status = settings_tr(
+ "settings-status-save-error",
+ &[
+ ("setting", area.localized_label()),
+ ("error", format!("{err:#}")),
+ ],
+ );
return;
}
}
if let Some(front_end) = crate::frontend::try_front_end() {
front_end.invalidate_all_windows();
}
- self.status = format!("{} saved.", area.label());
+ self.status = settings_tr(
+ "settings-status-saved",
+ &[("setting", area.localized_label())],
+ );
}
Err(err) => {
- self.status = format!("Unable to save {}: {err:#}", area.label());
+ self.status = settings_tr(
+ "settings-status-save-error",
+ &[
+ ("setting", area.localized_label()),
+ ("error", format!("{err:#}")),
+ ],
+ );
}
}
}
@@ -2504,11 +2607,13 @@ impl SettingsWindow {
match crate::native_settings::save(&self.native_settings) {
Ok(()) => {
self.apply_terminal_font_size_to_open_windows();
- self.status =
- "Terminal settings saved; font size applied to open windows.".to_string();
+ self.status = crate::i18n::tr("settings-status-terminal-saved");
}
Err(err) => {
- self.status = format!("Unable to save terminal settings: {err:#}");
+ self.status = settings_tr(
+ "settings-status-terminal-error",
+ &[("error", format!("{err:#}"))],
+ );
}
}
}
@@ -2522,7 +2627,10 @@ impl SettingsWindow {
self.status = status;
}
Err(err) => {
- self.status = format!("Unable to save bottom quote setting: {err:#}");
+ self.status = settings_tr(
+ "settings-status-quote-error",
+ &[("error", format!("{err:#}"))],
+ );
}
}
}
@@ -2802,13 +2910,16 @@ impl SettingsWindow {
match crate::native_settings::save(&self.native_settings) {
Ok(()) => {
self.status = if self.native_settings.window.restore_main_window_frame {
- "Main window frame restore enabled for new macOS windows.".to_string()
+ crate::i18n::tr("settings-status-window-restore-on")
} else {
- "Main window frame restore disabled for new macOS windows.".to_string()
+ crate::i18n::tr("settings-status-window-restore-off")
};
}
Err(err) => {
- self.status = format!("Unable to save window restore setting: {err:#}");
+ self.status = settings_tr(
+ "settings-status-window-restore-error",
+ &[("error", format!("{err:#}"))],
+ );
}
}
}
@@ -2825,13 +2936,16 @@ impl SettingsWindow {
self.ui.open_dropdown = None;
match crate::native_settings::save(&self.native_settings) {
Ok(()) => {
- self.status = format!(
- "Main window renderer set to {}; restart ThinkTerm to apply it.",
- renderer.label()
+ self.status = settings_tr(
+ "settings-status-renderer",
+ &[("renderer", renderer.label().to_string())],
);
}
Err(err) => {
- self.status = format!("Unable to save renderer setting: {err:#}");
+ self.status = settings_tr(
+ "settings-status-renderer-error",
+ &[("error", format!("{err:#}"))],
+ );
}
}
}
@@ -2839,16 +2953,19 @@ impl SettingsWindow {
self.ui.open_dropdown = None;
match Self::restart_application() {
Ok(()) => {
- self.status = "Restarting ThinkTerm...".to_string();
+ self.status = crate::i18n::tr("settings-status-restarting");
}
Err(err) => {
- self.status = format!("Unable to restart ThinkTerm: {err:#}");
+ self.status = settings_tr(
+ "settings-status-restart-error",
+ &[("error", format!("{err:#}"))],
+ );
}
}
}
SettingsAction::QuitApplication => {
self.ui.open_dropdown = None;
- self.status = "Quitting ThinkTerm...".to_string();
+ self.status = crate::i18n::tr("settings-status-quitting");
if let Some(conn) = Connection::get() {
conn.terminate_message_loop();
}
@@ -2858,9 +2975,9 @@ impl SettingsWindow {
self.native_settings.terminal.bottom_quote_enabled =
!self.native_settings.terminal.bottom_quote_enabled;
let status = if self.native_settings.terminal.bottom_quote_enabled {
- "Bottom quote enabled.".to_string()
+ crate::i18n::tr("settings-status-quote-enabled")
} else {
- "Bottom quote disabled.".to_string()
+ crate::i18n::tr("settings-status-quote-disabled")
};
self.save_and_apply_bottom_quote_settings(status);
}
@@ -2868,9 +2985,17 @@ impl SettingsWindow {
self.ui.open_dropdown = None;
self.native_settings.terminal.bottom_quote_mode =
self.native_settings.terminal.bottom_quote_mode.next();
- self.save_and_apply_bottom_quote_settings(format!(
- "Bottom quote rotation is now {}.",
- self.native_settings.terminal.bottom_quote_mode.label()
+ self.save_and_apply_bottom_quote_settings(settings_tr(
+ "settings-status-value-now",
+ &[
+ ("setting", crate::i18n::tr("settings-quote-rotation")),
+ (
+ "value",
+ localized_quote_mode_label(
+ self.native_settings.terminal.bottom_quote_mode,
+ ),
+ ),
+ ],
));
}
SettingsAction::DecreaseBottomQuoteFontSize => self.step_bottom_quote_font_size(-1.0),
@@ -2892,11 +3017,17 @@ impl SettingsWindow {
self.ui.open_dropdown = None;
match crate::bottom_quotes::ensure_quotes_file() {
Ok(path) => {
- self.status = format!("Opening bottom quotes JSON {}", path.display());
+ self.status = settings_tr(
+ "settings-status-opening-quotes",
+ &[("path", path.display().to_string())],
+ );
Self::open_path(path);
}
Err(err) => {
- self.status = format!("Unable to prepare bottom quotes JSON: {err:#}");
+ self.status = settings_tr(
+ "settings-status-open-quotes-error",
+ &[("error", format!("{err:#}"))],
+ );
}
}
}
@@ -2907,10 +3038,16 @@ impl SettingsWindow {
if let Some(front_end) = crate::frontend::try_front_end() {
front_end.invalidate_all_windows();
}
- self.status = format!("Reset bottom quotes JSON {}", path.display());
+ self.status = settings_tr(
+ "settings-status-reset-quotes",
+ &[("path", path.display().to_string())],
+ );
}
Err(err) => {
- self.status = format!("Unable to reset bottom quotes JSON: {err:#}");
+ self.status = settings_tr(
+ "settings-status-reset-quotes-error",
+ &[("error", format!("{err:#}"))],
+ );
}
}
}
@@ -3073,6 +3210,50 @@ impl SettingsWindow {
Some(SettingsDropdown::ThemeMode)
};
}
+ SettingsAction::ToggleLanguageMenu => {
+ self.ui.open_dropdown = if self.ui.open_dropdown == Some(SettingsDropdown::Language)
+ {
+ None
+ } else {
+ Some(SettingsDropdown::Language)
+ };
+ }
+ SettingsAction::SetLanguage(preference) => {
+ self.ui.open_dropdown = None;
+ let previous_language = self.native_settings.localization.language.clone();
+ self.native_settings.localization.language = Some(preference.to_string());
+ match crate::native_settings::save(&self.native_settings) {
+ Ok(()) => {
+ let locale = crate::i18n::activate_preference(preference);
+ self.status.clear();
+ self.ui.sidebar_scroll.reset();
+ self.sync_selected_section_with_search();
+ window.set_title(&crate::i18n::tr("settings-window-title"));
+ if let Some(front_end) = crate::frontend::try_front_end() {
+ for gui_window in front_end.gui_windows() {
+ gui_window.window.notify(
+ crate::termwindow::TermWindowNotif::Apply(Box::new(
+ |term_window| {
+ term_window.dismiss_fallback_context_menu();
+ },
+ )),
+ );
+ }
+ front_end.invalidate_all_windows();
+ }
+ let mut args = FluentArgs::new();
+ args.set("language", locale);
+ self.status = crate::i18n::tr_args("settings-language-changed", &args);
+ window.invalidate();
+ }
+ Err(err) => {
+ self.native_settings.localization.language = previous_language;
+ let mut args = FluentArgs::new();
+ args.set("error", format!("{err:#}"));
+ self.status = crate::i18n::tr_args("settings-language-save-error", &args);
+ }
+ }
+ }
SettingsAction::SetThemeMode(mode) => {
self.native_settings.appearance.theme_mode = mode;
self.ui.open_dropdown = None;
@@ -3082,10 +3263,14 @@ impl SettingsWindow {
if let Some(front_end) = crate::frontend::try_front_end() {
front_end.invalidate_all_windows();
}
- self.status = format!("Theme mode is now {}.", mode.label());
+ let mut args = FluentArgs::new();
+ args.set("mode", localized_theme_mode_label(mode));
+ self.status = crate::i18n::tr_args("settings-theme-changed", &args);
}
Err(err) => {
- self.status = format!("Unable to save theme mode: {err:#}");
+ let mut args = FluentArgs::new();
+ args.set("error", format!("{err:#}"));
+ self.status = crate::i18n::tr_args("settings-theme-save-error", &args);
}
}
}
@@ -3103,10 +3288,16 @@ impl SettingsWindow {
match crate::native_settings::save(&self.native_settings) {
Ok(()) => {
crate::native_settings::apply_to_app(&self.native_settings);
- self.status = format!("App icon is now {}.", icon.label());
+ self.status = settings_tr(
+ "settings-status-app-icon",
+ &[("icon", localized_app_icon_label(icon))],
+ );
}
Err(err) => {
- self.status = format!("Unable to save app icon: {err:#}");
+ self.status = settings_tr(
+ "settings-status-app-icon-error",
+ &[("error", format!("{err:#}"))],
+ );
}
}
}
@@ -3535,7 +3726,7 @@ impl SettingsWindow {
self.paint_text_input(
layers,
TextInputSpec {
- placeholder: "Search settings...",
+ placeholder: &crate::i18n::tr("settings-search-placeholder"),
text: &search_text,
rect: search_rect,
focused: self.ui.interaction.focused == Some(SettingsAction::SearchInput),
@@ -3636,7 +3827,7 @@ impl SettingsWindow {
&ui_font,
tokens.sidebar_padding + 12.0,
list_top + self.ui_px(18.0),
- "No settings found",
+ &crate::i18n::tr("settings-search-no-results"),
palette.muted_text,
sidebar_width - tokens.sidebar_padding * 2.0 - 24.0,
)?;
@@ -3694,12 +3885,13 @@ impl SettingsWindow {
sidebar_icon_size as f32,
text_color,
)?;
+ let section_label = section.label();
self.draw_text(
layers,
&nav_font,
row_x + self.ui_px(56.0),
self.control_text_y(row_y, self.ui_px(NAV_ROW_HEIGHT)),
- section.label(),
+ &section_label,
text_color,
row_width - self.ui_px(76.0),
)?;
@@ -3740,12 +3932,13 @@ impl SettingsWindow {
);
let scroll = self.ui.content_scroll.offset;
+ let selected_label = self.selected.label();
self.draw_text(
layers,
&title_font,
x,
self.ui_px(CONTENT_TITLE_Y) - scroll,
- self.selected.label(),
+ &selected_label,
palette.title,
max_width,
)?;
@@ -3760,7 +3953,7 @@ impl SettingsWindow {
layers,
&ui_font,
x,
- "Keyboard shortcuts and command palette actions.",
+ &crate::i18n::tr("settings-keymap-description"),
max_width,
)?,
SettingsSection::Developer => self.paint_developer(layers, x, max_width)?,
@@ -3770,7 +3963,7 @@ impl SettingsWindow {
layers,
&ui_font,
x,
- "ThinkTerm version, project information, and app metadata.",
+ &crate::i18n::tr("settings-about-description"),
max_width,
)?,
}
@@ -3797,8 +3990,8 @@ impl SettingsWindow {
let row_step = self.settings_row_step();
let section_y = self.ui_px(CONTENT_SECTION_Y) - scroll;
// Each settings card owns its row count because rows are painted manually.
- // General currently paints seven rows below; the count drives card height and scroll extent.
- let row_count = 7;
+ // General currently paints eight rows below; the count drives card height and scroll extent.
+ let row_count = 8;
let (card_y, first_row_y) = self.settings_card_geometry(section_y, row_count);
let card_height = self.settings_card_height(row_count);
self.ui.content_scroll.set_extents(
@@ -3810,7 +4003,14 @@ impl SettingsWindow {
let native_status = if native_path.exists() {
native_path.display().to_string()
} else {
- format!("Defaults; optional file at {}", native_path.display())
+ let mut args = FluentArgs::new();
+ args.set("path", native_path.display().to_string());
+ crate::i18n::tr_args("settings-native-settings-default", &args)
+ };
+ let config_source_kind = if config::configuration_file().is_some() {
+ crate::i18n::tr("common-file")
+ } else {
+ crate::i18n::tr("common-defaults")
};
self.draw_text(
@@ -3818,7 +4018,7 @@ impl SettingsWindow {
&ui_font,
x,
section_y,
- "Configuration",
+ &crate::i18n::tr("settings-general-heading"),
palette.muted_text,
max_width,
)?;
@@ -3828,26 +4028,23 @@ impl SettingsWindow {
let row_x = card_x + card_padding;
let row_width = max_width - card_padding * 2.0;
self.paint_group_card(layers, card_x, card_y, max_width, card_height)?;
+ self.paint_language_row(layers, row_x, first_row_y, row_width, false)?;
self.paint_setting_row(
layers,
row_x,
- first_row_y,
+ first_row_y + row_step,
row_width,
- "Config Source",
+ &crate::i18n::tr("settings-config-source"),
&source,
- if config::configuration_file().is_some() {
- "File"
- } else {
- "Defaults"
- },
+ &config_source_kind,
false,
)?;
self.paint_setting_row(
layers,
row_x,
- first_row_y + row_step,
+ first_row_y + row_step * 2.0,
row_width,
- "ThinkTerm Native Settings",
+ &crate::i18n::tr("settings-native-settings"),
&native_status,
&format!("v{}", self.native_settings.version),
true,
@@ -3855,32 +4052,32 @@ impl SettingsWindow {
self.paint_theme_mode_row(
layers,
row_x,
- first_row_y + row_step * 2.0,
+ first_row_y + row_step * 3.0,
row_width,
- "Small ThinkTerm-native state; terminal config stays in ThinkTerm's own thinkterm.lua.",
+ &crate::i18n::tr("settings-native-settings-description"),
true,
)?;
- self.paint_main_renderer_row(layers, row_x, first_row_y + row_step * 3.0, row_width, true)?;
+ self.paint_main_renderer_row(layers, row_x, first_row_y + row_step * 4.0, row_width, true)?;
self.paint_toggle_setting_row(
layers,
row_x,
- first_row_y + row_step * 4.0,
+ first_row_y + row_step * 5.0,
row_width,
- "Restore Main Window Frame",
- "macOS restores the last main terminal window size and position.",
+ &crate::i18n::tr("settings-restore-window-frame"),
+ &crate::i18n::tr("settings-restore-window-frame-description"),
self.native_settings.window.restore_main_window_frame,
SettingsAction::ToggleMainWindowFrameRestore,
true,
)?;
- self.paint_restart_row(layers, row_x, first_row_y + row_step * 5.0, row_width, true)?;
+ self.paint_restart_row(layers, row_x, first_row_y + row_step * 6.0, row_width, true)?;
self.paint_action_setting_row(
layers,
row_x,
- first_row_y + row_step * 6.0,
+ first_row_y + row_step * 7.0,
row_width,
- "Quit",
- "Close all ThinkTerm windows and exit the app.",
- "Quit ThinkTerm",
+ &crate::i18n::tr("settings-quit"),
+ &crate::i18n::tr("settings-quit-description"),
+ &crate::i18n::tr("settings-quit-app"),
SettingsAction::QuitApplication,
true,
)?;
@@ -3910,6 +4107,11 @@ impl SettingsWindow {
let typography_card_y = typography_title_y + self.settings_section_card_gap().min(54.0);
let typography_first_row_y = typography_card_y + self.settings_card_top_padding();
let typography_card_height = self.settings_card_height(typography_row_count);
+ let config_source_kind = if config::configuration_file().is_some() {
+ crate::i18n::tr("common-file")
+ } else {
+ crate::i18n::tr("common-defaults")
+ };
self.ui.content_scroll.set_extents(
self.content_viewport_extent(),
self.settings_content_extent(typography_card_y + scroll + typography_card_height),
@@ -3920,7 +4122,7 @@ impl SettingsWindow {
&ui_font,
x,
section_y,
- "Theme",
+ &crate::i18n::tr("settings-appearance-theme-heading"),
palette.muted_text,
max_width,
)?;
@@ -3934,7 +4136,7 @@ impl SettingsWindow {
row_x,
y,
row_width,
- "ThinkTerm-native window appearance preference.",
+ &crate::i18n::tr("settings-theme-description"),
false,
)?;
y += row_step;
@@ -3943,8 +4145,8 @@ impl SettingsWindow {
row_x,
y,
row_width,
- "Switch the running Dock and app switcher icon.",
- "Currently only works on macOS.",
+ &crate::i18n::tr("settings-app-icon-description"),
+ &crate::i18n::tr("settings-app-icon-note"),
true,
)?;
y += row_step + app_icon_note_space;
@@ -3953,8 +4155,8 @@ impl SettingsWindow {
row_x,
y,
row_width,
- "Effective Color Scheme",
- "Resolved through the WezTerm-compatible config path.",
+ &crate::i18n::tr("settings-effective-color-scheme"),
+ &crate::i18n::tr("settings-effective-color-scheme-description"),
Self::effective_color_scheme_label(&config),
true,
)?;
@@ -3964,13 +4166,9 @@ impl SettingsWindow {
row_x,
y,
row_width,
- "Config Source",
+ &crate::i18n::tr("settings-config-source"),
&Self::config_source_summary(),
- if config::configuration_file().is_some() {
- "File"
- } else {
- "Defaults"
- },
+ &config_source_kind,
true,
)?;
@@ -3979,7 +4177,7 @@ impl SettingsWindow {
&ui_font,
x,
typography_title_y,
- "Typography",
+ &crate::i18n::tr("settings-typography-heading"),
palette.muted_text,
max_width,
)?;
@@ -3993,13 +4191,15 @@ impl SettingsWindow {
)?;
y = typography_first_row_y;
for area in TYPOGRAPHY_FONT_AREAS {
+ let label = area.localized_label();
+ let description = area.localized_description();
self.paint_font_size_stepper_row(
layers,
row_x,
y,
row_width,
- area.label(),
- area.description(),
+ &label,
+ &description,
self.current_chrome_font_size_value(area),
None,
SettingsAction::ResetChromeFontSize(area),
@@ -4014,8 +4214,8 @@ impl SettingsWindow {
row_x,
y,
row_width,
- "Settings UI Font Weight",
- "Controls the Settings window chrome and content text weight.",
+ &crate::i18n::tr("settings-font-weight"),
+ &crate::i18n::tr("settings-font-weight-description"),
self.current_settings_font_weight_value(),
None,
SettingsAction::ResetSettingsFontWeight,
@@ -4051,7 +4251,7 @@ impl SettingsWindow {
&ui_font,
x,
section_y,
- "Remote Files",
+ &crate::i18n::tr("settings-workspaces-heading"),
palette.muted_text,
max_width,
)?;
@@ -4060,14 +4260,16 @@ impl SettingsWindow {
let row_width = max_width - padding * 2.0;
self.paint_group_card(layers, x, card_y, max_width, card_height)?;
let minutes = self.current_remote_sftp_idle_minutes();
- let value_label = format!("{minutes} min");
+ let mut minutes_args = FluentArgs::new();
+ minutes_args.set("count", minutes);
+ let value_label = crate::i18n::tr_args("common-minutes", &minutes_args);
self.paint_font_size_stepper_row(
layers,
row_x,
first_row_y,
row_width,
- "Remote Files Connection Idle Timeout",
- "Disconnects an unused SFTP session; directory and preview data are released immediately.",
+ &crate::i18n::tr("settings-sftp-idle"),
+ &crate::i18n::tr("settings-sftp-idle-description"),
minutes as f64,
Some(&value_label),
SettingsAction::ResetRemoteSftpIdle,
@@ -4083,9 +4285,9 @@ impl SettingsWindow {
row_x,
first_row_y + row_step,
row_width,
- "Download Folder",
+ &crate::i18n::tr("settings-download-folder"),
&download_label,
- "Choose...",
+ &crate::i18n::tr("common-choose"),
SettingsAction::ChooseRemoteDownloadDirectory,
true,
)?;
@@ -4094,9 +4296,9 @@ impl SettingsWindow {
row_x,
first_row_y + row_step * 2.0,
row_width,
- "Use the System Downloads Folder",
- "Clears the chosen folder so downloads follow this computer's own setting.",
- "Reset",
+ &crate::i18n::tr("settings-system-download-folder"),
+ &crate::i18n::tr("settings-system-download-folder-description"),
+ &crate::i18n::tr("common-reset"),
SettingsAction::ResetRemoteDownloadDirectory,
true,
)?;
@@ -4106,8 +4308,8 @@ impl SettingsWindow {
row_x,
first_row_y + row_step * 3.0,
row_width,
- "Remote Drop Destination",
- "Where files dropped onto a remote terminal are uploaded. Use cwd for the shell's current directory.",
+ &crate::i18n::tr("settings-remote-drop-destination"),
+ &crate::i18n::tr("settings-remote-drop-destination-description"),
&remote_drop_value,
crate::native_settings::DEFAULT_REMOTE_DROP_DESTINATION,
SettingsAction::RemoteDropDestinationInput,
@@ -4133,8 +4335,10 @@ impl SettingsWindow {
let (card_y, first_row_y) = self.settings_card_geometry(section_y, row_count);
let card_height = self.settings_card_height(row_count);
let button_y = card_y + card_height + self.settings_section_card_gap();
- let open_quotes_width = self.button_width_for_label("Open Quotes JSON", 260.0);
- let reset_quotes_width = self.button_width_for_label("Reset Quotes JSON", 260.0);
+ let open_quotes_label = crate::i18n::tr("settings-open-quotes-json");
+ let reset_quotes_label = crate::i18n::tr("settings-reset-quotes-json");
+ let open_quotes_width = self.button_width_for_label(&open_quotes_label, 260.0);
+ let reset_quotes_width = self.button_width_for_label(&reset_quotes_label, 260.0);
let button_gap = 16.0;
let reset_button_x = x + open_quotes_width + button_gap;
let reset_button_y = if open_quotes_width + button_gap + reset_quotes_width <= max_width {
@@ -4146,7 +4350,9 @@ impl SettingsWindow {
self.content_viewport_extent(),
self.settings_content_extent(reset_button_y + scroll + self.ui_px(CONTROL_HEIGHT)),
);
- let font_size = format!("{:.1} pt", config.font_size);
+ let mut font_size_args = FluentArgs::new();
+ font_size_args.set("value", format!("{:.1}", config.font_size));
+ let font_size = crate::i18n::tr_args("common-points", &font_size_args);
let font_family = Self::effective_font_family(&config);
let quote_font_size_label = self.bottom_quote_font_size_label();
let quote_interval_label = self.bottom_quote_interval_label();
@@ -4156,7 +4362,7 @@ impl SettingsWindow {
&ui_font,
x,
section_y,
- "Effective terminal config",
+ &crate::i18n::tr("settings-terminal-heading"),
palette.muted_text,
max_width,
)?;
@@ -4171,8 +4377,8 @@ impl SettingsWindow {
row_x,
first_row_y,
row_width,
- "Font Size",
- "Current effective value from the WezTerm-compatible config.",
+ &crate::i18n::tr("settings-terminal-font-size"),
+ &crate::i18n::tr("settings-terminal-font-size-description"),
&font_size,
false,
)?;
@@ -4181,8 +4387,8 @@ impl SettingsWindow {
row_x,
first_row_y + row_step,
row_width,
- "Font Family",
- "Current primary terminal font family.",
+ &crate::i18n::tr("settings-terminal-font-family"),
+ &crate::i18n::tr("settings-terminal-font-family-description"),
&font_family,
true,
)?;
@@ -4191,8 +4397,8 @@ impl SettingsWindow {
row_x,
first_row_y + row_step * 2.0,
row_width,
- "ThinkTerm Font Size",
- "Saved locally and applied immediately to open terminal windows.",
+ &crate::i18n::tr("settings-terminal-native-font-size"),
+ &crate::i18n::tr("settings-terminal-native-font-size-description"),
self.current_terminal_font_size_value(),
None,
SettingsAction::ResetFontSize,
@@ -4206,8 +4412,8 @@ impl SettingsWindow {
row_x,
first_row_y + row_step * 3.0,
row_width,
- "Native Font Family",
- "Local quick-setting draft. Persistence and terminal application are pending.",
+ &crate::i18n::tr("settings-terminal-native-font-family"),
+ &crate::i18n::tr("settings-terminal-native-font-family-description"),
&native_font_family,
"JetBrains Mono",
SettingsAction::FontFamilyInput,
@@ -4218,8 +4424,8 @@ impl SettingsWindow {
row_x,
first_row_y + row_step * 4.0,
row_width,
- "Bottom Quote",
- "Shows a small quote in the existing bottom gutter.",
+ &crate::i18n::tr("settings-bottom-quote"),
+ &crate::i18n::tr("settings-bottom-quote-description"),
self.native_settings.terminal.bottom_quote_enabled,
SettingsAction::ToggleBottomQuote,
true,
@@ -4229,8 +4435,8 @@ impl SettingsWindow {
row_x,
first_row_y + row_step * 5.0,
row_width,
- "Quote Font Size",
- "Changes only the painted quote text; gutter height stays unchanged.",
+ &crate::i18n::tr("settings-quote-font-size"),
+ &crate::i18n::tr("settings-quote-font-size-description"),
self.current_bottom_quote_font_size(),
Some(&quote_font_size_label),
SettingsAction::ResetBottomQuoteFontSize,
@@ -4243,9 +4449,9 @@ impl SettingsWindow {
row_x,
first_row_y + row_step * 6.0,
row_width,
- "Quote Rotation",
- "Timed rotates in order; pseudo-random picks a stable quote per interval.",
- self.native_settings.terminal.bottom_quote_mode.label(),
+ &crate::i18n::tr("settings-quote-rotation"),
+ &crate::i18n::tr("settings-quote-rotation-description"),
+ &localized_quote_mode_label(self.native_settings.terminal.bottom_quote_mode),
SettingsAction::CycleBottomQuoteMode,
true,
)?;
@@ -4254,8 +4460,8 @@ impl SettingsWindow {
row_x,
first_row_y + row_step * 7.0,
row_width,
- "Quote Interval",
- "Controls how often the bottom quote rotates.",
+ &crate::i18n::tr("settings-quote-interval"),
+ &crate::i18n::tr("settings-quote-interval-description"),
self.current_bottom_quote_interval_minutes() as f64,
Some(&quote_interval_label),
SettingsAction::ResetBottomQuoteInterval,
@@ -4268,7 +4474,7 @@ impl SettingsWindow {
x,
button_y,
open_quotes_width,
- "Open Quotes JSON",
+ &open_quotes_label,
SettingsAction::OpenBottomQuotesJson,
)?;
self.draw_button(
@@ -4280,7 +4486,7 @@ impl SettingsWindow {
},
reset_button_y,
reset_quotes_width,
- "Reset Quotes JSON",
+ &reset_quotes_label,
SettingsAction::ResetBottomQuotesJson,
)?;
Ok(())
@@ -4310,7 +4516,7 @@ impl SettingsWindow {
&ui_font,
x,
section_y,
- "Keep normal Settings clean. Enable developer mode to reveal internal pages. Memory sampling still has to be started manually.",
+ &crate::i18n::tr("settings-developer-description"),
palette.secondary_text,
max_width,
)?;
@@ -4318,19 +4524,25 @@ impl SettingsWindow {
let card_padding = 36.0;
let row_x = x + card_padding;
let row_width = max_width - card_padding * 2.0;
+ let developer_mode_value = if self.developer_mode_enabled() {
+ crate::i18n::tr("common-on")
+ } else {
+ crate::i18n::tr("common-off")
+ };
+ let developer_tabs_value = if self.developer_mode_enabled() {
+ crate::i18n::tr("settings-developer-tabs-value")
+ } else {
+ crate::i18n::tr("common-hidden")
+ };
self.paint_group_card(layers, x, card_y, max_width, card_height)?;
self.paint_setting_row(
layers,
row_x,
first_row_y,
row_width,
- "Developer Mode",
- "Shows internal Settings pages for UI tuning and memory diagnostics.",
- if self.developer_mode_enabled() {
- "On"
- } else {
- "Off"
- },
+ &crate::i18n::tr("settings-developer-mode"),
+ &crate::i18n::tr("settings-developer-mode-description"),
+ &developer_mode_value,
false,
)?;
self.paint_toggle_setting_row(
@@ -4338,11 +4550,9 @@ impl SettingsWindow {
row_x,
first_row_y + row_step,
row_width,
- "Use Fallback Context Menu",
- "On macOS, route right-click menus through the app-rendered fallback for local testing.",
- self.native_settings
- .developer
- .force_fallback_context_menu,
+ &crate::i18n::tr("settings-fallback-menu"),
+ &crate::i18n::tr("settings-fallback-menu-description"),
+ self.native_settings.developer.force_fallback_context_menu,
SettingsAction::ToggleFallbackContextMenu,
true,
)?;
@@ -4351,13 +4561,9 @@ impl SettingsWindow {
row_x,
first_row_y + row_step * 2.0,
row_width,
- "Visible Developer Tabs",
- "UI Kit and Memory/Input tabs are shown here; diagnostics do not run automatically.",
- if self.developer_mode_enabled() {
- "UI Kit, Memory/Input"
- } else {
- "Hidden"
- },
+ &crate::i18n::tr("settings-developer-tabs"),
+ &crate::i18n::tr("settings-developer-tabs-description"),
+ &developer_tabs_value,
false,
)?;
self.paint_setting_row(
@@ -4365,31 +4571,32 @@ impl SettingsWindow {
row_x,
first_row_y + row_step * 3.0,
row_width,
- "Onboarding",
- "Open the setup wizard without changing the saved seen version.",
- "Manual test entry",
+ &crate::i18n::tr("settings-onboarding-launcher"),
+ &crate::i18n::tr("settings-onboarding-launcher-description"),
+ &crate::i18n::tr("settings-onboarding-launcher-value"),
true,
)?;
let developer_label = if self.developer_mode_enabled() {
- "Disable Developer Mode"
+ crate::i18n::tr("settings-disable-developer")
} else {
- "Enable Developer Mode"
+ crate::i18n::tr("settings-enable-developer")
};
- let developer_width = self.button_width_for_label(developer_label, 300.0);
+ let developer_width = self.button_width_for_label(&developer_label, 300.0);
+ let show_onboarding_label = crate::i18n::tr("settings-show-onboarding");
self.draw_button(
layers,
x,
button_y,
developer_width,
- developer_label,
+ &developer_label,
SettingsAction::ToggleDeveloperMode,
)?;
self.draw_button(
layers,
x + developer_width + self.ui_px(14.0),
button_y,
- self.button_width_for_label("Show Onboarding Now", 300.0),
- "Show Onboarding Now",
+ self.button_width_for_label(&show_onboarding_label, 300.0),
+ &show_onboarding_label,
SettingsAction::ShowOnboardingNow,
)?;
@@ -4520,7 +4727,7 @@ impl SettingsWindow {
x,
800.0 - scroll,
preview_width,
- "Theme Mode",
+ &crate::i18n::tr("settings-theme-mode"),
"Follow macOS appearance.",
"System",
false,
@@ -5282,30 +5489,43 @@ impl SettingsWindow {
let thinkterm_source = if thinkterm_path.exists() {
thinkterm_path.display().to_string()
} else {
- format!("Not created yet; target is {}", thinkterm_path.display())
+ let mut args = FluentArgs::new();
+ args.set("path", thinkterm_path.display().to_string());
+ crate::i18n::tr_args("settings-thinkterm-config-missing", &args)
};
let wezterm_source = Self::first_wezterm_config_path()
.map(|path| path.display().to_string())
- .unwrap_or_else(|| "No existing WezTerm config found".to_string());
+ .unwrap_or_else(|| crate::i18n::tr("settings-wezterm-source-missing"));
let loaded_source = self
.compatibility_import
.loaded_source
.as_ref()
.map(|path| path.display().to_string())
- .unwrap_or_else(|| "Not loaded yet".to_string());
+ .unwrap_or_else(|| crate::i18n::tr("settings-not-loaded"));
let loaded_source_description = if self.compatibility_import.warnings.is_empty() {
loaded_source
} else {
- format!(
- "{} ({} warning{})",
- loaded_source,
- self.compatibility_import.warnings.len(),
- if self.compatibility_import.warnings.len() == 1 {
- ""
- } else {
- "s"
- }
- )
+ let mut args = FluentArgs::new();
+ args.set("source", loaded_source);
+ args.set("count", self.compatibility_import.warnings.len());
+ crate::i18n::tr_args("settings-loaded-source-warnings", &args)
+ };
+ let thinkterm_status = if thinkterm_path.exists() {
+ crate::i18n::tr("common-independent")
+ } else {
+ crate::i18n::tr("common-defaults")
+ };
+ let wezterm_status = if Self::first_wezterm_config_path().is_some() {
+ crate::i18n::tr("common-found")
+ } else {
+ crate::i18n::tr("common-missing")
+ };
+ let loaded_status = if self.compatibility_import.error.is_some() {
+ crate::i18n::tr("common-error")
+ } else if field_count > 0 {
+ crate::i18n::tr("common-parsed")
+ } else {
+ crate::i18n::tr("common-idle")
};
self.draw_text(
@@ -5313,7 +5533,7 @@ impl SettingsWindow {
&ui_font,
x,
section_y,
- "ThinkTerm uses its own WezTerm-compatible config. Existing WezTerm files are optional import sources, not shared live state.",
+ &crate::i18n::tr("settings-compatibility-description"),
palette.secondary_text,
max_width,
)?;
@@ -5326,13 +5546,9 @@ impl SettingsWindow {
row_x,
first_row_y,
row_width,
- "ThinkTerm Config",
+ &crate::i18n::tr("settings-thinkterm-config"),
&thinkterm_source,
- if thinkterm_path.exists() {
- "Independent"
- } else {
- "Defaults"
- },
+ &thinkterm_status,
false,
)?;
self.paint_setting_row(
@@ -5340,13 +5556,9 @@ impl SettingsWindow {
row_x,
first_row_y + row_step,
row_width,
- "WezTerm Source",
+ &crate::i18n::tr("settings-wezterm-source"),
&wezterm_source,
- if Self::first_wezterm_config_path().is_some() {
- "Found"
- } else {
- "Missing"
- },
+ &wezterm_status,
true,
)?;
self.paint_setting_row(
@@ -5354,15 +5566,9 @@ impl SettingsWindow {
row_x,
first_row_y + row_step * 2.0,
row_width,
- "Loaded Source",
+ &crate::i18n::tr("settings-loaded-source"),
&loaded_source_description,
- if self.compatibility_import.error.is_some() {
- "Error"
- } else if field_count > 0 {
- "Parsed"
- } else {
- "Idle"
- },
+ &loaded_status,
true,
)?;
@@ -5374,38 +5580,44 @@ impl SettingsWindow {
.filter(|field| field.lua_value.is_some() && self.import_field_selected(field.id))
.count();
let detected_label = if field_count == 0 {
- "No fields loaded".to_string()
+ crate::i18n::tr("settings-no-fields-loaded")
} else {
- format!("{selected_count} of {field_count} selected")
+ let mut args = FluentArgs::new();
+ args.set("selected", selected_count);
+ args.set("total", field_count);
+ crate::i18n::tr_args("settings-fields-selected", &args)
};
self.paint_setting_row(
layers,
row_x,
row_y,
row_width,
- "Importable Fields",
- "Choose exactly which source config values ThinkTerm should copy.",
+ &crate::i18n::tr("settings-importable-fields"),
+ &crate::i18n::tr("settings-importable-fields-description"),
&detected_label,
true,
)?;
row_y += row_step;
if self.compatibility_import.fields.is_empty() {
+ let empty_description = self
+ .compatibility_import
+ .error
+ .clone()
+ .unwrap_or_else(|| crate::i18n::tr("settings-load-source-description"));
+ let empty_status = if self.compatibility_import.error.is_some() {
+ crate::i18n::tr("common-error")
+ } else {
+ crate::i18n::tr("common-empty")
+ };
self.paint_setting_row(
layers,
row_x,
row_y,
row_width,
- "Detected Fields",
- self.compatibility_import
- .error
- .as_deref()
- .unwrap_or("Load a WezTerm source config to inspect importable fields."),
- if self.compatibility_import.error.is_some() {
- "Error"
- } else {
- "Empty"
- },
+ &crate::i18n::tr("settings-detected-fields"),
+ &empty_description,
+ &empty_status,
true,
)?;
} else {
@@ -5415,41 +5627,47 @@ impl SettingsWindow {
row_y += row_step;
}
}
+ let load_label = crate::i18n::tr("settings-load-wezterm-source");
+ let select_all_label = crate::i18n::tr("common-select-all");
+ let clear_label = crate::i18n::tr("common-clear");
+ let import_label = crate::i18n::tr("settings-import-selected");
+ let open_wezterm_label = crate::i18n::tr("settings-open-wezterm-source");
+ let open_thinkterm_label = crate::i18n::tr("settings-open-thinkterm-config");
self.draw_button(
layers,
x,
buttons_y,
- self.button_width_for_label("Load WezTerm Source", 290.0),
- "Load WezTerm Source",
+ self.button_width_for_label(&load_label, 290.0),
+ &load_label,
SettingsAction::LoadWezTermSource,
)?;
- let second_x =
- x + self.button_width_for_label("Load WezTerm Source", 290.0) + self.ui_px(16.0);
+ let second_x = x + self.button_width_for_label(&load_label, 290.0) + self.ui_px(16.0);
self.draw_button(
layers,
second_x,
buttons_y,
- self.button_width_for_label("Select All", 180.0),
- "Select All",
+ self.button_width_for_label(&select_all_label, 180.0),
+ &select_all_label,
SettingsAction::SelectAllImportFields,
)?;
let third_x =
- second_x + self.button_width_for_label("Select All", 180.0) + self.ui_px(16.0);
+ second_x + self.button_width_for_label(&select_all_label, 180.0) + self.ui_px(16.0);
self.draw_button(
layers,
third_x,
buttons_y,
- self.button_width_for_label("Clear", 150.0),
- "Clear",
+ self.button_width_for_label(&clear_label, 150.0),
+ &clear_label,
SettingsAction::ClearImportFields,
)?;
- let fourth_x = third_x + self.button_width_for_label("Clear", 150.0) + self.ui_px(16.0);
+ let fourth_x =
+ third_x + self.button_width_for_label(&clear_label, 150.0) + self.ui_px(16.0);
self.draw_button(
layers,
fourth_x,
buttons_y,
- self.button_width_for_label("Import Selected", 260.0),
- "Import Selected",
+ self.button_width_for_label(&import_label, 260.0),
+ &import_label,
SettingsAction::ImportSelectedFields,
)?;
let open_buttons_y = buttons_y + self.ui_px(CONTROL_HEIGHT) + 14.0;
@@ -5457,18 +5675,18 @@ impl SettingsWindow {
layers,
x,
open_buttons_y,
- self.button_width_for_label("Open WezTerm Source", 300.0),
- "Open WezTerm Source",
+ self.button_width_for_label(&open_wezterm_label, 300.0),
+ &open_wezterm_label,
SettingsAction::OpenWezTermConfigFile,
)?;
let fifth_x =
- x + self.button_width_for_label("Open WezTerm Source", 300.0) + self.ui_px(16.0);
+ x + self.button_width_for_label(&open_wezterm_label, 300.0) + self.ui_px(16.0);
self.draw_button(
layers,
fifth_x,
open_buttons_y,
- self.button_width_for_label("Open ThinkTerm Config", 300.0),
- "Open ThinkTerm Config",
+ self.button_width_for_label(&open_thinkterm_label, 300.0),
+ &open_thinkterm_label,
SettingsAction::OpenThinkTermConfigFile,
)?;
@@ -6265,7 +6483,7 @@ impl SettingsWindow {
&ui_font,
control_x + self.ui_px(16.0),
self.control_text_y(control_y, self.ui_px(CONTROL_HEIGHT)),
- self.native_settings.appearance.theme_mode.label(),
+ &localized_theme_mode_label(self.native_settings.appearance.theme_mode),
palette.text,
control_width - self.ui_px(60.0),
)?;
@@ -6281,6 +6499,96 @@ impl SettingsWindow {
Ok(())
}
+ fn paint_language_row(
+ &mut self,
+ layers: &mut TripleLayerQuadAllocator<'_>,
+ x: f32,
+ y: f32,
+ width: f32,
+ draw_top_rule: bool,
+ ) -> anyhow::Result<()> {
+ let palette = self.palette();
+ let ui_font = Rc::clone(&self.ui_font);
+ if draw_top_rule {
+ self.paint_separator(layers, x, y - self.ui_px(28.0), width)?;
+ }
+
+ let (control_x, control_y, control_width) = self.dropdown_control_geometry(x, y, width);
+ let text_width = (control_x - x - 24.0).max(width * 0.45);
+ let action = SettingsAction::ToggleLanguageMenu;
+ let control_rect = rect(
+ control_x,
+ control_y,
+ control_width,
+ self.ui_px(CONTROL_HEIGHT),
+ );
+ let open = self.ui.open_dropdown == Some(SettingsDropdown::Language);
+ let hovered = self.ui.interaction.hovered == Some(action);
+ let pressed = self.ui.interaction.pressed == Some(action);
+ let bg = if pressed || hovered {
+ palette.control_hover_bg
+ } else {
+ palette.control_bg
+ };
+ let border = if open {
+ palette.nav_selected_bg
+ } else if hovered || pressed {
+ palette.separator
+ } else {
+ palette.control_border
+ };
+
+ self.ui_context
+ .push(control_rect, WidgetKind::Button, action);
+ self.draw_text(
+ layers,
+ &ui_font,
+ x,
+ y,
+ &crate::i18n::tr("settings-language"),
+ palette.text,
+ text_width,
+ )?;
+ self.draw_text(
+ layers,
+ &ui_font,
+ x,
+ self.settings_row_description_y(y),
+ &crate::i18n::tr("settings-language-description"),
+ palette.secondary_text,
+ text_width,
+ )?;
+ self.draw_rounded_frame(
+ layers,
+ 0,
+ control_rect.origin.x,
+ control_rect.origin.y,
+ control_rect.size.width,
+ control_rect.size.height,
+ bg,
+ border,
+ self.ui_px(CONTROL_RADIUS),
+ )?;
+ self.draw_text(
+ layers,
+ &ui_font,
+ control_x + self.ui_px(16.0),
+ self.control_text_y(control_y, self.ui_px(CONTROL_HEIGHT)),
+ &crate::i18n::configured_language_label(&self.native_settings),
+ palette.text,
+ control_width - self.ui_px(60.0),
+ )?;
+ self.draw_svg_icon(
+ layers,
+ SvgIcon::ChevronDown,
+ control_x + control_width - self.ui_px(38.0),
+ control_y + (self.ui_px(CONTROL_HEIGHT) - 22.0) / 2.0,
+ self.ui_px(22.0),
+ palette.secondary_text,
+ )?;
+ Ok(())
+ }
+
fn paint_app_icon_row(
&mut self,
layers: &mut TripleLayerQuadAllocator<'_>,
@@ -6324,7 +6632,15 @@ impl SettingsWindow {
self.ui_context
.push(control_rect, WidgetKind::Button, action);
- self.draw_text(layers, &ui_font, x, y, "App Icon", palette.text, text_width)?;
+ self.draw_text(
+ layers,
+ &ui_font,
+ x,
+ y,
+ &crate::i18n::tr("settings-app-icon"),
+ palette.text,
+ text_width,
+ )?;
self.draw_text(
layers,
&ui_font,
@@ -6361,7 +6677,7 @@ impl SettingsWindow {
&ui_font,
control_x + self.ui_px(16.0),
self.control_text_y(control_y, self.ui_px(CONTROL_HEIGHT)),
- self.native_settings.appearance.app_icon.label(),
+ &localized_app_icon_label(self.native_settings.appearance.app_icon),
palette.text,
control_width - self.ui_px(60.0),
)?;
@@ -6423,7 +6739,7 @@ impl SettingsWindow {
&ui_font,
x,
y,
- "Main Window Renderer",
+ &crate::i18n::tr("settings-main-renderer"),
palette.text,
text_width,
)?;
@@ -6432,7 +6748,7 @@ impl SettingsWindow {
&ui_font,
x,
self.settings_row_description_y(y),
- "Applies to the main terminal window after restart.",
+ &crate::i18n::tr("settings-main-renderer-description"),
palette.secondary_text,
text_width,
)?;
@@ -6483,27 +6799,37 @@ impl SettingsWindow {
}
let button_label = if self.main_renderer_restart_required() {
- "Restart ThinkTerm"
+ crate::i18n::tr("settings-restart-app")
} else {
- "Restart"
+ crate::i18n::tr("settings-restart")
};
let button_width = self
- .button_width_for_label(button_label, 0.0)
+ .button_width_for_label(&button_label, 0.0)
.max(self.ui_px(220.0));
let button_x = x + width - button_width;
let text_width = (button_x - x - 24.0).max(width * 0.45);
let value = if self.main_renderer_restart_required() {
- "Required"
+ crate::i18n::tr("common-required")
} else {
- "Not required"
+ crate::i18n::tr("common-not-required")
};
- self.draw_text(layers, &ui_font, x, y, "Restart", palette.text, text_width)?;
+ self.draw_text(
+ layers,
+ &ui_font,
+ x,
+ y,
+ &crate::i18n::tr("settings-restart"),
+ palette.text,
+ text_width,
+ )?;
+ let mut status_args = FluentArgs::new();
+ status_args.set("status", value);
self.draw_text(
layers,
&ui_font,
x,
self.settings_row_description_y(y),
- &format!("Renderer change status: {value}."),
+ &crate::i18n::tr_args("settings-restart-status", &status_args),
palette.secondary_text,
text_width,
)?;
@@ -6512,7 +6838,7 @@ impl SettingsWindow {
button_x,
y + self.ui_px(4.0),
button_width,
- button_label,
+ &button_label,
SettingsAction::RestartApplication,
)?;
@@ -6550,7 +6876,7 @@ impl SettingsWindow {
let card_padding = 36.0;
let section_y = self.ui_px(CONTENT_SECTION_Y) - scroll;
let row_count = match self.selected {
- SettingsSection::General => 7,
+ SettingsSection::General => 8,
SettingsSection::Appearance => 4,
_ => 4,
};
@@ -6558,6 +6884,7 @@ impl SettingsWindow {
let (row_x, row_y, row_width) = match self.selected {
SettingsSection::Appearance => {
let row_y = match dropdown {
+ SettingsDropdown::Language => return Ok(()),
SettingsDropdown::ThemeMode => first_row_y,
SettingsDropdown::AppIcon => first_row_y + self.settings_row_step(),
SettingsDropdown::MainRenderer => return Ok(()),
@@ -6566,8 +6893,9 @@ impl SettingsWindow {
}
SettingsSection::General => {
let row_y = match dropdown {
- SettingsDropdown::ThemeMode => first_row_y + self.settings_row_step() * 2.0,
- SettingsDropdown::MainRenderer => first_row_y + self.settings_row_step() * 3.0,
+ SettingsDropdown::Language => first_row_y,
+ SettingsDropdown::ThemeMode => first_row_y + self.settings_row_step() * 3.0,
+ SettingsDropdown::MainRenderer => first_row_y + self.settings_row_step() * 4.0,
SettingsDropdown::AppIcon => return Ok(()),
};
(x + card_padding, row_y, max_width - card_padding * 2.0)
@@ -6577,6 +6905,12 @@ impl SettingsWindow {
let (control_x, control_y, control_width) =
self.dropdown_control_geometry(row_x, row_y, row_width);
match dropdown {
+ SettingsDropdown::Language => self.paint_language_menu(
+ layers,
+ control_x,
+ control_y + self.ui_px(CONTROL_HEIGHT) + 8.0,
+ control_width,
+ ),
SettingsDropdown::ThemeMode => self.paint_theme_mode_menu(
layers,
control_x,
@@ -6598,6 +6932,27 @@ impl SettingsWindow {
}
}
+ fn paint_language_menu(
+ &mut self,
+ layers: &mut TripleLayerQuadAllocator<'_>,
+ x: f32,
+ y: f32,
+ width: f32,
+ ) -> anyhow::Result<()> {
+ let configured = crate::i18n::configured_preference(&self.native_settings);
+ let options: Vec<(String, SettingsAction, bool)> = crate::i18n::LANGUAGE_OPTIONS
+ .iter()
+ .map(|option| {
+ (
+ crate::i18n::language_option_label(*option),
+ SettingsAction::SetLanguage(option.preference),
+ configured.eq_ignore_ascii_case(option.preference),
+ )
+ })
+ .collect();
+ self.paint_dropdown_menu(layers, x, y, width, &options)
+ }
+
fn paint_theme_mode_menu(
&mut self,
layers: &mut TripleLayerQuadAllocator<'_>,
@@ -6607,17 +6962,17 @@ impl SettingsWindow {
) -> anyhow::Result<()> {
let options = [
(
- NativeThemeMode::System.label(),
+ localized_theme_mode_label(NativeThemeMode::System),
SettingsAction::SetThemeMode(NativeThemeMode::System),
self.native_settings.appearance.theme_mode == NativeThemeMode::System,
),
(
- NativeThemeMode::Light.label(),
+ localized_theme_mode_label(NativeThemeMode::Light),
SettingsAction::SetThemeMode(NativeThemeMode::Light),
self.native_settings.appearance.theme_mode == NativeThemeMode::Light,
),
(
- NativeThemeMode::Dark.label(),
+ localized_theme_mode_label(NativeThemeMode::Dark),
SettingsAction::SetThemeMode(NativeThemeMode::Dark),
self.native_settings.appearance.theme_mode == NativeThemeMode::Dark,
),
@@ -6634,12 +6989,12 @@ impl SettingsWindow {
) -> anyhow::Result<()> {
let options = [
(
- NativeAppIcon::Simple.label(),
+ localized_app_icon_label(NativeAppIcon::Simple),
SettingsAction::SetAppIcon(NativeAppIcon::Simple),
self.native_settings.appearance.app_icon == NativeAppIcon::Simple,
),
(
- NativeAppIcon::Classic.label(),
+ localized_app_icon_label(NativeAppIcon::Classic),
SettingsAction::SetAppIcon(NativeAppIcon::Classic),
self.native_settings.appearance.app_icon == NativeAppIcon::Classic,
),
@@ -6657,12 +7012,12 @@ impl SettingsWindow {
let current = self.current_main_renderer();
let options = [
(
- NativeRendererBackend::OpenGL.label(),
+ NativeRendererBackend::OpenGL.label().to_string(),
SettingsAction::SetMainRenderer(NativeRendererBackend::OpenGL),
current == NativeRendererBackend::OpenGL,
),
(
- NativeRendererBackend::WebGpu.label(),
+ NativeRendererBackend::WebGpu.label().to_string(),
SettingsAction::SetMainRenderer(NativeRendererBackend::WebGpu),
current == NativeRendererBackend::WebGpu,
),
@@ -6676,7 +7031,7 @@ impl SettingsWindow {
x: f32,
y: f32,
width: f32,
- options: &[(&'static str, SettingsAction, bool)],
+ options: &[(String, SettingsAction, bool)],
) -> anyhow::Result<()> {
let palette = self.palette();
let ui_font = Rc::clone(&self.ui_font);
@@ -6704,7 +7059,9 @@ impl SettingsWindow {
)?;
let mut row_y = y + menu_padding;
- for (label, action, selected) in options.iter().copied() {
+ for (label, action, selected) in options {
+ let action = *action;
+ let selected = *selected;
let row_rect = rect(
x + self.ui_px(8.0),
row_y,
@@ -6799,13 +7156,7 @@ impl SettingsWindow {
}
sections
.into_iter()
- .filter(|section| {
- section.label().to_lowercase().contains(&query)
- || section
- .search_terms()
- .iter()
- .any(|term| term.to_lowercase().contains(&query))
- })
+ .filter(|section| section.matches_search(&query))
.collect()
}
@@ -7407,11 +7758,13 @@ impl SettingsWindow {
fn config_source_summary() -> String {
if let Some(path) = config::configuration_file() {
- format!("Loaded from {}", path.display())
+ let mut args = FluentArgs::new();
+ args.set("path", path.display().to_string());
+ crate::i18n::tr_args("settings-config-source-file", &args)
} else if config::is_config_overridden() {
- "No config file loaded; command-line overrides or --skip-config are active".to_string()
+ crate::i18n::tr("settings-config-source-overridden")
} else {
- "No config file loaded; using built-in defaults".to_string()
+ crate::i18n::tr("settings-config-source-default")
}
}
diff --git a/wezterm-gui/src/termwindow/mouseevent.rs b/wezterm-gui/src/termwindow/mouseevent.rs
index f08cd844..0b5582a5 100644
--- a/wezterm-gui/src/termwindow/mouseevent.rs
+++ b/wezterm-gui/src/termwindow/mouseevent.rs
@@ -21,6 +21,7 @@ use config::keyassignment::{
PaneDirection, SpawnCommand, SpawnTabDomain, SplitPane, SplitSize,
};
use config::{MouseEventAltScreen, TermConfig};
+use fluent_bundle::FluentArgs;
use mux::domain::SplitSource;
use mux::pane::{Pane, WithPaneLines};
use mux::ssh::{RemoteSshDomain, SshConnectionStatus};
@@ -43,6 +44,12 @@ use wezterm_term::{ClickPosition, LastMouseClick, StableRowIndex};
const TAB_WHEEL_SURFACE_LOCK_MS: u64 = 700;
const TAB_WHEEL_DIRECTION_LOCK_MS: u64 = 140;
+fn tr_with_name(id: &'static str, name: &str) -> String {
+ let mut args = FluentArgs::new();
+ args.set("name", name.to_string());
+ crate::i18n::tr_args(id, &args)
+}
+
fn note_drag_scroll_delta(
pointer_y: f32,
top: f32,
@@ -4384,24 +4391,24 @@ impl super::TermWindow {
vec![
ContextMenuItem::item_with_icon(
- "Rename Workspace...",
+ crate::i18n::tr("menu-rename-project"),
ContextMenuIcon::Edit,
KeyAssignment::PromptRenameProject(project_id.clone()),
),
reveal_item,
ContextMenuItem::item_with_icon(
- "New Thread",
+ crate::i18n::tr("menu-new-thread"),
ContextMenuIcon::New,
KeyAssignment::CreateWorkspaceThread(project_id.clone()),
),
ContextMenuItem::item_with_icon(
- "Collapse / Expand Threads",
+ crate::i18n::tr("menu-toggle-threads"),
ContextMenuIcon::Collapse,
KeyAssignment::ToggleWorkspaceThreadsCollapsed(project_id.clone()),
),
ContextMenuItem::Separator,
ContextMenuItem::item_with_icon(
- "Remove Workspace",
+ crate::i18n::tr("menu-remove-project"),
ContextMenuIcon::FolderRemove,
KeyAssignment::RemoveProject(project_id),
),
@@ -4413,9 +4420,9 @@ impl super::TermWindow {
let mut items = vec![];
for space in &spaces {
let label = if space.is_occupied_by_other_window {
- format!("{} (occupied)", space.name)
+ tr_with_name("menu-space-occupied", &space.name)
} else if space.is_remote {
- format!("{} (Remote)", space.name)
+ tr_with_name("menu-space-remote", &space.name)
} else {
space.name.clone()
};
@@ -4439,7 +4446,7 @@ impl super::TermWindow {
items.push(ContextMenuItem::Separator);
items.push(ContextMenuItem::item_with_icon(
- "New Space",
+ crate::i18n::tr("menu-new-space"),
ContextMenuIcon::New,
KeyAssignment::CreateSpace,
));
@@ -4447,8 +4454,8 @@ impl super::TermWindow {
spaces
.iter()
.find(|space| space.is_active)
- .map(|space| format!("Rename \"{}\"...", space.name))
- .unwrap_or_else(|| "Rename Space...".to_string()),
+ .map(|space| tr_with_name("menu-rename-named-space", &space.name))
+ .unwrap_or_else(|| crate::i18n::tr("menu-rename-space")),
ContextMenuIcon::Edit,
KeyAssignment::PromptRenameSpace(self.active_space_id.clone()),
));
@@ -4462,9 +4469,9 @@ impl super::TermWindow {
// are untouched. Label it accordingly.
ContextMenuItem::item_with_icon(
if space.is_remote {
- format!("Disconnect \"{}\" (Server Keeps Running)", space.name)
+ tr_with_name("menu-disconnect-space", &space.name)
} else {
- format!("Delete \"{}\"", space.name)
+ tr_with_name("menu-delete-space", &space.name)
},
ContextMenuIcon::Delete,
KeyAssignment::DeleteSpace(space.id),
@@ -4492,7 +4499,7 @@ impl super::TermWindow {
items.push(delete_item(space));
if offer_remote_kill {
items.push(ContextMenuItem::item_with_icon(
- format!("Delete \"{name}\" & End Remote Sessions"),
+ tr_with_name("menu-delete-space-and-sessions", &name),
ContextMenuIcon::Delete,
KeyAssignment::DeleteSpaceAndRemoteSessions(id),
));
@@ -4506,7 +4513,7 @@ impl super::TermWindow {
.collect::<Vec<_>>();
if !other_delete_candidates.is_empty() {
items.push(ContextMenuItem::submenu_with_icon(
- "Delete Other Space",
+ crate::i18n::tr("menu-delete-other-space"),
ContextMenuIcon::Delete,
other_delete_candidates,
));
@@ -4523,22 +4530,22 @@ impl super::TermWindow {
let mut status_items = Vec::new();
for (label, icon, status) in [
(
- "Running",
+ crate::i18n::tr("menu-status-running"),
ContextMenuIcon::Refresh,
WorkspaceThreadWorkStatus::Running,
),
(
- "Needs Attention",
+ crate::i18n::tr("menu-status-attention"),
ContextMenuIcon::Warning,
WorkspaceThreadWorkStatus::NeedsAttention,
),
(
- "Done",
+ crate::i18n::tr("menu-status-done"),
ContextMenuIcon::Check,
WorkspaceThreadWorkStatus::FinishedUnseen,
),
(
- "Idle",
+ crate::i18n::tr("menu-status-idle"),
ContextMenuIcon::Info,
WorkspaceThreadWorkStatus::Idle,
),
@@ -4558,19 +4565,31 @@ impl super::TermWindow {
}
vec![
- ContextMenuItem::item_with_icon("Group by", ContextMenuIcon::Stack, KeyAssignment::Nop)
- .disabled(),
ContextMenuItem::item_with_icon(
- "Workspace",
+ crate::i18n::tr("menu-group-by"),
+ ContextMenuIcon::Stack,
+ KeyAssignment::Nop,
+ )
+ .disabled(),
+ ContextMenuItem::item_with_icon(
+ crate::i18n::tr("menu-workspace"),
ContextMenuIcon::Folder,
KeyAssignment::Nop,
)
.checked(true)
.disabled(),
ContextMenuItem::Separator,
- ContextMenuItem::item_with_icon("Show", ContextMenuIcon::Info, KeyAssignment::Nop)
- .disabled(),
- ContextMenuItem::submenu_with_icon("Status", ContextMenuIcon::Check, status_items),
+ ContextMenuItem::item_with_icon(
+ crate::i18n::tr("menu-show"),
+ ContextMenuIcon::Info,
+ KeyAssignment::Nop,
+ )
+ .disabled(),
+ ContextMenuItem::submenu_with_icon(
+ crate::i18n::tr("menu-status"),
+ ContextMenuIcon::Check,
+ status_items,
+ ),
]
}
@@ -4624,7 +4643,7 @@ impl super::TermWindow {
self.begin_context_menu_application_actions();
let items = if notifications.is_empty() {
vec![ContextMenuItem::item_with_icon(
- "No notifications",
+ crate::i18n::tr("menu-no-notifications"),
ContextMenuIcon::Notification,
KeyAssignment::Nop,
)
@@ -4738,14 +4757,14 @@ impl super::TermWindow {
.is_some();
if connection.is_remote && connection.is_live {
items.push(ContextMenuItem::item_with_icon(
- "Disconnect Thread",
+ crate::i18n::tr("menu-disconnect-thread"),
ContextMenuIcon::Close,
KeyAssignment::DisconnectWorkspaceThread(thread_id.clone()),
));
items.push(ContextMenuItem::Separator);
} else if connection.is_remote && remote_host_exists {
items.push(ContextMenuItem::item_with_icon(
- "Connect Thread",
+ crate::i18n::tr("menu-connect-thread"),
ContextMenuIcon::ExternalLink,
KeyAssignment::ConnectWorkspaceThread(thread_id.clone()),
));
@@ -4756,9 +4775,9 @@ impl super::TermWindow {
items.extend([
ContextMenuItem::item_with_icon(
if is_pinned {
- "Unpin Thread"
+ crate::i18n::tr("menu-unpin-thread")
} else {
- "Pin Thread"
+ crate::i18n::tr("menu-pin-thread")
},
if is_pinned {
ContextMenuIcon::Unpin
@@ -4768,17 +4787,17 @@ impl super::TermWindow {
KeyAssignment::ToggleWorkspaceThreadPinned(thread_id.clone()),
),
ContextMenuItem::item_with_icon(
- "Rename Thread...",
+ crate::i18n::tr("menu-rename-thread"),
ContextMenuIcon::Edit,
KeyAssignment::PromptRenameWorkspaceThread(thread_id.clone()),
),
ContextMenuItem::item_with_icon(
- "Delete Thread",
+ crate::i18n::tr("menu-delete-thread"),
ContextMenuIcon::Delete,
KeyAssignment::DeleteWorkspaceThread(thread_id.clone()),
),
ContextMenuItem::item_with_icon(
- "Mark as Unread",
+ crate::i18n::tr("menu-mark-unread"),
ContextMenuIcon::Notification,
KeyAssignment::MarkWorkspaceThreadUnread(thread_id),
),
@@ -6131,7 +6150,7 @@ impl super::TermWindow {
}
let mut items = vec![ContextMenuItem::item_with_icon(
- "Rename Tab...",
+ crate::i18n::tr("menu-rename-tab"),
ContextMenuIcon::Edit,
Self::tab_context_action(tab_idx, KeyAssignment::PromptRenameTab),
)];
@@ -6139,21 +6158,21 @@ impl super::TermWindow {
let mut close_items = vec![];
if let Some(action) = Self::close_tabs_to_left_action(tab_idx) {
close_items.push(ContextMenuItem::item_with_icon(
- "Close Tabs to Left",
+ crate::i18n::tr("menu-close-tabs-left"),
ContextMenuIcon::Close,
action,
));
}
if let Some(action) = Self::close_tabs_to_right_action(tab_idx, tab_count) {
close_items.push(ContextMenuItem::item_with_icon(
- "Close Tabs to Right",
+ crate::i18n::tr("menu-close-tabs-right"),
ContextMenuIcon::Close,
action,
));
}
if let Some(action) = Self::close_other_tabs_action(tab_idx, tab_count) {
close_items.push(ContextMenuItem::item_with_icon(
- "Close Other Tabs",
+ crate::i18n::tr("menu-close-other-tabs"),
ContextMenuIcon::Close,
action,
));
@@ -6166,14 +6185,14 @@ impl super::TermWindow {
let mut move_items = vec![];
if tab_idx > 0 {
move_items.push(ContextMenuItem::item_with_icon(
- "Move Tab Left",
+ crate::i18n::tr("menu-move-tab-left"),
ContextMenuIcon::MoveLeft,
Self::tab_context_action(tab_idx, KeyAssignment::MoveTab(tab_idx - 1)),
));
}
if tab_idx + 1 < tab_count {
move_items.push(ContextMenuItem::item_with_icon(
- "Move Tab Right",
+ crate::i18n::tr("menu-move-tab-right"),
ContextMenuIcon::MoveRight,
Self::tab_context_action(tab_idx, KeyAssignment::MoveTab(tab_idx + 1)),
));
@@ -6185,7 +6204,7 @@ impl super::TermWindow {
items.push(ContextMenuItem::Separator);
items.push(ContextMenuItem::item_with_icon(
- "New Terminal Tab to Right",
+ crate::i18n::tr("menu-new-terminal-tab-right"),
ContextMenuIcon::Terminal,
Self::tab_context_action(
tab_idx,
@@ -6194,7 +6213,7 @@ impl super::TermWindow {
));
items.push(ContextMenuItem::Separator);
items.push(ContextMenuItem::item_with_icon(
- "Zoom Pane",
+ crate::i18n::tr("menu-zoom-pane"),
ContextMenuIcon::Expand,
Self::tab_context_action(tab_idx, KeyAssignment::TogglePaneZoomState),
));
@@ -6395,7 +6414,7 @@ impl super::TermWindow {
fn terminal_context_menu_items(&self) -> Vec<ContextMenuItem> {
fn split_item(
- label: &str,
+ label: String,
icon: ContextMenuIcon,
direction: PaneDirection,
) -> ContextMenuItem {
@@ -6413,39 +6432,39 @@ impl super::TermWindow {
vec![
ContextMenuItem::item_with_icon(
- "Copy",
+ crate::i18n::tr("menu-copy"),
ContextMenuIcon::Copy,
KeyAssignment::CopyTo(ClipboardCopyDestination::Clipboard),
),
ContextMenuItem::item_with_icon(
- "Paste",
+ crate::i18n::tr("menu-paste"),
ContextMenuIcon::Paste,
KeyAssignment::PasteFrom(ClipboardPasteSource::Clipboard),
),
ContextMenuItem::Separator,
split_item(
- "Split Right",
+ crate::i18n::tr("menu-split-right"),
ContextMenuIcon::SplitHorizontal,
PaneDirection::Right,
),
split_item(
- "Split Left",
+ crate::i18n::tr("menu-split-left"),
ContextMenuIcon::SplitHorizontal,
PaneDirection::Left,
),
split_item(
- "Split Down",
+ crate::i18n::tr("menu-split-down"),
ContextMenuIcon::SplitVertical,
PaneDirection::Down,
),
split_item(
- "Split Up",
+ crate::i18n::tr("menu-split-up"),
ContextMenuIcon::SplitVertical,
PaneDirection::Up,
),
ContextMenuItem::Separator,
ContextMenuItem::item_with_icon(
- "Reset Terminal",
+ crate::i18n::tr("menu-reset-terminal"),
ContextMenuIcon::Refresh,
KeyAssignment::ResetTerminal,
),
@@ -6503,7 +6522,7 @@ impl super::TermWindow {
items.push(ContextMenuItem::Separator);
}
items.push(self.context_menu_application_item_with_icon(
- "Ignore Spelling",
+ crate::i18n::tr("menu-ignore-spelling"),
ContextMenuIcon::Spellcheck,
ContextMenuApplicationAction::Note(NoteEditorCommand::IgnoreSpelling {
word: issue.word.clone(),
@@ -6511,7 +6530,7 @@ impl super::TermWindow {
true,
));
items.push(self.context_menu_application_item_with_icon(
- "Learn Spelling",
+ crate::i18n::tr("menu-learn-spelling"),
ContextMenuIcon::Spellcheck,
ContextMenuApplicationAction::Note(NoteEditorCommand::LearnSpelling {
word: issue.word,
@@ -6522,7 +6541,7 @@ impl super::TermWindow {
}
if let Some(text) = lookup_text {
items.push(self.context_menu_application_item_with_icon(
- "Look Up",
+ crate::i18n::tr("menu-look-up"),
ContextMenuIcon::Search,
ContextMenuApplicationAction::Note(NoteEditorCommand::LookUp {
text,
@@ -6533,45 +6552,45 @@ impl super::TermWindow {
items.push(ContextMenuItem::Separator);
}
items.push(self.context_menu_application_item_with_icon(
- "Undo",
+ crate::i18n::tr("menu-undo"),
ContextMenuIcon::Undo,
ContextMenuApplicationAction::Note(NoteEditorCommand::Undo),
can_undo,
));
items.push(self.context_menu_application_item_with_icon(
- "Redo",
+ crate::i18n::tr("menu-redo"),
ContextMenuIcon::Redo,
ContextMenuApplicationAction::Note(NoteEditorCommand::Redo),
can_redo,
));
items.push(ContextMenuItem::Separator);
items.push(self.context_menu_application_item_with_icon(
- "Cut",
+ crate::i18n::tr("menu-cut"),
ContextMenuIcon::Cut,
ContextMenuApplicationAction::Note(NoteEditorCommand::Cut),
editable && has_selection,
));
items.push(self.context_menu_application_item_with_icon(
- "Copy",
+ crate::i18n::tr("menu-copy"),
ContextMenuIcon::Copy,
ContextMenuApplicationAction::Note(NoteEditorCommand::Copy),
has_selection,
));
items.push(self.context_menu_application_item_with_icon(
- "Paste",
+ crate::i18n::tr("menu-paste"),
ContextMenuIcon::Paste,
ContextMenuApplicationAction::Note(NoteEditorCommand::Paste),
editable,
));
items.push(self.context_menu_application_item_with_icon(
- "Delete",
+ crate::i18n::tr("menu-delete"),
ContextMenuIcon::Delete,
ContextMenuApplicationAction::Note(NoteEditorCommand::Delete),
editable && has_selection,
));
items.push(ContextMenuItem::Separator);
items.push(self.context_menu_application_item_with_icon(
- "Select All",
+ crate::i18n::tr("menu-select-all"),
ContextMenuIcon::Check,
ContextMenuApplicationAction::Note(NoteEditorCommand::SelectAll),
has_text,
diff --git a/wezterm-gui/src/termwindow/remote_thread_view.rs b/wezterm-gui/src/termwindow/remote_thread_view.rs
index c91e3d70..dd1943fc 100644
--- a/wezterm-gui/src/termwindow/remote_thread_view.rs
+++ b/wezterm-gui/src/termwindow/remote_thread_view.rs
@@ -8,6 +8,7 @@ use crate::ui::{
ScrollState, UiContext, UiPalette, UiTokens, WidgetKind,
};
use crate::workspace_threads::{self, ThreadConnectionState};
+use fluent_bundle::FluentArgs;
use mux::Mux;
use std::rc::Rc;
use std::time::{Duration, Instant};
@@ -25,6 +26,14 @@ const BUTTON_MIN_H: f32 = 52.0;
const HERO_ICON_SIZE: f32 = 64.0;
pub(crate) const REMOTE_THREAD_CONTENT_VIEW_KEY_PREFIX: &str = "remote-thread:";
+fn remote_thread_tr(id: &'static str, values: &[(&'static str, String)]) -> String {
+ let mut args = FluentArgs::new();
+ for (name, value) in values {
+ args.set(*name, value.clone());
+ }
+ crate::i18n::tr_args(id, &args)
+}
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum RemoteThreadAction {
Connect,
@@ -191,12 +200,15 @@ impl RemoteThreadView {
)?;
let status = match &self.phase {
- ViewPhase::Connecting { .. } => format!("Connecting to {}…", self.endpoint),
+ ViewPhase::Connecting { .. } => remote_thread_tr(
+ "remote-thread-connecting-to",
+ &[("endpoint", self.endpoint.clone())],
+ ),
ViewPhase::Failed { message } => message.clone(),
ViewPhase::Idle => self
.stale_message
.clone()
- .unwrap_or_else(|| "This SSH thread is not connected.".to_string()),
+ .unwrap_or_else(|| crate::i18n::tr("remote-thread-not-connected")),
};
ctx.draw_text(
layers,
@@ -276,16 +288,25 @@ impl RemoteThreadView {
font,
x + pad,
y + ctx.px(22.0),
- "Connection",
+ &crate::i18n::tr("remote-thread-connection"),
palette.text,
width - pad * 2.0,
)?;
let row_y = y + ctx.px(70.0);
let label_w = (width * 0.32).clamp(ctx.px(118.0), ctx.px(168.0));
let details = [
- ("Project", self.state.project_name.as_str()),
- ("Endpoint", self.endpoint.as_str()),
- ("Thread", self.state.thread_name.as_str()),
+ (
+ crate::i18n::tr("remote-thread-project"),
+ self.state.project_name.as_str(),
+ ),
+ (
+ crate::i18n::tr("remote-thread-endpoint"),
+ self.endpoint.as_str(),
+ ),
+ (
+ crate::i18n::tr("remote-thread-thread"),
+ self.state.thread_name.as_str(),
+ ),
];
for (idx, (label, value)) in details.iter().enumerate() {
let y = row_y + idx as f32 * (line_h + ctx.px(6.0));
@@ -335,30 +356,35 @@ impl RemoteThreadView {
let frame =
SPINNER_FRAMES[(elapsed.as_millis() / 120) as usize % SPINNER_FRAMES.len()];
(
- format!("{frame} Connecting…"),
- format!(
- "Transport: {} · elapsed {}s",
- self.transport_label(),
- elapsed.as_secs()
+ remote_thread_tr("remote-thread-connecting", &[("frame", frame.to_string())]),
+ remote_thread_tr(
+ "remote-thread-transport-elapsed",
+ &[
+ ("transport", self.transport_label().to_string()),
+ ("seconds", elapsed.as_secs().to_string()),
+ ],
),
)
}
ViewPhase::Failed { .. } => (
- "The connection failed.".to_string(),
- format!(
- "Transport: {} · retry, or cancel to dismiss.",
- self.transport_label()
+ crate::i18n::tr("remote-thread-failed"),
+ remote_thread_tr(
+ "remote-thread-failed-detail",
+ &[("transport", self.transport_label().to_string())],
),
),
ViewPhase::Idle => {
let detail = if self.uses_mosh {
- "Starts mosh-server over SSH, then opens mosh-client."
+ crate::i18n::tr("remote-thread-mosh-detail")
} else {
- "Opens a ThinkTerm SSH session."
+ crate::i18n::tr("remote-thread-ssh-detail")
};
(
- format!("Transport: {}", self.transport_label()),
- detail.to_string(),
+ remote_thread_tr(
+ "remote-thread-transport",
+ &[("transport", self.transport_label().to_string())],
+ ),
+ detail,
)
}
};
@@ -394,17 +420,17 @@ impl RemoteThreadView {
button_h: f32,
) -> anyhow::Result<()> {
// (label, icon, action, primary, enabled)
- let buttons: Vec<(&str, SvgIcon, RemoteThreadAction, bool, bool)> = match &self.phase {
+ let buttons: Vec<(String, SvgIcon, RemoteThreadAction, bool, bool)> = match &self.phase {
ViewPhase::Idle => vec![
(
- "Connect",
+ crate::i18n::tr("remote-thread-connect"),
SvgIcon::Link2,
RemoteThreadAction::Connect,
true,
self.can_connect(),
),
(
- "Delete Thread",
+ crate::i18n::tr("remote-thread-delete"),
SvgIcon::Trash2,
RemoteThreadAction::EndThread,
false,
@@ -413,7 +439,7 @@ impl RemoteThreadView {
],
ViewPhase::Connecting { .. } => {
vec![(
- "Cancel",
+ crate::i18n::tr("remote-thread-cancel"),
SvgIcon::X,
RemoteThreadAction::Cancel,
false,
@@ -422,14 +448,14 @@ impl RemoteThreadView {
}
ViewPhase::Failed { .. } => vec![
(
- "Retry",
+ crate::i18n::tr("remote-thread-retry"),
SvgIcon::RotateCcw,
RemoteThreadAction::Retry,
true,
self.can_connect(),
),
(
- "Cancel",
+ crate::i18n::tr("remote-thread-cancel"),
SvgIcon::X,
RemoteThreadAction::Cancel,
false,
@@ -439,14 +465,14 @@ impl RemoteThreadView {
};
let mut bx = x;
for (label, icon, action, primary, enabled) in buttons {
- let w = (ctx.measure_text_width(font, label) + ctx.px(92.0)).max(ctx.px(168.0));
+ let w = (ctx.measure_text_width(font, &label) + ctx.px(92.0)).max(ctx.px(168.0));
self.paint_action_button(
ctx,
layers,
font,
palette,
rect(bx, y, w, button_h),
- label,
+ &label,
icon,
action,
primary,
@@ -634,7 +660,7 @@ impl ContentView for RemoteThreadView {
let Some(state) =
workspace_threads::thread_connection_state(&self.state.thread_id, &live_workspaces)
else {
- self.stale_message = Some("This saved SSH thread no longer exists.".to_string());
+ self.stale_message = Some(crate::i18n::tr("remote-thread-stale"));
return ContentViewResponse::Redraw;
};
@@ -710,7 +736,7 @@ fn remote_thread_snapshot(state: ThreadConnectionState) -> RemoteThreadSnapshot
.map(format_endpoint)
.unwrap_or_else(|| state.project_name.clone());
let stale_message = if state.is_remote && spec.is_none() {
- Some("The saved SSH host for this thread no longer exists.".to_string())
+ Some(crate::i18n::tr("remote-thread-host-stale"))
} else {
None
};
diff --git a/wezterm-gui/src/termwindow/ssh_hosts_view.rs b/wezterm-gui/src/termwindow/ssh_hosts_view.rs
index a3aabf02..d71e4892 100644
--- a/wezterm-gui/src/termwindow/ssh_hosts_view.rs
+++ b/wezterm-gui/src/termwindow/ssh_hosts_view.rs
@@ -16,6 +16,7 @@ use crate::ui::{
TextInputState, UiContext, UiPalette, UiTokens, WidgetKind,
};
use crate::workspace_threads;
+use fluent_bundle::FluentArgs;
use std::rc::Rc;
use wezterm_font::LoadedFont;
use wezterm_term::{KeyCode, KeyModifiers};
@@ -34,14 +35,14 @@ const FIELD_WORKSPACE: usize = 6;
const FIELD_MOSH_SERVER: usize = 7;
const BASE_FIELD_COUNT: usize = 7;
const FIELD_COUNT: usize = 8;
-const FIELD_LABELS: [&str; BASE_FIELD_COUNT] = [
- "Name",
- "Host",
- "Port",
- "User",
- "Password",
- "Identity file",
- "Workspace",
+const FIELD_LABEL_KEYS: [&str; BASE_FIELD_COUNT] = [
+ "ssh-field-name",
+ "ssh-field-host",
+ "ssh-field-port",
+ "ssh-field-user",
+ "ssh-field-password",
+ "ssh-field-identity",
+ "ssh-field-workspace",
];
/// Heading emitted before the field at the given index, so the form reads as
@@ -91,12 +92,18 @@ fn text_input_with(text: String) -> TextInputState {
input
}
-const FIELD_GROUP_HEADINGS: [(usize, &str); 3] = [
- (FIELD_NAME, "Connection"),
- (FIELD_PASSWORD, "Authentication"),
- (FIELD_WORKSPACE, "Session"),
+const FIELD_GROUP_HEADING_KEYS: [(usize, &str); 3] = [
+ (FIELD_NAME, "ssh-group-connection"),
+ (FIELD_PASSWORD, "ssh-group-authentication"),
+ (FIELD_WORKSPACE, "ssh-group-session"),
];
+fn ssh_error(id: &'static str, error: impl Into<String>) -> String {
+ let mut args = FluentArgs::new();
+ args.set("error", error.into());
+ crate::i18n::tr_args(id, &args)
+}
+
const PAD: f32 = 20.0;
const LEFT_DEFAULT_W: f32 = 500.0;
const LEFT_MIN_W: f32 = 360.0;
@@ -358,7 +365,7 @@ impl SshHostsView {
let form = self.form.as_mut()?;
let host = form.fields[FIELD_HOST].text().trim().to_string();
if host.is_empty() {
- form.error = Some("Host is required".to_string());
+ form.error = Some(crate::i18n::tr("ssh-error-host-required"));
return None;
}
let port = match form.fields[FIELD_PORT].text().trim() {
@@ -366,7 +373,7 @@ impl SshHostsView {
value => match value.parse::<u16>() {
Ok(p) => Some(p),
Err(_) => {
- form.error = Some("Port must be a number".to_string());
+ form.error = Some(crate::i18n::tr("ssh-error-port-number"));
return None;
}
},
@@ -403,7 +410,7 @@ impl SshHostsView {
Ok(encrypted) => Some(encrypted),
Err(err) => {
log::error!("failed to encrypt SSH password: {err:#}");
- form.error = Some(format!("Failed to encrypt password: {err:#}"));
+ form.error = Some(ssh_error("ssh-error-encrypt", format!("{err:#}")));
return None;
}
},
@@ -419,7 +426,7 @@ impl SshHostsView {
spec.multiplexing = form.multiplexing;
let mosh_server_command = form.fields[FIELD_MOSH_SERVER].text().trim();
if spec.use_mosh && mosh_server_command.is_empty() {
- form.error = Some("Mosh server command is required".to_string());
+ form.error = Some(crate::i18n::tr("ssh-error-mosh-command"));
return None;
}
spec.mosh_server_command = if mosh_server_command.is_empty() {
@@ -432,18 +439,18 @@ impl SshHostsView {
Some(id) => match ssh_hosts::try_update_host(id, spec) {
Ok(true) => id.clone(),
Ok(false) => {
- form.error = Some("Host no longer exists".to_string());
+ form.error = Some(crate::i18n::tr("ssh-error-host-missing"));
return None;
}
Err(err) => {
- form.error = Some(format!("Failed to save host: {err:#}"));
+ form.error = Some(ssh_error("ssh-error-save", format!("{err:#}")));
return None;
}
},
None => match ssh_hosts::try_create_host(spec) {
Ok(id) => id,
Err(err) => {
- form.error = Some(format!("Failed to save host: {err:#}"));
+ form.error = Some(ssh_error("ssh-error-save", format!("{err:#}")));
return None;
}
},
@@ -1035,7 +1042,7 @@ impl SshHostsView {
font,
left_x,
list_top + ctx.px(8.0),
- "No hosts yet. Click + to add.",
+ &crate::i18n::tr("ssh-no-hosts"),
palette.muted_text,
inner_left_w,
)?;
@@ -1228,7 +1235,7 @@ impl SshHostsView {
font,
right_x,
oy + h / 2.0 - 10.0,
- "Select a host, or click + to add a new one.",
+ &crate::i18n::tr("ssh-select-host"),
palette.muted_text,
right_w.max(0.0),
)?;
@@ -1257,7 +1264,7 @@ impl SshHostsView {
font,
left_x,
title_y,
- "SSH Hosts",
+ &crate::i18n::tr("ssh-hosts-title"),
palette.text,
inner_left_w,
)?;
@@ -1303,8 +1310,9 @@ impl SshHostsView {
// frame, since it may move the caret.
let search_text_owned = self.search.text().to_string();
self.resolve_pending_caret_click(ctx, font, Focus::Search, &search_text_owned, text_left);
+ let search_placeholder = crate::i18n::tr("ssh-search");
let (search_text, search_color) = if search_text_owned.is_empty() && !search_focused {
- ("Search hosts...", palette.muted_text)
+ (search_placeholder.as_str(), palette.muted_text)
} else {
(search_text_owned.as_str(), palette.text)
};
@@ -1514,7 +1522,9 @@ impl SshHostsView {
SvgIcon::ChevronDown
};
ctx.draw_svg_icon(layers, icon, x + 12.0, y + 12.0, 20.0, palette.muted_text)?;
- let label = format!("System SSH ({})", self.system_host_count);
+ let mut args = FluentArgs::new();
+ args.set("count", self.system_host_count);
+ let label = crate::i18n::tr_args("ssh-system-hosts", &args);
ctx.draw_text(
layers,
font,
@@ -1719,23 +1729,43 @@ impl SshHostsView {
font,
x,
cur_y,
- if editing { "Edit Host" } else { "New Host" },
+ &crate::i18n::tr(if editing {
+ "ssh-edit-host"
+ } else {
+ "ssh-new-host"
+ }),
palette.text,
field_w,
)?;
cur_y += ctx.metrics.cell_size.height as f32 + ctx.px(18.0);
let line_h = ctx.metrics.cell_size.height as f32;
- for (i, label) in FIELD_LABELS.iter().enumerate() {
- if let Some(heading) = FIELD_GROUP_HEADINGS
+ for (i, label_key) in FIELD_LABEL_KEYS.iter().enumerate() {
+ if let Some(heading_key) = FIELD_GROUP_HEADING_KEYS
.iter()
.find_map(|(at, heading)| (*at == i).then_some(*heading))
{
cur_y += ctx.px(if i == 0 { 0.0 } else { 10.0 });
- ctx.draw_text(layers, font, x, cur_y, heading, palette.text, field_w)?;
+ ctx.draw_text(
+ layers,
+ font,
+ x,
+ cur_y,
+ &crate::i18n::tr(heading_key),
+ palette.text,
+ field_w,
+ )?;
cur_y += line_h + ctx.px(10.0);
}
- ctx.draw_text(layers, font, x, cur_y, label, palette.muted_text, field_w)?;
+ ctx.draw_text(
+ layers,
+ font,
+ x,
+ cur_y,
+ &crate::i18n::tr(label_key),
+ palette.muted_text,
+ field_w,
+ )?;
let input_y = cur_y + line_h + ctx.px(6.0);
// Mask the password field.
let masked = if i == FIELD_PASSWORD {
@@ -1782,7 +1812,7 @@ impl SshHostsView {
font,
x,
cur_y + (toggle_h - line_h) / 2.0,
- "Detect OS on connect",
+ &crate::i18n::tr("ssh-detect-os"),
palette.text,
field_w - toggle_w - ctx.px(12.0),
)?;
@@ -1804,7 +1834,7 @@ impl SshHostsView {
font,
x,
cur_y + (toggle_h - line_h) / 2.0,
- "Connect with Mosh",
+ &crate::i18n::tr("ssh-use-mosh"),
palette.text,
field_w - toggle_w - ctx.px(12.0),
)?;
@@ -1859,7 +1889,7 @@ impl SshHostsView {
font,
x,
cur_y + (toggle_h - line_h) / 2.0,
- "ThinkTerm Connect (persistent mux)",
+ &crate::i18n::tr("ssh-use-mux"),
palette.text,
field_w - toggle_w - ctx.px(12.0),
)?;
@@ -1889,7 +1919,7 @@ impl SshHostsView {
font,
x,
cur_y + (advanced_h - line_h) / 2.0,
- &format!("{disclosure} Advanced (ssh_config options)"),
+ &format!("{disclosure} {}", crate::i18n::tr("ssh-advanced")),
palette.text,
field_w,
)?;
@@ -1975,8 +2005,8 @@ impl SshHostsView {
cur_y += ctx.px(INPUT_H) + gap;
}
- let add_label = "+ Add option";
- let add_w = ctx.measure_text_width(font, add_label) + ctx.px(36.0);
+ let add_label = crate::i18n::tr("ssh-add-option");
+ let add_w = ctx.measure_text_width(font, &add_label) + ctx.px(36.0);
// Resolved before `self.widgets` is borrowed mutably below.
let add_state = self.button_state(SshViewAction::AddOption, false);
draw_button(
@@ -1986,7 +2016,7 @@ impl SshHostsView {
&mut self.widgets,
palette,
ButtonSpec {
- label: add_label,
+ label: &add_label,
action: SshViewAction::AddOption,
rect: rect(x, cur_y, add_w, ctx.px(BTN_H)),
state: add_state,
@@ -2014,13 +2044,17 @@ impl SshHostsView {
let btn_w = |label: &str| ctx.measure_text_width(font, label) + ctx.px(36.0);
let mut bx = x;
for (label, action, primary) in [
- ("Save & Open", SshViewAction::SaveAndConnect, true),
- ("Save", SshViewAction::Save, false),
- ("Cancel", SshViewAction::Cancel, false),
+ (
+ crate::i18n::tr("ssh-save-open"),
+ SshViewAction::SaveAndConnect,
+ true,
+ ),
+ (crate::i18n::tr("ssh-save"), SshViewAction::Save, false),
+ (crate::i18n::tr("ssh-cancel"), SshViewAction::Cancel, false),
] {
- let w = btn_w(label);
+ let w = btn_w(&label);
let spec = ButtonSpec {
- label,
+ label: &label,
action,
rect: rect(bx, cur_y, w, ctx.px(BTN_H)),
state: self.button_state(action, primary),
@@ -2085,7 +2119,7 @@ fn open_thread_response(project_id: String) -> ContentViewResponse {
impl ContentView for SshHostsView {
fn title(&self) -> String {
- "SSH Hosts".to_string()
+ crate::i18n::tr("ssh-hosts-title")
}
fn tab_key(&self) -> Option<String> {
diff --git a/wezterm-gui/src/termwindow/ui/context_menu.rs b/wezterm-gui/src/termwindow/ui/context_menu.rs
index 95b15e8b..4381d5aa 100644
--- a/wezterm-gui/src/termwindow/ui/context_menu.rs
+++ b/wezterm-gui/src/termwindow/ui/context_menu.rs
@@ -35,13 +35,13 @@ const MENU_ROW_RADIUS: f32 = 18.0;
const MENU_ROW_HOVER_INSET_X: usize = 10;
const MENU_ROW_HOVER_INSET_Y: usize = 4;
-pub(crate) fn reveal_in_folder_label() -> &'static str {
+pub(crate) fn reveal_in_folder_label() -> String {
if cfg!(target_os = "macos") {
- "Reveal in Finder"
+ crate::i18n::tr("menu-reveal-finder")
} else if cfg!(target_os = "windows") {
- "Show in File Explorer"
+ crate::i18n::tr("menu-reveal-explorer")
} else {
- "Show in Folder"
+ crate::i18n::tr("menu-reveal-folder")
}
}
diff --git a/wezterm-gui/src/termwindow/ui/right_sidebar.rs b/wezterm-gui/src/termwindow/ui/right_sidebar.rs
index 25f59ce2..a102b595 100644
--- a/wezterm-gui/src/termwindow/ui/right_sidebar.rs
+++ b/wezterm-gui/src/termwindow/ui/right_sidebar.rs
@@ -49,6 +49,7 @@ use crate::utilsprites::RenderMetrics;
use crate::workspace_threads;
use anyhow::Context;
use config::keyassignment::{ClipboardCopyDestination, ClipboardPasteSource, KeyAssignment};
+use fluent_bundle::FluentArgs;
use mux::pane::{Pane, PaneId};
use mux::Mux;
use std::borrow::Cow;
@@ -260,7 +261,11 @@ fn remote_lease_failure_disposition(
}
const FILE_PREVIEW_MAX_BYTES: usize = 256 * 1024;
-const FILE_PREVIEW_TRUNCATED_LABEL: &str = "Preview truncated to 256 KiB";
+fn right_sidebar_arg(id: &'static str, name: &'static str, value: impl Into<String>) -> String {
+ let mut args = FluentArgs::new();
+ args.set(name, value.into());
+ crate::i18n::tr_args(id, &args)
+}
const FILE_PREVIEW_IMAGE_MAX_BYTES: usize = 16 * 1024 * 1024;
// The file-size cap above bounds the *encoded* bytes, but a small encoded image
// can decode to an enormous RGBA bitmap (`width × height × 4`, ×frames for
@@ -1034,11 +1039,11 @@ impl RightSidebarMode {
}
}
- fn label(self) -> &'static str {
+ fn label(self) -> String {
match self {
- Self::Chat => "File",
- Self::Tasks => "Note",
- Self::Snippets => "Snippets",
+ Self::Chat => crate::i18n::tr("right-mode-files"),
+ Self::Tasks => crate::i18n::tr("right-mode-notes"),
+ Self::Snippets => crate::i18n::tr("right-mode-snippets"),
}
}
}
@@ -1787,7 +1792,7 @@ impl crate::TermWindow {
self.right_sidebar_file_preview_max_columns = 0;
self.clear_right_sidebar_file_preview_slice_cache();
self.right_sidebar_file_preview_image = None;
- self.right_sidebar_file_preview_message = Some("Loading file preview...".to_string());
+ self.right_sidebar_file_preview_message = Some(crate::i18n::tr("right-loading-preview"));
self.right_sidebar_file_preview_truncated = false;
self.right_sidebar_file_preview_selection = None;
self.right_sidebar_file_preview_scroll_offset = 0.0;
@@ -1796,7 +1801,8 @@ impl crate::TermWindow {
self.prefetch_right_sidebar_file_open_with(&path);
let Some(window) = self.window.as_ref().cloned() else {
- self.right_sidebar_file_preview_message = Some("Window is unavailable".to_string());
+ self.right_sidebar_file_preview_message =
+ Some(crate::i18n::tr("right-window-unavailable"));
return;
};
let use_dark_syntax_theme = matches!(
@@ -1816,7 +1822,11 @@ impl crate::TermWindow {
.unwrap_or_else(|err| RightSidebarLoadedFilePreview {
lines: Vec::new(),
image: None,
- message: Some(format!("Unable to load file preview: {err}")),
+ message: Some(right_sidebar_arg(
+ "right-preview-error",
+ "error",
+ err.to_string(),
+ )),
truncated: false,
raw_text: None,
});
@@ -2245,7 +2255,7 @@ impl crate::TermWindow {
let mut items = Vec::new();
if !path.is_dir() {
items.push(ContextMenuItem::item_with_icon(
- "Open",
+ crate::i18n::tr("right-open"),
ContextMenuIcon::ExternalLink,
KeyAssignment::OpenFileWithSystemDefault(path_string.clone()),
));
@@ -2256,18 +2266,18 @@ impl crate::TermWindow {
KeyAssignment::RevealFileInFolder(path_string.clone()),
));
items.push(ContextMenuItem::item_with_icon(
- "Copy Path",
+ crate::i18n::tr("right-copy-path"),
ContextMenuIcon::Copy,
KeyAssignment::CopyFilePathToClipboard(path_string.clone()),
));
items.push(ContextMenuItem::Separator);
items.push(ContextMenuItem::item_with_icon(
- "Rename...",
+ crate::i18n::tr("right-rename"),
ContextMenuIcon::Edit,
KeyAssignment::RenameSidebarFile(path_string.clone()),
));
items.push(ContextMenuItem::item_with_icon(
- "Move to Trash",
+ crate::i18n::tr("right-move-trash"),
ContextMenuIcon::Delete,
KeyAssignment::TrashSidebarFile(path_string),
));
@@ -2390,7 +2400,7 @@ impl crate::TermWindow {
.filter(|candidate| current_id.as_deref() != Some(candidate.id.as_str()))
.map(|candidate| {
ContextMenuItem::item_with_icon(
- format!("Open With {}", candidate.label),
+ right_sidebar_arg("right-open-with", "app", candidate.label.clone()),
ContextMenuIcon::Application,
KeyAssignment::OpenFileWith {
path: path_string.clone(),
@@ -2405,7 +2415,7 @@ impl crate::TermWindow {
items.push(ContextMenuItem::Separator);
}
items.push(ContextMenuItem::item_with_icon(
- "Open With Other…",
+ crate::i18n::tr("right-open-with-other"),
ContextMenuIcon::Application,
KeyAssignment::PickOpenFileWithApp(path_string),
));
@@ -3240,13 +3250,13 @@ impl crate::TermWindow {
let notify_window = window.clone();
let options = if managed {
FolderPickerOptions {
- title: "Create Vault".to_string(),
- prompt: "Create".to_string(),
+ title: crate::i18n::tr("right-create-vault"),
+ prompt: crate::i18n::tr("right-create"),
}
} else {
FolderPickerOptions {
- title: "Choose Vault".to_string(),
- prompt: "Choose".to_string(),
+ title: crate::i18n::tr("right-choose-vault"),
+ prompt: crate::i18n::tr("right-choose"),
}
};
window.pick_folder_async_with_options(
@@ -3443,7 +3453,7 @@ impl crate::TermWindow {
SaveState::Saved | SaveState::Saving(_)
);
let mut source_item = self.context_menu_application_item_with_icon(
- "Source Mode",
+ crate::i18n::tr("right-source-mode"),
ContextMenuIcon::Code,
crate::termwindow::ContextMenuApplicationAction::Note(
NoteEditorCommand::ToggleSourceMode,
@@ -3453,24 +3463,24 @@ impl crate::TermWindow {
source_item = source_item.checked(source_mode);
let vault_tree_label = if self.right_sidebar_note_wide_layout {
if self.right_sidebar_note_vault_tree_collapsed {
- "Show Vault Sidebar"
+ crate::i18n::tr("right-show-vault-sidebar")
} else {
- "Hide Vault Sidebar"
+ crate::i18n::tr("right-hide-vault-sidebar")
}
} else if self.right_sidebar_note_view == RightSidebarNoteView::Tree {
- "Hide Vault"
+ crate::i18n::tr("right-hide-vault")
} else {
- "Show Vault"
+ crate::i18n::tr("right-show-vault")
};
let items = vec![
self.context_menu_application_item_with_icon(
- "New Note",
+ crate::i18n::tr("right-new-note"),
ContextMenuIcon::Note,
crate::termwindow::ContextMenuApplicationAction::Note(NoteEditorCommand::NewNote),
true,
),
self.context_menu_application_item_with_icon(
- "Save",
+ crate::i18n::tr("right-save"),
ContextMenuIcon::Save,
crate::termwindow::ContextMenuApplicationAction::Note(NoteEditorCommand::Save),
save_enabled,
@@ -3486,7 +3496,7 @@ impl crate::TermWindow {
),
ContextMenuItem::Separator,
self.context_menu_application_item_with_icon(
- "Choose Another Vault…",
+ crate::i18n::tr("right-choose-another-vault"),
ContextMenuIcon::Vault,
crate::termwindow::ContextMenuApplicationAction::Note(
NoteEditorCommand::ChooseVault { managed: false },
@@ -5221,7 +5231,7 @@ impl crate::TermWindow {
// several times per frame, so it must stay O(1).
let max_line_columns = self.right_sidebar_file_preview_max_columns;
if self.right_sidebar_file_preview_truncated {
- max_line_columns.max(FILE_PREVIEW_TRUNCATED_LABEL.chars().count())
+ max_line_columns.max(crate::i18n::tr("right-preview-truncated").chars().count())
} else {
max_line_columns
}
@@ -5796,8 +5806,9 @@ impl crate::TermWindow {
.clamp(self.ui_px(24), self.ui_px(30))
.min(mode_height.saturating_sub(self.ui_px(22)))
.max(1);
+ let active_mode_label = self.right_sidebar_mode.label();
let active_label_target_width = self
- .sidebar_text_width(&ui_font, self.right_sidebar_mode.label())?
+ .sidebar_text_width(&ui_font, &active_mode_label)?
.ceil() as usize
+ self.ui_px(MODE_LABEL_CLIP_SLOP);
let inactive_segment_min_width = (mode_icon_size + self.ui_px(SIDEBAR_INSET) * 4)
@@ -5922,11 +5933,12 @@ impl crate::TermWindow {
},
)?;
if active && label_width > 0 {
+ let mode_label = mode.label();
self.paint_sidebar_text(
layers,
&ui_font,
ui_metrics,
- mode.label(),
+ &mode_label,
icon_x + mode_icon_size + self.ui_px(SIDEBAR_ICON_GAP),
mode_y + (mode_height.saturating_sub(ui_cell_height)) / 2,
label_width,
@@ -6166,7 +6178,7 @@ impl crate::TermWindow {
layers,
ui_font,
ui_metrics,
- "Vault",
+ &crate::i18n::tr("right-vault"),
title_x,
content_top + header_height.saturating_sub(ui_metrics.cell_size.height as usize) / 2,
content_x.saturating_add(content_width).saturating_sub(
@@ -6346,7 +6358,7 @@ impl crate::TermWindow {
.right_sidebar_note
.load_error
.clone()
- .unwrap_or_else(|| "Unable to open Notes".to_string());
+ .unwrap_or_else(|| crate::i18n::tr("right-notes-open-error"));
self.paint_sidebar_text(
layers,
ui_font,
@@ -6373,7 +6385,7 @@ impl crate::TermWindow {
content_width,
button_height,
Some(SvgIcon::FolderOpen),
- "Choose Existing Vault…",
+ &crate::i18n::tr("right-choose-existing-vault"),
UIItemType::RightSidebarNoteChooseVault,
true,
)?;
@@ -6389,7 +6401,7 @@ impl crate::TermWindow {
content_width,
button_height,
Some(SvgIcon::FolderPlus),
- "Create New Vault…",
+ &crate::i18n::tr("right-create-new-vault"),
UIItemType::RightSidebarNoteCreateVault,
true,
)?;
@@ -6836,7 +6848,7 @@ impl crate::TermWindow {
layers,
ui_font,
ui_metrics,
- "Laying out note…",
+ &crate::i18n::tr("right-laying-out-note"),
content_x + self.ui_px(NOTE_BODY_PADDING),
body_y + self.ui_px(NOTE_BODY_PADDING),
content_width.saturating_sub(self.ui_px(NOTE_BODY_PADDING) * 2),
@@ -8252,7 +8264,7 @@ impl crate::TermWindow {
}
}
if self.right_sidebar_note_opening.as_ref() == Some(&key) {
- self.right_sidebar_note.load_error = Some("Opening note…".to_string());
+ self.right_sidebar_note.load_error = Some(crate::i18n::tr("right-opening-note"));
return false;
}
@@ -8268,7 +8280,7 @@ impl crate::TermWindow {
let generation = self.right_sidebar_note_open_generation;
self.right_sidebar_note_opening = Some(key.clone());
self.right_sidebar_note_open_failure = None;
- self.right_sidebar_note.load_error = Some("Opening note…".to_string());
+ self.right_sidebar_note.load_error = Some(crate::i18n::tr("right-opening-note"));
let Some(window) = self.window.as_ref().cloned() else {
self.right_sidebar_note_opening = None;
return false;
@@ -8324,16 +8336,15 @@ impl crate::TermWindow {
fn ensure_active_right_sidebar_note_document(&mut self) -> bool {
let Some(vault) = workspace_threads::space_note_vault(&self.active_space_id) else {
- self.right_sidebar_note.clear_document(Some(
- "Choose an existing Vault or create a new one to start Notes.".to_string(),
- ));
+ self.right_sidebar_note
+ .clear_document(Some(crate::i18n::tr("right-notes-first-use")));
return false;
};
let Some(project_id) =
workspace_threads::active_project_id_for_space(&self.active_space_id)
else {
self.right_sidebar_note
- .clear_document(Some("No active Project in this Space.".to_string()));
+ .clear_document(Some(crate::i18n::tr("right-no-active-project")));
return false;
};
@@ -8351,7 +8362,8 @@ impl crate::TermWindow {
if self.right_sidebar_note_vault_index_root.as_ref() != Some(&vault.root)
|| self.right_sidebar_note_vault_indexing
{
- self.right_sidebar_note.load_error = Some("Indexing Vault…".to_string());
+ self.right_sidebar_note.load_error =
+ Some(crate::i18n::tr("right-indexing-vault"));
return false;
}
self.right_sidebar_note_vault_paths
@@ -8778,6 +8790,11 @@ impl crate::TermWindow {
// detail line, since only the tree view paints `error_message`.
let notice = self.right_sidebar_remote_files.error_message.clone();
let disconnected_detail = notice.as_deref().or(target_label.as_deref());
+ let not_connected = crate::i18n::tr("right-not-connected");
+ let connect = crate::i18n::tr("right-connect");
+ let connecting = crate::i18n::tr("right-connecting");
+ let connection_failed = crate::i18n::tr("right-connection-failed");
+ let retry = crate::i18n::tr("right-retry");
match phase {
RemoteFilesPhase::Disconnected => self.paint_remote_files_empty_state(
layers,
@@ -8792,9 +8809,9 @@ impl crate::TermWindow {
// "something broke" the first time the panel is opened.
SvgIcon::Server,
false,
- "Not connected",
+ &not_connected,
disconnected_detail,
- Some(("Connect", true)),
+ Some((&connect, true)),
),
RemoteFilesPhase::Connecting => self.paint_remote_files_empty_state(
layers,
@@ -8809,9 +8826,9 @@ impl crate::TermWindow {
// Spinning also drives the repaint schedule, so the panel keeps
// animating instead of freezing for the length of the connect.
true,
- "Connecting…",
+ &connecting,
target_label.as_deref(),
- Some(("Connecting…", false)),
+ Some((&connecting, false)),
),
RemoteFilesPhase::Failed(message) => self.paint_remote_files_empty_state(
layers,
@@ -8824,9 +8841,9 @@ impl crate::TermWindow {
content_bottom,
SvgIcon::CircleAlert,
false,
- "Connection failed",
+ &connection_failed,
Some(message.as_str()),
- Some(("Retry", true)),
+ Some((&retry, true)),
),
RemoteFilesPhase::Connected => self.paint_remote_files_tree(
layers,
@@ -9051,9 +9068,8 @@ impl crate::TermWindow {
.right_sidebar_remote_files
.target
.as_ref()
- .map(|target| target.project_name.as_str())
- .unwrap_or("Remote Files")
- .to_string();
+ .map(|target| target.project_name.clone())
+ .unwrap_or_else(|| crate::i18n::tr("right-remote-files"));
self.paint_sidebar_text(
layers,
ui_font,
@@ -9110,7 +9126,7 @@ impl crate::TermWindow {
content_width,
content_bottom,
self.ui_px(22),
- "Loading remote directory...",
+ &crate::i18n::tr("right-loading-remote-directory"),
);
}
@@ -9241,7 +9257,7 @@ impl crate::TermWindow {
layers,
ui_font,
ui_metrics,
- "More entries are not shown",
+ &crate::i18n::tr("right-more-entries"),
content_x,
footer_y,
content_width,
@@ -9330,9 +9346,9 @@ impl crate::TermWindow {
}
if hidden > 0 {
let more = if hidden == 1 {
- "1 more transfer".to_string()
+ crate::i18n::tr("right-more-transfer")
} else {
- format!("{hidden} more transfers")
+ right_sidebar_arg("right-more-transfers", "count", hidden.to_string())
};
self.paint_sidebar_text(
layers,
@@ -11058,7 +11074,7 @@ impl crate::TermWindow {
match kind {
RemoteFileKind::File => {
items.push(self.context_menu_application_item_with_icon(
- "Download",
+ crate::i18n::tr("right-download"),
// No dedicated download glyph in the shared icon set; Save
// is the closest fit and already maps on every platform.
ContextMenuIcon::Save,
@@ -11071,7 +11087,7 @@ impl crate::TermWindow {
}
RemoteFileKind::Directory => {
items.push(self.context_menu_application_item_with_icon(
- "Download",
+ crate::i18n::tr("right-download"),
ContextMenuIcon::Save,
crate::termwindow::ContextMenuApplicationAction::DownloadRemoteFolder {
path: path.clone(),
@@ -11081,7 +11097,7 @@ impl crate::TermWindow {
enabled,
));
items.push(self.context_menu_application_item_with_icon(
- "New Folder",
+ crate::i18n::tr("right-new-folder"),
ContextMenuIcon::FolderAdd,
crate::termwindow::ContextMenuApplicationAction::NewRemoteFolder {
parent: path.clone(),
@@ -11095,13 +11111,13 @@ impl crate::TermWindow {
RemoteFileKind::Symlink | RemoteFileKind::Other => {}
}
items.push(ContextMenuItem::item_with_icon(
- "Copy Path",
+ crate::i18n::tr("right-copy-path"),
ContextMenuIcon::Copy,
KeyAssignment::CopyFilePathToClipboard(path_string),
));
if !is_root {
items.push(self.context_menu_application_item_with_icon(
- "Rename\u{2026}",
+ crate::i18n::tr("right-rename"),
ContextMenuIcon::Edit,
crate::termwindow::ContextMenuApplicationAction::RenameRemoteEntry {
path: path.clone(),
@@ -11111,7 +11127,7 @@ impl crate::TermWindow {
));
items.push(ContextMenuItem::Separator);
items.push(self.context_menu_application_item_with_icon(
- "Delete\u{2026}",
+ crate::i18n::tr("right-delete"),
ContextMenuIcon::Delete,
crate::termwindow::ContextMenuApplicationAction::DeleteRemoteEntry {
path,
@@ -11261,13 +11277,11 @@ impl crate::TermWindow {
// The count goes into each label rather than a heading row: every
// option then says exactly what it will do, and there is no inert row
// for the user to try clicking.
- let noun = if count == 1 { "file" } else { "files" };
-
// One pass: beginning the block clears the action table, so minting an
// item after a second call would leave the earlier ones dead.
self.begin_context_menu_application_actions();
let overwrite = self.context_menu_application_item_with_icon(
- format!("Replace {count} existing {noun}"),
+ right_sidebar_arg("right-replace-conflicts", "count", count.to_string()),
ContextMenuIcon::Save,
crate::termwindow::ContextMenuApplicationAction::ResolveLocalCopyConflict(
ConflictChoice::Overwrite,
@@ -11275,7 +11289,7 @@ impl crate::TermWindow {
true,
);
let skip = self.context_menu_application_item_with_icon(
- format!("Skip {count} existing {noun}"),
+ right_sidebar_arg("right-skip-conflicts", "count", count.to_string()),
ContextMenuIcon::Check,
crate::termwindow::ContextMenuApplicationAction::ResolveLocalCopyConflict(
ConflictChoice::Skip,
@@ -11283,7 +11297,7 @@ impl crate::TermWindow {
true,
);
let cancel = self.context_menu_application_item_with_icon(
- "Cancel the copy",
+ crate::i18n::tr("right-cancel-copy"),
ContextMenuIcon::Close,
crate::termwindow::ContextMenuApplicationAction::ResolveLocalCopyConflict(
ConflictChoice::Cancel,
@@ -11434,19 +11448,19 @@ impl crate::TermWindow {
// turn the earlier items into dead entries.
self.begin_context_menu_application_actions();
let copy_selection = self.context_menu_application_item_with_icon(
- "Copy",
+ crate::i18n::tr("menu-copy"),
ContextMenuIcon::Copy,
crate::termwindow::ContextMenuApplicationAction::CopyRemotePreviewSelection,
has_selection,
);
let copy_all = self.context_menu_application_item_with_icon(
- "Copy All",
+ crate::i18n::tr("right-copy-all"),
ContextMenuIcon::Copy,
crate::termwindow::ContextMenuApplicationAction::CopyRemotePreviewAll,
has_text,
);
let download = self.context_menu_application_item_with_icon(
- "Download",
+ crate::i18n::tr("right-download"),
ContextMenuIcon::Save,
crate::termwindow::ContextMenuApplicationAction::DownloadRemoteFile { path, origin },
can_download,
@@ -11834,20 +11848,36 @@ impl crate::TermWindow {
};
let (proceed_label, proceed_icon) = match &pending {
PendingRemoteConfirm::FolderDownload { plan, .. } => (
- format!("Download {} items", plan.entries.len()),
+ right_sidebar_arg(
+ "right-confirm-download",
+ "count",
+ plan.entries.len().to_string(),
+ ),
ContextMenuIcon::Save,
),
PendingRemoteConfirm::FolderDelete { plan, .. } => (
// +1: the folder itself goes too.
- format!("Delete {} items permanently", plan.entries.len() + 1),
+ right_sidebar_arg(
+ "right-confirm-delete-items",
+ "count",
+ (plan.entries.len() + 1).to_string(),
+ ),
ContextMenuIcon::Delete,
),
PendingRemoteConfirm::FileDelete { remote, .. } => (
- format!("Delete \u{201c}{}\u{201d} permanently", remote.file_name()),
+ right_sidebar_arg(
+ "right-confirm-delete-name",
+ "name",
+ remote.file_name().to_string(),
+ ),
ContextMenuIcon::Delete,
),
PendingRemoteConfirm::FolderUpload { plan, .. } => (
- format!("Upload {} items", plan.entries.len()),
+ right_sidebar_arg(
+ "right-confirm-upload",
+ "count",
+ plan.entries.len().to_string(),
+ ),
ContextMenuIcon::Save,
),
};
@@ -11859,7 +11889,7 @@ impl crate::TermWindow {
true,
);
let cancel = self.context_menu_application_item_with_icon(
- "Cancel",
+ crate::i18n::tr("right-cancel"),
ContextMenuIcon::Close,
crate::termwindow::ContextMenuApplicationAction::ResolveRemoteConfirm(false),
true,
@@ -12440,13 +12470,13 @@ impl crate::TermWindow {
};
self.begin_context_menu_application_actions();
let retry = self.context_menu_application_item_with_icon(
- "Retry",
+ crate::i18n::tr("right-retry"),
ContextMenuIcon::Refresh,
crate::termwindow::ContextMenuApplicationAction::RetryRemoteTransfer { id, anchor },
true,
);
let dismiss = self.context_menu_application_item_with_icon(
- "Dismiss",
+ crate::i18n::tr("right-dismiss"),
ContextMenuIcon::Close,
crate::termwindow::ContextMenuApplicationAction::DismissRemoteTransfer(id),
true,
@@ -12923,6 +12953,7 @@ impl crate::TermWindow {
let refresh_x = content_x + content_width - refresh_size;
let refresh_y =
content_top + self.ui_px(FILE_FILTER_HEIGHT).saturating_sub(refresh_size) / 2;
+ let filter_label = crate::i18n::tr("right-filter-files");
let filter_input = self.right_sidebar_file_filter.clone();
self.paint_snippet_text_box(
@@ -12937,7 +12968,7 @@ impl crate::TermWindow {
filter_width,
self.ui_px(FILE_FILTER_HEIGHT),
Some(SvgIcon::Search),
- "Filter files",
+ &filter_label,
&filter_input,
self.right_sidebar_file_focus == Some(RightSidebarFileField::Filter),
UIItemType::RightSidebarFileFilter,
@@ -12998,7 +13029,7 @@ impl crate::TermWindow {
content_width,
content_bottom,
icon_size,
- "Indexing files...",
+ &crate::i18n::tr("right-indexing-files"),
);
}
},
@@ -13029,7 +13060,7 @@ impl crate::TermWindow {
content_width,
content_bottom,
icon_size,
- "Indexing files...",
+ &crate::i18n::tr("right-indexing-files"),
);
}
};
@@ -13055,7 +13086,7 @@ impl crate::TermWindow {
content_width,
content_bottom,
icon_size,
- "Searching files...",
+ &crate::i18n::tr("right-searching-files"),
);
}
@@ -13071,7 +13102,7 @@ impl crate::TermWindow {
content_width,
content_bottom,
icon_size,
- "No matching files",
+ &crate::i18n::tr("right-no-matching-files"),
);
}
@@ -13172,7 +13203,7 @@ impl crate::TermWindow {
filter_width,
self.ui_px(FILE_FILTER_HEIGHT),
Some(SvgIcon::Search),
- "Filter files",
+ &filter_label,
&filter_input,
self.right_sidebar_file_focus == Some(RightSidebarFileField::Filter),
UIItemType::RightSidebarFileFilter,
@@ -13530,8 +13561,8 @@ impl crate::TermWindow {
// actually used.
let app_label = self.right_sidebar_current_open_with_app_label(path);
let open_label = match &app_label {
- Some(app) => format!("Open With {app}"),
- None => "Open".to_string(),
+ Some(app) => right_sidebar_arg("right-open-with", "app", app.clone()),
+ None => crate::i18n::tr("right-open"),
};
let label_px = self
.sidebar_text_width(ui_font, &open_label)
@@ -13996,13 +14027,11 @@ impl crate::TermWindow {
}
if self.right_sidebar_file_preview_truncated {
+ let truncated_label = crate::i18n::tr("right-preview-truncated");
let line_top = body_y as f32 + (line_count * line_height) as f32 - scroll_offset;
if line_top < body_bottom as f32 {
- let visible_text = preview_text_slice(
- FILE_PREVIEW_TRUNCATED_LABEL,
- horizontal_offset,
- paint_columns,
- );
+ let visible_text =
+ preview_text_slice(&truncated_label, horizontal_offset, paint_columns);
self.paint_sidebar_text(
layers,
ui_font,
@@ -14587,10 +14616,11 @@ impl crate::TermWindow {
icon_size: usize,
) -> anyhow::Result<()> {
let toolbar_y = content_top;
+ let new_snippet_label = crate::i18n::tr("right-new-snippet");
let new_button_icon_size = (ui_metrics.cell_size.height as usize + self.ui_px(2))
.clamp(self.ui_px(18), self.ui_px(22));
let new_button_label_width =
- self.sidebar_text_width(ui_font, "New Snippet")?.ceil() as usize;
+ self.sidebar_text_width(ui_font, &new_snippet_label)?.ceil() as usize;
let toolbar_gap = self.ui_px(SNIPPET_ROW_GAP);
let search_is_active = self.right_sidebar_snippet_focus
== Some(RightSidebarSnippetField::Search)
@@ -14610,7 +14640,7 @@ impl crate::TermWindow {
let new_button_label = if collapse_new_button {
""
} else {
- "New Snippet"
+ &new_snippet_label
};
self.paint_snippet_button(
layers,
@@ -14648,7 +14678,7 @@ impl crate::TermWindow {
search_width,
self.ui_px(SNIPPET_SEARCH_HEIGHT),
Some(SvgIcon::Search),
- "Search",
+ &crate::i18n::tr("right-search"),
&search_input,
self.right_sidebar_snippet_focus == Some(RightSidebarSnippetField::Search),
UIItemType::RightSidebarSnippetSearch,
@@ -14719,15 +14749,16 @@ impl crate::TermWindow {
empty_icon_size,
muted_fg,
)?;
+ let empty_label = if needle.is_empty() {
+ crate::i18n::tr("right-no-snippets")
+ } else {
+ crate::i18n::tr("right-no-matching-snippets")
+ };
self.paint_sidebar_text(
layers,
ui_font,
ui_metrics,
- if needle.is_empty() {
- "No snippets"
- } else {
- "No matching snippets"
- },
+ &empty_label,
empty_icon_x + empty_icon_size + self.ui_px(SIDEBAR_ICON_GAP) + 2,
list_top + (empty_height.saturating_sub(ui_metrics.cell_size.height as usize)) / 2,
content_width.saturating_sub(
@@ -14866,22 +14897,23 @@ impl crate::TermWindow {
)?;
let title_x = content_x + back_size + self.ui_px(SIDEBAR_INSET);
- let save_label_width = self.sidebar_text_width(ui_font, "Save")?.ceil() as usize;
+ let save_label = crate::i18n::tr("right-save");
+ let save_label_width = self.sidebar_text_width(ui_font, &save_label)?.ceil() as usize;
let save_width = (save_label_width + self.ui_px(SIDEBAR_INSET) * 6)
.clamp(self.ui_px(110), self.ui_px(136))
.min(content_width.saturating_sub(back_size + self.ui_px(SIDEBAR_INSET) * 2));
let save_x = content_x + content_width.saturating_sub(save_width);
let title_width = save_x.saturating_sub(title_x + self.ui_px(SIDEBAR_INSET) * 2);
let title_label = match self.right_sidebar_snippet_view {
- RightSidebarSnippetView::EditNew => "New Snippet",
- RightSidebarSnippetView::EditExisting(_) => "Edit Snippet",
- RightSidebarSnippetView::List => "Snippet",
+ RightSidebarSnippetView::EditNew => crate::i18n::tr("right-new-snippet"),
+ RightSidebarSnippetView::EditExisting(_) => crate::i18n::tr("right-edit-snippet"),
+ RightSidebarSnippetView::List => crate::i18n::tr("right-snippet"),
};
self.paint_sidebar_text(
layers,
ui_font,
ui_metrics,
- title_label,
+ &title_label,
title_x,
header_top,
title_width,
@@ -14891,7 +14923,7 @@ impl crate::TermWindow {
layers,
ui_font,
ui_metrics,
- "Personal vault",
+ &crate::i18n::tr("right-personal-vault"),
title_x,
header_top + ui_metrics.cell_size.height as usize + 8,
title_width,
@@ -14911,7 +14943,7 @@ impl crate::TermWindow {
self.ui_px(SNIPPET_SAVE_BUTTON_HEIGHT)
.min(self.ui_px(SNIPPET_EDITOR_HEADER_HEIGHT) - 12),
None,
- "Save",
+ &save_label,
UIItemType::RightSidebarSnippetSave,
true,
)?;
@@ -14922,7 +14954,7 @@ impl crate::TermWindow {
layers,
ui_font,
ui_metrics,
- "Action description",
+ &crate::i18n::tr("right-action-description"),
content_x,
title_label_y,
content_width,
@@ -14942,7 +14974,7 @@ impl crate::TermWindow {
content_width,
self.ui_px(SNIPPET_FIELD_HEIGHT),
None,
- "Describe this action",
+ &crate::i18n::tr("right-action-description-placeholder"),
&title_input,
self.right_sidebar_snippet_focus == Some(RightSidebarSnippetField::Title),
UIItemType::RightSidebarSnippetTitle,
@@ -14955,7 +14987,7 @@ impl crate::TermWindow {
layers,
ui_font,
ui_metrics,
- "Script *",
+ &crate::i18n::tr("right-script-required"),
content_x,
body_label_y,
content_width,
@@ -14978,7 +15010,7 @@ impl crate::TermWindow {
content_width,
body_height,
None,
- "Type command or script",
+ &crate::i18n::tr("right-script-placeholder"),
&body_input,
self.right_sidebar_snippet_focus == Some(RightSidebarSnippetField::Body),
UIItemType::RightSidebarSnippetBody,
@@ -15048,10 +15080,12 @@ impl crate::TermWindow {
let card_pad = self.ui_px(SIDEBAR_INSET) * 2;
let text_x = x + card_pad;
- let run_button_width = (self.sidebar_text_width(ui_font, "Run")?.ceil() as usize
+ let run_label = crate::i18n::tr("right-run");
+ let paste_label = crate::i18n::tr("menu-paste");
+ let run_button_width = (self.sidebar_text_width(ui_font, &run_label)?.ceil() as usize
+ self.ui_px(SIDEBAR_INSET) * 4)
.max(self.ui_px(SNIPPET_ACTION_BUTTON_MIN_WIDTH));
- let paste_button_width = (self.sidebar_text_width(ui_font, "Paste")?.ceil() as usize
+ let paste_button_width = (self.sidebar_text_width(ui_font, &paste_label)?.ceil() as usize
+ self.ui_px(SIDEBAR_INSET) * 4)
.max(self.ui_px(SNIPPET_ACTION_BUTTON_MIN_WIDTH));
let delete_button_size = self.ui_px(SNIPPET_ACTION_BUTTON_HEIGHT);
@@ -15110,7 +15144,7 @@ impl crate::TermWindow {
run_button_width,
self.ui_px(SNIPPET_ACTION_BUTTON_HEIGHT),
None,
- "Run",
+ &run_label,
UIItemType::RightSidebarSnippetRun(snippet.id.clone()),
true,
)?;
@@ -15126,7 +15160,7 @@ impl crate::TermWindow {
paste_button_width,
self.ui_px(SNIPPET_ACTION_BUTTON_HEIGHT),
None,
- "Paste",
+ &paste_label,
UIItemType::RightSidebarSnippetPaste(snippet.id.clone()),
true,
)?;
diff --git a/wezterm-gui/src/termwindow/ui/sidebar.rs b/wezterm-gui/src/termwindow/ui/sidebar.rs
index c793e7a8..d4d5df5e 100644
--- a/wezterm-gui/src/termwindow/ui/sidebar.rs
+++ b/wezterm-gui/src/termwindow/ui/sidebar.rs
@@ -755,15 +755,12 @@ impl crate::TermWindow {
let row_text_x = row_icon_x + row_icon_size + self.ui_px(SIDEBAR_ICON_GAP);
let row_text_max =
(row_x + row_width).saturating_sub(row_text_x + self.ui_px(SIDEBAR_INSET));
- let row_label = self.ellipsize_ui_text(
- ui_font,
- if reconnect_in_flight {
- "Connecting…"
- } else {
- "Reconnect"
- },
- row_text_max,
- )?;
+ let reconnect_label = if reconnect_in_flight {
+ crate::i18n::tr("sidebar-connecting")
+ } else {
+ crate::i18n::tr("sidebar-reconnect")
+ };
+ let row_label = self.ellipsize_ui_text(ui_font, &reconnect_label, row_text_max)?;
let row_label = row_label.into_owned();
self.paint_sidebar_text(
layers,
@@ -1082,7 +1079,7 @@ impl crate::TermWindow {
.saturating_sub(self.ui_px(SIDEBAR_INSET) + space_action_icon_size + top_action_gap);
let space_text_x = space_icon_x + space_icon_size + top_action_gap;
let space_name = crate::workspace_threads::active_space_name(&self.active_space_id)
- .unwrap_or_else(|| "Default".to_string());
+ .unwrap_or_else(|| crate::i18n::tr("sidebar-default-space"));
let space_title = self.sidebar_space_title(&self.active_space_id, &space_name);
let space_label = self.ellipsize_ui_text(
&ui_font,
@@ -1235,8 +1232,9 @@ impl crate::TermWindow {
let top_action_icon_size = header_icon_size.min(top_action_height.saturating_sub(14));
let top_action_text_max_width = top_action_width
.saturating_sub(top_action_icon_size + top_action_gap + self.ui_px(SIDEBAR_INSET) * 2);
+ let top_action_label_text = crate::i18n::tr("sidebar-new-thread");
let top_action_label =
- self.ellipsize_ui_text(&ui_font, "New Thread", top_action_text_max_width)?;
+ self.ellipsize_ui_text(&ui_font, &top_action_label_text, top_action_text_max_width)?;
let top_action_text_width = self
.sidebar_text_width(&ui_font, top_action_label.as_ref())?
.ceil()
@@ -1354,7 +1352,7 @@ impl crate::TermWindow {
layers,
&ui_font,
ui_metrics,
- "Pinned",
+ &crate::i18n::tr("sidebar-pinned"),
label_text_x,
label_y + ((session_row_height.saturating_sub(ui_cell_height)) / 2),
item_x
@@ -1540,7 +1538,7 @@ impl crate::TermWindow {
layers,
&ui_font,
ui_metrics,
- "Workspaces",
+ &crate::i18n::tr("sidebar-workspaces"),
item_x + self.ui_px(SIDEBAR_INSET),
label_y + ((session_row_height.saturating_sub(ui_cell_height)) / 2),
button_x.saturating_sub(item_x + self.ui_px(SIDEBAR_INSET) * 2),
@@ -2326,7 +2324,7 @@ impl crate::TermWindow {
layers,
&ui_font,
ui_metrics,
- "Settings",
+ &crate::i18n::tr("sidebar-settings"),
settings_text_x,
settings_text_y,
settings_action_x.saturating_sub(settings_text_x + self.ui_px(SIDEBAR_INSET)),