[WordPress] 外掛分享: Sawir Live Translate

首頁外掛目錄 › Sawir Live Translate
全新外掛
安裝啟用
尚無評分
剛更新
最後更新
問題解決
WordPress 5.8+ PHP 7.4+ v1.1.0 上架:2026-07-01

內容簡介

Sawir Live Translate 外掛讓使用者能夠輕鬆地將網站內容翻譯成多種語言,並提供即時預覽功能。透過簡單的操作,管理員可以自動翻譯或手動編輯翻譯,並確保SEO友好性,提升網站的可達性和使用者體驗。

【主要功能】
• 自動翻譯可見文字串
• 實時編輯翻譯並即時更新
• SEO友好的伺服器端渲染
• 語言切換器便捷切換語言
• 支援多種語言路徑前綴

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Sawir Live Translate」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Open any page on your site, click “Translate this page” in the admin bar, choose a
target language, and either auto-translate every visible string (via a free
machine-translation service) or edit translations by hand while seeing the page
update live.
Saved translations are rendered server-side into the HTML response (SEO-friendly:
no flash of untranslated text, and hreflang alternates in the head), and visitors
switch languages via a link-based switcher (bottom-right).
Developed by Ricardo Sawir for Sawir Studio LLC.

Website: https://sawirstudio.com
X: https://x.com/RicardoSawir
GitHub: https://github.com/sawirricardo
Email: [email protected]

URLs use a language path prefix, e.g. /es/about for Spanish, /about for the source
language (which stays canonical, un-prefixed). Language is resolved in this order:
/es/ path → ?lang=es → saved cookie → browser Accept-Language → source. Root and
prefix-less URLs auto-detect the visitor’s browser language without redirecting
(a Vary header is sent so shared caches behave).

Settings → Live Translate: set your source language and tick the languages to offer.
Visit a front-end page and click “🌐 Translate this page” in the admin bar.
Pick a language, hit “Auto-translate empty” (or edit strings), then “Save”.
Visitors use the switcher (bottom-right); each language has its own /xx/ URL.

Note: language path prefixes assume a root-domain install and no top-level page
whose slug is a two-letter language code.
External services
This plugin’s optional “Auto-translate” feature (admin-only, triggered manually
by clicking an Auto-translate/Translate button) sends the source text strings
and the chosen language pair to the MyMemory translation API
(https://mymemory.translated.net/) to fetch machine translations. The request
is made from the administrator’s browser only when they click the button; no
visitor data is ever sent, and nothing is sent automatically.

Service terms: https://mymemory.translated.net/doc/en/tos.php
Privacy policy: https://mymemory.translated.net/doc/en/privacy.php

Developers can swap the provider — see “Custom translation provider” below.
Native WordPress localization (dates, core/theme strings)
On a translated request the plugin switches WordPress’s locale to the target
language, so dates (month/day names) and any installed core, theme, and plugin
translations render natively — the string map only covers the rest.
For this to have visible effect the language pack must be installed. The easiest
way is Settings → General → Site Language: pick and save the language once (which
downloads its pack), then switch back to your source language. Languages without
an installed pack still work for content translation; only native dates/strings
are skipped. Map codes to custom WP locales with the ‘sawir_lt_wp_locale’ filter.
Scan site for strings
Settings → Live Translate → “Scan site now” crawls your published pages, posts,
and public archives to discover every translatable string up front (batched, with
a progress indicator). Discovered strings then appear in the “Edit all site
strings” section right below, where you can pick a language and translate, auto-
translate, or bulk-import the whole site at once instead of page by page. Note:
machine translation is still rate-limited by the free service, so for large sites
use Bulk edit to export and translate elsewhere.
Multisite
Multisite-aware. Each subsite has its own settings and its own translations table,
configured independently. Tables are created on network activation, when a new
subsite is created, and lazily on first admin visit; uninstall cleans every site
on the network.
Custom switcher
Turn off “Built-in switcher” in settings and render your own anywhere in your
theme using sawir_lt_switcher_links(), which returns the language links for the
current page:

Each item is [‘code’,’name’,’url’,’active’,’is_source’] (code is ” for the
source language). sawir_lt_current_lang() returns the active language code.
Custom translation provider
Auto-translate uses the free MyMemory API by default. To use your own provider
(DeepL, Google, a local model, …), reassign window.SawirLT.translate from a
script enqueued after the ‘sawir-lt-walk’ handle. Signature: it receives the
source text and the two language codes, and returns a Promise resolving to the
translated string. Every auto-translate path (in-page editor and admin bulk
translate) routes through it.
add_action( 'admin_enqueue_scripts', 'myprefix_lt_provider' );
add_action( 'wp_enqueue_scripts', 'myprefix_lt_provider' );
function myprefix_lt_provider() {
if ( wp_script_is( 'sawir-lt-walk', 'registered' ) ) {
wp_enqueue_script( 'myprefix-lt-provider',
plugins_url( 'provider.js', __FILE__ ),
array( 'sawir-lt-walk' ), '1.0.0', true );
}
}

provider.js:
window.SawirLT.translate = function ( text, source, target ) {
return fetch( 'https://example.com/translate', {
method: 'POST',
body: JSON.stringify( { text: text, from: source, to: target } )
} ).then( function ( r ) { return r.json(); } )
.then( function ( j ) { return j.translation; } );
};

Translations

The plugin’s own admin/UI text is translation-ready (text domain
“sawir-live-translate”). A .pot template ships in /languages — drop your
.po/.mo there or under wp-content/languages/plugins/. (The in-page editor’s
JavaScript labels are not yet localized.)
Other plugins by Sawir Studio

Sawir Insights — heatmaps, session recordings, surveys, funnels, and form analytics — all self-hosted.
Sawir Restock Notifier for WooCommerce — let customers request an email when an out-of-stock product is back.
Sawir Product Image Zoom for WooCommerce — product image lightbox with navigation and click-to-zoom.
Sawir Min Max Quantities for WooCommerce — minimum, maximum, and group-of order quantity rules.
Sawir Variation Gallery Tools for WooCommerce — manage variation-specific gallery images.
Sawir Role Capabilities Manager — create custom user roles and manage capabilities.
Sawir Media Folders — organize the Media Library into fast, unlimited folders with drag & drop.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon