
SLUG TRANSLATER
v2.0.1Isamu Takeda · 2023年2月25日 上架
Translate Japanese slugs into English, and translate posts and blocks into other languages with Google Cloud Translation or Minna no Jido Honyaku.
- 正在使用
- 30+
- 评分
- 暂无
- 累计下载
- 1,967
- 最近更新
- 2026年11月18日
需要 WordPress 6.3+已测试到 7.1.5PHP 8.2.10+
贡献者
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.