Loco Translate

描述

Loco Translate提供了WordPress翻译文件的浏览器内编辑和自动翻译服务的集成。

其还为开发者提供 Gettext/本地化工具,如提取字符串和生成模板。

功能包括:

  • 在 WordPress 管理中内置翻译编辑器
  • 集成翻译API,包括DeepL、Google、Microsoft和Lecto AI。
  • 直接在您的主题或插件中创建和更新语言文件
  • 从您的源代码中提取可翻译的字符串
  • 原生MO文件编译,无需在您的系统上使用Gettext
  • 支持PO功能,包括注释、引用和复数形式
  • 具有可点击源代码参考的PO源视图
  • 受保护的语言目录,用于保存自定义翻译
  • 可配置的PO文件备份,具有差异和还原功能。
  • 内置 WordPress 地区语言代码

官方LocoWordPress插件由Tim Whitlock打造。
更多信息请访问我们的插件页面

键盘快捷键

PO文件编辑器支持以下键盘快捷键,以便更快速地进行翻译:

  • 完成并下一个:Ctrl ↵
  • 下一个字符串:Ctrl↓
  • 上一个字符串:Ctrl↑
  • 下一个未翻译:Shift Ctrl↓
  • 上一个未翻译:Shift Ctrl↑
  • 从源文复制:Ctrl B
  • 清除翻译:Ctrl K
  • 切换模糊: Ctrl U
  • 保存PO或编译MO:Ctrl S
  • 切换不可见:Shift Ctrl I
  • 建议翻译:Ctrl J

Mac 用户可以用 ⌘ Cmd 代替 Ctrl。

屏幕截图

  • 使用Loco PO 编辑器在浏览器中翻译字符串
  • 显示主题语言文件的翻译进度
  • 具有文本过滤器和可点击文件参考的PO源视图
  • 还原选项卡显示带有还原功能的PO差异视图。
  • 按安装的语言显示对翻译的访问
  • 显示多个翻译引擎结果的建议功能

安装

基本用法:

译者:要将主题翻译成您的语言,请遵循以下步骤:

  1. wp-content/languages/loco/themes创建受保护的语言目录。
  2. 确保该目录可由Web服务器写入
  3. Loco Translate > 主题的列表中找到您的主题。
  4. 点击+新语言,并按照屏幕上的提示操作。

开发者:要翻译自己的主题或插件以供分发,请遵循以下步骤:

  1. 在您的捆绑包根目录下创建一个 languages 子目录
  2. 确保该目录可由Web服务器写入
  3. Loco Translate > 主题Loco Translate > 插件找到该捆绑包
  4. 点击+创建模板,按照屏幕上的提示提取您的字符串。
  5. 点击+新语言,按照屏幕上的提示添加自己的翻译。

手动安装:

  1. 解压所有文件到wp-content/plugins/loco-translate目录下
  2. 登录WordPress管理员,通过 “插件 “菜单激活 “Loco Translate “插件
  3. 进入左侧菜单中的Loco Translate > 首页开始翻译

更多关于使用该插件的信息是这里

常见问题

请访问我们网站上的常见问题页面以了解最常见的问题。

我如何使用Loco Translate?

试试我们的指南和教程

如何获得更多帮助?

如果您在使用Loco Translate时遇到问题,请尝试我们的帮助页面
那里有很多信息可以帮助您了解它是如何工作的,以及需要避免的最常见的陷阱。

要报告错误,请在支持论坛中发起新话题。
但请先查看常见问题中的类似问题。
如果您决定提交错误报告,请提供足够多的相关细节,以便我们能够重现您的问题。

我的数据是否受到保护?

我们不会收集您的数据或窥探您。请参阅插件隐私声明

评价

2022年11月23日
I needed Loco Translate to 'edit' several hard-coded words in a plugin (GiveWP), to better fit my site niche. There's a lot of power here, but the plugin is very well designed to steer you to the correct place (theme, or specific plugin). The excellent string search meant that I was done in 5 mins, start to finish! Instant 5⭐
2022年10月25日
Convenient plugin, but it would be nice to add support for cheaper APIs, for example, like: translated.com, cloudapi.stream
阅读所有395条评价

贡献者及开发者

“Loco Translate” 是开源软件。 以下人员对此插件做出了贡献。

贡献者

“Loco Translate”插件已被翻译至39种本地话语言。 感谢所有译者为本插件所做的贡献。

将“Loco Translate”翻译成您的语言。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

2.6.3

  • Fixed bug in plural forms comparison
  • Fixed bug generating author theme jsons
  • Fixed errors in bundle debugger
  • Extended cli type argument to filter specific bundle
  • Bumped WordPress version to 6.0.3

2.6.2

  • Bumped WordPress version to 6.0.0
  • Better labelling of reverse-engineered plural forms
  • Removed undocumented loco_locale_plurals filter; use loco_po_headers
  • Added PO folder location indicator in breadcrumb
  • Added syntax validation for formatted strings

2.6.1

  • Bumped WordPress version to 5.9.2
  • Fix for CVE-2022-0765 reported by Taurus Omar via wpscan

2.6.0

  • Dropped support for WordPress < 5.2
  • Code upgrades for >= PHP 5.6.20
  • Bumped WordPress version to 5.9.1
  • Removed Yandex API integration
  • Added loco_compile_script_reference filter
  • Plural-Forms retained when copying PO to same language

2.5.8

  • Compatible with PHP 8.1
  • Bumped WordPress version to 5.9
  • Added deprecation warning prior to v2.6

2.5.7

  • Fixed bug in 2.5.6 where remote APIs could not be used in batch mode
  • Enforcing 10k character limit per request for Microsoft and Yandex Translators
  • Style fix for revision/diff table under restore tab

2.5.6

  • Added loco_api_provider_source filter
  • Fixed bug loading user preferences saved in older version
  • Refactored file finder to avoid recursive function calls
  • Fixed bug displaying two forms for zero plural languages
  • Added Lecto AI to translation API providers
  • Bumped WordPress version to 5.8.3

2.5.5

  • Fixed double file extension vulnerability reported by WordFence
  • Better performance when scanning directories for file types

2.5.4

  • Fixed vulnerability reported by Tomi Ashari via wpscan
  • Added filters loco_po_headers and loco_pot_headers
  • Bumped WordPress version to 5.8.1

2.5.3

  • Adds option to merge JSON translations when syncing from PO
  • Adds screen for editing file headers and sync options
  • Fix for missing responseText in failed Ajax responses
  • Fix for HTML entities returned from number_format_i18n
  • Localized number formatting in JavaScript
  • Replaced usage of date_i18n with wp_date
  • Added configurable API endpoint for DeepL
  • Bumped WordPress version to 5.7.2

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 as per exploit-db 46619
  • 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
  • 只支持WordPress风格的区域代码
  • 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