Loco Translate

外掛說明

Loco Translate 能讓使用者在瀏覽器中編輯 WordPress 譯文檔案,並整合第三方機器自動翻譯服務。

它也為開發者提供了 Gettext/本地化工具,例如擷取原文內容及產生範本檔案。

目前功能如下:

  • 在 WordPress 管理後台提供譯文編輯器。
  • 目前整合的機器翻譯 API 包含 DeepL、Google、Microsoft 及 Yandex。
  • 直接為佈景主題及外掛建立及更新本地化檔案。
  • 從原始程式碼中擷取可進行本地化的內容。
  • 主機無須安裝 Gettext 即可原生編譯 MO 檔。
  • 支援包含註解、參照及複數型在內的 PO 檔功能。
  • 帶有可點擊的原始程式碼參照的 PO 檔來源檢視。
  • 用於儲存自訂譯文的受保護語言目錄。
  • 可設定 PO 檔的備份數量,並具備差異備份及還原功能。
  • 內建 WordPress 地區語言代碼。

這是由 Tim Whitlock 為 Loco 服務所開發的官方 WordPress 外掛。
如需進一步了解相關資訊,請造訪外掛頁面

鍵盤快速鍵

PO 檔編輯器支援下列鍵盤快速鍵,提昇本地化效率:

  • 完成並前往下一個:Ctrl + ↵
  • 下一筆原文內容:Ctrl + ↓
  • 上一筆原文內容:Shift + Ctrl + ↑
  • 下一筆未譯譯文:Shift + Ctrl + ↓
  • 上一筆未譯譯文:Shift + Ctrl + ↑
  • 複製原文內容:Ctrl + B
  • 清除譯文:Ctrl + K
  • 切換模糊翻譯:Ctrl + U
  • 儲存 PO 檔/編譯 MO 檔:Ctrl + S
  • 顯示/隱藏編輯標記:Shift + Ctrl + I
  • 建議譯文:Ctrl + J

macOS 的使用者請用 ⌘ Cmd 取代 Ctrl。

螢幕擷圖

  • 在瀏覽器中以 Loco 的 PO 檔編輯器為原文內容進行本地化
  • 為外掛/佈景主題語言檔案顯示本地化進度
  • PO 檔的程式碼檢視具備文字篩選器及可點擊的檔案參照
  • [回復前版本] 分頁顯示了具備還原功能的 PO 檔差異檢視
  • [已安裝的語言] 分頁顯示了可供存取的譯文
  • 建議譯文功能會顯示來自多家機器翻譯服務提供商的結果

安裝方式

基本使用方式:

譯者請注意,要以你的母語為佈景主題 (或外掛) 進行本地化,請依以下步驟操作:

  1. wp-content/languages/loco/themes (或 wp-content/languages/loco/plugins,視需求而定) 中建立受保護的語言目錄。
  2. 確保建立的目錄可由網頁伺服器進行寫入。
  3. 在 [Loco Translate]→[佈景主題] (或 [外掛],視需求而定) 的清單中,找到要進行本地化的佈景主題 (或外掛)。
  4. 點擊 [+ 新增語言],並依照螢幕提示進行。

開發者請注意,要為你開發的佈景主題或外掛進行本地化,請依以下步驟操作:

  1. 在套件根目錄下建立名為 languages 的子目錄。
  2. 確保建立的目錄可由網頁伺服器進行寫入。
  3. 在 [Loco Translate] 的 [佈景主題] 或 [外掛] 頁面中找到你所開發的套件。
  4. 點擊 [+ 建立範本],並依照螢幕提示以擷取原文。
  5. 點擊 [+ 新增語言],並依照螢幕提示新增譯文。

手動安裝:

  1. 將解壓縮後所得的 loco-translate 資料夾及其全部檔案,上傳至 /wp-content/plugins 目錄。
  2. 登入 WordPress 管理後台,並透過 [外掛] 選單啟用 Loco Translate 外掛。
  3. 由左側選單前往 [Loco Translate]→[主要資訊],然後開始進行本地化。

點擊這裡便能取得使用這個外掛的進一步資訊。

常見問題集

請造訪外掛官方網站上的常見問題集頁面以了解最常見的問題。

如何使用 Loco Translate?

請參考我們提供的使用指南及教學課程

如何取得進一步的技術支援?

如果在 Loco Translate 的使用上遇到任何問題,請先參考外掛的線上說明頁面,線上說明頁面中有許多協助使用者了解外掛運作方式及避免陷入常見錯誤的資訊。

如需回報程式碼錯誤,請造訪技術支援論壇並以開啟一個新主題,但在發問前請先詳閱常見問題集以排除類似的問題。如果決定要傳送一份程式碼錯誤報告,請附上相關詳細資料,以供我們重現你提出的問題。

個人資料是否受到保護?

這個外掛不會收集或窺探個人資料,詳情請參閱〈外掛隱私權注意事項〉。

使用者評論

2021 年 4 月 30 日
läuft reibungslos. Sehr gut organisiert, schnell und übersichtlich
2021 年 4 月 24 日
This used to be a great translation plugin. I used it to change text and labels, worked very smoothly and excellently All of a sudden it stopped translating strings like it could before , now all the author does is refer you to other authors of the plugins you trying to translate - i mean if it were that easy to reach every plugin author, then would i need a translation plugin in the first place ?
2021 年 4 月 15 日
Thank you so much for this plugin. I'm using another plugin from a developer in a different country and a lot of the English they use is clunky, with poor grammar and US English spellings, which is not what I want my UK audience to see. I would never have thought of 'translating' it, if it were not for that developer suggesting it, but your plugin is so brilliant it's making the job really easy. (It helps that they've already provided the sets). The other thing that I really want to commend you on is your excellent instructions. They're written by someone who understands that the user doesn't already know how to use the product (obvious, but so often missing in plugin instructions!) and are easy to follow. Huge well done.
2021 年 3 月 26 日
Works really great and easy! Thank you very much!
閱讀全部 367 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Loco Translate〉的開發相關工作。

參與者

Loco Translate 外掛目前已有 36 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將 Loco Translate 外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

2.5.2

  • Added implied formality and loco_locale_formality filter
  • Added cli fetch command (experimental)
  • Bumped WordPress version to 5.7

2.5.1

  • Support for new Yandex translate API
  • Support for DeepL formality parameter
  • Removed literal “1” and “one” instances from singular strings
  • Buffering compiled JSON to support strings from multiple sources
  • Added loco_compile_single_json filter for specifying custom JSON
  • Added loco_extracted_template hook for adding custom strings
  • Sync no longer removes the editor’s current text filter
  • Bumped WordPress version to 5.6.2

2.5.0

  • PHP 8.0.0 compatibility
  • Bumped WordPress version to 5.6.0
  • Added JSON translation file generation
  • Added custom JSON loading to LoadHelper
  • Disabled emoji image replacement on our admin screens

2.4.6

  • Fixed critical bug syncing PO directly to source code
  • Added plugin setting for allowing/disallowing missing POT
  • Fixed WP5.5 issue with multiple ID attributes on script tags

2.4.5

  • Added WP-CLI sync and extract commands
  • Fixed {locale} placeholder bug introduced in 2.4.4
  • Improved handling of invalid character encodings
  • Sync (msgmerge) moved to back end
  • New fuzzy matching with fuzziness setting
  • Bumped WordPress version to 5.5.3

2.4.4

  • Added PO file upload feature
  • Added download button to file info page
  • Fix for extracting plurals also used as singulars
  • Updating API keys no longer require editor page reload
  • Catching fatal startup errors in loco.php
  • Supporting max_php_size=0 to mean no size restriction
  • Auto-update detection now checks new site options
  • Bumped WordPress version to 5.5.1

2.4.3

  • Improved fix for default syncing of msgstr fields
  • Reverted accidental removal of js debug flag
  • Minor fixes to API error messages
  • Removed use of jQuery.browser
  • Bugfix for new preferences in usermeta

2.4.2

  • Added loco_file_written hook
  • Improved script tampering warning
  • Added keypress for selecting auto-suggestion
  • Sync no longer copies msgstr fields by default
  • Style tweaks for WordPress 5.5

2.4.1

  • Fixed mapping of some API languages
  • Added locale filter to user preferences
  • Added debugging for credential form failures
  • Fixed deprecated use of array_key_exists
  • Added DeepL API service provider
  • Improved script tampering detection
  • Bumped WordPress version to 5.5
  • Added “modern” skin styles

2.4.0

  • Added support for third party translation APIs
  • Added file references to editor source pane in code view
  • Added fuzzy matching during editor Sync operation
  • Style changes including rearrangement of editor buttons
  • Elevated warnings when scripts are tampered with
  • Removed remnants of legacy version 1.x

2.3.4

  • Updated translatable strings
  • Added missing template recommendation
  • Alerting in debug mode when scripts are tampered with
  • Fix for Hello Dolly being installed into a folder
  • Removed translation column in POT edit mode
  • Added setting to prevent ‘translating’ of POT files
  • Enabled some linkable translations using wp_kses
  • Bumped WordPress version to 5.4.1

2.3.3

  • Fixed fatal error when class not found

2.3.2

  • Removed login/email from default Last-Translator credit
  • Bumped WP compatibility to 5.4
  • Fixed PHP 7.4 deprecations

2.3.1

  • Default POT getter now looks in “lang” directory
  • Not calling deprecated magic quotes functions under PHP 7.4
  • Fixed issue with conflicting page hooks
  • Ajax file uploads now enabled by default
  • Removed legacy option migrations from 1.x branch
  • Bumped WP compatibility to 5.2.4

2.3.0

  • Added experimental support for multipart uploads
  • Added relocation tab for moving translation sets
  • Creation of missing directories when writing new files
  • Fixed duplicate file addition when iterating over symlink
  • Bumped WP compatibility to 5.2.1

2.2.2

  • Security fixes for reading sensitive files
  • Fixed old PHP version error in data files
  • Bumped WP compatibility to 5.1.1

2.2.1

  • Fixed bug where plural tabs not displaying RTL
  • Various improvements to PO parser incl. better charset handling
  • Excluding node_modules and vendor directories by default
  • Transients now have maximum lifespan of 10 days, refreshed after 24h
  • Symlink fix for followed theme paths detected outside theme
  • Deprecated config repository lookup
  • Bumped WP compatibility to 5.1

2.2.0

  • Fix for empty language code when getting plural rules
  • Added X-Loco-Version header to generated Gettext files
  • Added sanity check for mbstring.func_overload madness
  • Added “Assign template” link on missing template page
  • Added JavaScript string extraction (experimental)
  • Editor supports sprintf-js when javascript-format tag present
  • Fix for duplicate comments when end punctuation differs
  • Marking msgctxt more clearly in editor views
  • Added loco_admin_shutdown action hook
  • Bumped WP compatibility to 5.0 (beta)

2.1.5

  • Updated locale data
  • Minor fix to file reference resolution
  • Fixed windows paths with trailing backslash
  • Fixed ssh-keys toggling issue
  • Rejigged buffer handling during Ajax
  • Bumped WP compatibility to 4.9.8

2.1.4

  • Bumped WP compatibility to 4.9.6
  • Hooked in privacy policy suggestion

2.1.3

  • Added loco_locale_name filter and updated locale data
  • Fixed editor column sorting to update as values change
  • Supporting RTL text in editor preview rows
  • Minor refactor of debug mode routing check
  • Minor PO parser improvements
  • Bumped WP compatibility to 4.9.5

2.1.2

  • Fixed undeclared property in admin hook
  • Fixed incompatibility with older WordPress
  • Fixed incorrect millisecond reporting in footer
  • Removed locale progress column for en_US locale
  • Tweaks to debugging and error logging

2.1.1

  • Setting Project-Id-Version on new POT files
  • Added source view to quick links in file tables
  • Supporting only WordPress style locale codes
  • Editor screen tolerates missing PO headers
  • Ajax debugging improvements for issue reporting
  • Added loco_parse_locale action callback

2.1.0

  • Add fs_protect setting to avoid overwriting system files
  • Fixed bug in connect dialogue where errors not redisplayed
  • Minor improvements to inline notices
  • Removed downgrade notice under version tab
  • Fixed extraction bug where file header confused with comment
  • Resolved some inconsistencies between PHP and JS utilities
  • Added Restore tab with diff display
  • Added loco_settings hook
  • Prevented editor from changing PO document order
  • Added default string sorting to extracted strings
  • Added “Languages” section for grouping files by locale
  • Fixed bug where translations loaded before user profile language set
  • Added loco_locale_plurals filter for customising plural rules
  • Allowing PO files to enforce their own Plural-Forms rules
  • Added loco_allow_remote filter for debugging remote problems
  • Updated plural forms from Unicode CLDR
  • PHP extractor avoids repeated comments
  • Bumped WP compatibility to 4.9.4

2.0.17

  • Unofficial languages showing in “Installed” dropdown
  • Fixed extraction bug where comment confused with file header
  • Fixed issue where src attributes requested from server during HTML strip
  • Added loco_admin_init hook into ajax router for consistency
  • Added warning on file info page when file is managed by WordPress
  • Minor help link and layout tweaks
  • Bumped WP compatibility to 4.9.1

2.0.16

  • File writer observes wp_is_file_mod_allowed
  • Fixed progress bug in editor for locales with nplurals=1
  • Made plural form categories translatable for editor UI
  • Sync-from-source raises warning when files are skipped
  • Added hack for extracting from .twig as per .php
  • Added warning when child themes declare parent text domain
  • Added option to control PO line wrapping
  • Bumped WP compatibility to 4.8.2

2.0.15

  • Permanently removed legacy version 1.x
  • Fixed bug where editor code view was not redrawn on resize
  • Fixed bug where fuzzy flag caused format flag to be ignored
  • Fixed bug where autoloader responded to very long class names
  • Purging WP object cache when active plugin list changes
  • Added experimental source word count into POT info tab
  • Bumped WP compatibility to 4.8.1

2.0.14

  • Editor improvements inc. column sorting
  • Added warnings that legacy version will be removed
  • Added PO source view text filtering
  • Added _fs_nonce for 4.7.5 compatibility
  • Migrated to canonical text domain
  • Removed wp class autoloading

2.0.13

  • CSS conflict fixes
  • Added option for UTF-8 byte order mark
  • Printf highlighting observes no-php-format flag
  • Fixed issue with translator role losing “read” permission

2.0.12

  • Minor fix for root path configs
  • Added alternative PHP extensions setting
  • Bumped WP version to 4.7.3
  • LoadHelper fix for core files
  • Allow revoking of permissions from translator role
  • Allow network admins to deny access to site admins

2.0.11

  • Extra debug logging and error diagnostics
  • Forcefully clear output buffers before Ajax flush
  • Bumped WordPress version to 4.7
  • Experimental wildcard text domain support

2.0.10

  • Allows missing domain argument in plugin_locale filter
  • Reverted editor changes that disabled readonly text
  • Added invisibles and coding editor switches
  • Added table filtering via text query
  • Added Last-Translator user preference

2.0.9

  • Bumped minimum WordPress version to 4.1
  • Some optimisation of transient caching
  • Fixed hash table settings bug

2.0.8

  • Source refs fix for files in unknown subsets
  • Downgrades PO formatting exceptions to PHP warnings
  • Renamed function prefixes to avoid PHP 7 warnings
  • Better support for php-format and no-php-format flag
  • PO source and editor UI tweaks
  • Localised strings and implemented in js

2.0.7

  • Fixed prototype.js conflict
  • More Windows file path fixes
  • Added loco_current_translator filter
  • Fixed false positive in extra files test

2.0.6

  • PO wrapping bugfix
  • Downgraded source code bugfix
  • Tolerating headerless POT files
  • Core bundle metadata tweaks

2.0.5

  • Deferred missing tokenizer warning
  • Allows editing of files in unconfigured sets
  • Added maximum PHP file size for string extraction
  • Display of PHP fatal errors during Ajax

2.0.4

  • Reduced session failures to debug notices
  • Added wp_roles support for WP < 4.3
  • Fixed domain listener bugs

2.0.3

  • Added support for Windows servers
  • Removed incomplete config warning on bundle overview

2.0.2

  • Fixed bug when absolute path used to get plugins
  • Added loco_plugins_data filter
  • Added theme Template Name header extraction
  • Minor copy amends

2.0.1

  • Added help link in settings page
  • Fixed opendir warnings in legacy code
  • Catching session errors during init
  • Removing meta row link when plugin not found

2.0.0

  • First release of completely rebuilt version 2