Description
SLUG TRANSLATER does two jobs.
1. Slugs in English
- A slug made from a Japanese title is translated into English and replaced with a clean, sanitized slug.
- The default setting replaces the slug only the first time a post is saved. You can change this on the settings screen.
- Post types, categories, tags and other taxonomies can be chosen.
- A checked post type gets two things: its slugs are translated, and (when a translation service and a language are set) a draft translation is made for each language when a post is published. A checked taxonomy gets only its slugs translated.
2. Translated posts and blocks (new in 2.0.0)
- Each language has its own post. The Japanese post is the original, and the translation is made as a draft. You can correct the translation by hand before you publish it.
- The language is part of the URL, for example
/en/about/. - When a post is published and has no translation yet, the translations are made in the background with WP-Cron. Long posts are translated in small steps, so saving a post stays fast. A notice in the editor tells you when the draft is ready.
- Only the text of blocks that declare translatable attributes (
supports.itmarTranslatablein block.json) is translated. The structure, images and styles of the block are copied as they are. The settings screen lets you choose the blocks. The core Heading, Paragraph, Image (alt and caption) and List Item blocks, and the ITmaroon design blocks, are supported. - Categories and other terms, the featured image, the template and custom fields (for example Secure Custom Fields) are copied to the translated post.
- The site title and the tagline can be translated automatically, or you can type them for each language.
- A visitor who opens
/en/for a post that has no published translation sees the original post with a short notice. Archives and lists show the posts of the language being viewed. hreflanglinks are added to the page head.- Languages: English, Chinese (Simplified and Traditional), Korean, French, German and Spanish.
Translation services
This plugin sends text to the translation service you choose on the settings screen. Nothing is sent until you choose a service and enter your credentials.
- Google Cloud Translation API: the title, excerpt and block text of a post (and slugs, terms, the site title and the tagline) are sent to Google when they are translated. Terms of Service, Privacy Policy
- “Minna no Jido Honyaku”: the same text is sent to the service. Terms of Use
Register as a user, or create a project and enable the API, on the service side first. Then enter the authentication information on the settings screen. The “Authentication check” button tests it.
For developers
- Filters:
sl_trans_language_catalog(add languages),sl_trans_auto_create(stop the automatic translation of a post),sl_trans_job_budget(seconds of one background step, default 20),sl_trans_fallback_notice,sl_trans_core_translatable,sl_trans_copy_meta_key. - REST:
slug-translater/v1/translate,slug-translater/v1/post-translationandslug-translater/v1/config. - If your site disables WP-Cron (
DISABLE_WP_CRON), callwp-cron.phpfrom the server’s cron so that the background translation runs.
Related Links
Installation
- From the WP admin panel, click “Plugins” -> “Add new”.
- In the browser input box, type “SLUG TRANSLATER”.
- Select the “SLUG TRANSLATER” plugin and click “Install”.
- Activate the plugin.
- Open “Settings” -> “SLUG TRANSLATER”, choose a translation API and enter the authentication information.
OR…
- Download the plugin from this page.
- Save the .zip file to a location on your computer.
- Open the WP admin panel, and click “Plugins” -> “Add new”.
- Click “upload”.. then browse to the .zip file downloaded from this page.
- Click “Install”.. and then “Activate plugin”.
FAQ
What do I need to use this plugin?
A translation service account (Google Cloud Translation API or “Minna no Jido Honyaku”), and you must follow its terms: Minna no Jidou Honyaku Terms of Use and Google Cloud Platform Terms of Service.
Is the translation free?
Google Cloud Translation API is free up to 500,000 characters per month, and is billed beyond that. “Minna no Jido Honyaku” is free, with a limit on the number of accesses per day.
My post was saved but the translated draft has not appeared.
The draft is made in the background, in small steps. Open the post again after a while. If your site disables WP-Cron, run wp-cron.php from the server’s cron.
Changelog
2.0.1
- Fixed: all output on the settings screen is now escaped, and the settings have sanitize callbacks. Several queries were rewritten so that they are clearly prepared. This clears the errors reported by Plugin Check.
- Fixed: the permission error message of the settings page was printed in the wrong way.
- Improved: the settings screen now explains what each choice does. A checked post type translates the slug and also makes a translated draft for each language. A checked taxonomy translates only the slug. The section titles were renamed to “Post types and taxonomies” and “Languages and blocks”.
- Improved: the settings screen no longer grows wider than a narrow screen. The block list is grouped (WordPress blocks and ITmaroon blocks).
- Improved: the short description is shorter, and the Japanese translation was updated.
2.0.0
- Added: translation of posts and block text into other languages. Each language has its own post, with
/en/style URLs,hreflanglinks and a fallback to the original post. - Added: translated drafts are made in the background with WP-Cron when a post is published, in small steps, so saving a post stays fast.
- Added: the site title and the tagline can be translated, or typed for each language.
- Added: the blocks and the languages to translate can be chosen on the settings screen.
- Improved: the settings screen has a new design. Languages, blocks, post types and taxonomies are shown as cards, and the labels and the input boxes are aligned.
- Fixed: the “Authentication check” button did not show its waiting text.
- Updated: “Tested up to” is now 7.1.
1.2.2
- Fixed a bug where the translation start flag would unintentionally become false when posting a new post.
- The text domain has been changed according to the official rules.
- Updated google/cloud-translate and league/oauth2-client packages to the latest version.
1.2.1
- Session management has been discontinued using $_SESSION and switched to management using user metadata.
- The condition for translating the slug when posting a new post was changed from when the post status changed from new to auto-draft to when it changed from new to publish.
1.2.0
Made it multilingual. Currently, English and Japanese can be displayed on the management screen.
1.1.4
Deleted the options recorded in the database when uninstalling the plugin.
Fixed a bug that an error was not displayed properly when an error was detected in the authentication check on the management screen of Google Cloud Translation API.
1.1.3
Added a function to select Google Cloud Translation API for translation API
Eliminated error caused by calling before session variable is initialized.
1.0.2
Changed when to translate and replace permalinks from first publish to first save
1.0.0
First public release
