Simple Slug Translate can translate the post, page, category and taxonomy slugs to English automatically.
Simple Slug Translate can translate the post, page, category and taxonomy slugs to English automatically.
It can make the permalink looks more better, and also may be good for SEO.
The translation engine is powered by Watson Language Translator. Thanks to that support the following languages:
In order to use the service, you can apply for an IBM Cloud Lite account and get your own API key of Watson Language Translator. For free plan, you can translate up to 1,000,000 characters per month.
Learn more:
You need to apply for an IBM Cloud Lite account and get your own API key of Watson Language Translator.
This plugin uses the API key to query the translation engine. The API key are not used except for query!
Whether the slug is overwritten can be switched with the following settings.
You can customize the slug by hooking it to the simple_slug_translate_results
filter.
/** | |
* Customize the translated slug. | |
*/ | |
add_filter( 'simple_slug_translate_results', function( $results ) { | |
// 200 – OK | |
if ( 200 === $results['code'] ) { | |
// Customize slug | |
$results['text'] = sprintf( 'translated-%s', $results['text'] ); | |
} | |
return $results; | |
} ); |
You can customize the slug by hooking it to the simple_slug_translate_post_status
filter.
/** | |
* Customize translated post statuses. | |
*/ | |
add_filter( 'simple_slug_translate_post_status', function( $statuses ) { | |
// Specify post statuses | |
$statuses = [ | |
'draft', | |
'publish', | |
]; | |
return $statuses; | |
} ); |