We'll create fresh WordPress site with WP Multilang installed. You have 20 minutes to test the plugin after that site we'll be deleted.
WP Multilang is a multilingual plugin for WordPress.
Translations of post types, taxonomies, meta fields, options, text fields in miltimedia files, menus, titles and text fields in widgets.
manage_options
.Manage translation settings via json.
Add in the root of your theme or plugin file wpm-config.json
.
Sample configurations can be viewed in config files in folder ‘configs’ in root the plugin.
Configuration is updated after switching theme, enable or update any plugins.
The plugin has filters for dynamic application configuration for translate.
For turn off translation, set null
into the desired configuration.
For example, you must turn off translation for a post type post
.
There are two ways:
In json.
Create in root of a theme or a plugin file wpm-config.json
with:
{
“post_types”: {
“post”: null
}
}
Through the filter.
Add in functions.php
add_filter( ‘wpm_post_post_config’, ‘__return_null’ );
To enable translation pass an empty array in php array()
or empty object in json {}
.
Supports translation multidimensional array of options, meta fields and post_content.
Supports the removal of established localizations.
Supports translation via GET parameter. Add in the GET parameter lang
code desired language.
Supports clean database of translations when removing the plugin. Translations are only removed from the built-in tables.
Supports import term translations from qTranslate(by Soft79).
Supports automatically redirect to the user’s browser language, if he visits for the first time.
Ideal for developers.
For display language switcher in any place add the code to your template if ( function_exists ( 'wpm_language_switcher' ) ) wpm_language_switcher ();
Function accepts two parameters:
$type – ‘list’, ‘dropdown’, ‘select’. Default – ‘list’.
$show – ‘flag’, ‘name’, ‘both’. Default – ‘both’.
Or using the shortcode wpm_lang_switcher
. It accept two not necessary parameters ‘type’ and ‘show’.
Available features for translation:
wpm_translate_url( $url, $language = ” ); – translate url
wpm_translate_string( $string, $language = ” ); – translate multilingual string
wpm_translate_value( $value, $language = ” ); – translate multidimensional array with multilingual strings
Update translation occurs at PHP. Therefore plugin has high adaptability, compatibility and easily integrates with other plugins. This is what distinguishes it among similar.
Available translation html tags by JS for strings what do not have WP filters before output.
Add your tags in config:
"admin_html_tags": {
"admin_screen_id": {
"attribute": [
"selector"
]
}
}
Where:
admin_screen_id – admin screen id.
attribute – attribute what need to translate. Available ‘text’ – for translate text node, ‘value’ – for translate form values. Or other tag attribute, like ‘title’, ‘alt’.
selector – css selector for search needed tag. Each selector is a new array item.
If You need to add translation for multidimentional array for repeated elements You can use custom tag ‘wpm_each’ for set config to each element in array.
Example, add config for each item ‘title’ in custom post field array:
"post_fields": {
"custom_field": {
"wpm_each": {
"title": {}
}
}
}
For set translation uses the syntax:
[:en]Donec vitae orci sed dolor[:de]Cras risus ipsum faucibus ut[:]
Added shortcode for translate text in any place:
[wpm_translate][:en]Donec vitae orci sed dolor[:de]Cras risus ipsum faucibus ut[:][wpm_translate]
If You translate text in established language, add lang parameter:
[wpm_translate lang=”de”][:en]Donec vitae orci sed dolor[:de]Cras risus ipsum faucibus ut[:][wpm_translate]
Support translating from syntax qTranslate, qTranslate-X, WPGlobus etc.
Compatible with REST-API.
Support transfer the required translation through option lang
in the GET request to REST.
Has the ability to keep recording the target language through the transmission parameter lang
in the request.
Do not support different slug for each language(Yet).
Not compatible with:
– WP Maintenance
Function ‘get_page_by_title’ not working, because in title field are stored titles for all languages. Use function ‘wpm_get_page_by_title( $title )’ as solution.
NOTE: Because plugins have different ways of storing data, WP Multilang is not compatible with every single plugin out-of-the-box (mostly page builders). This may result in texts not being translatable or translations not being saved. Most of these issues can be resolved using the integration options (wpm-config.json or filters) of WP Multilang.
Please try WP Multilang in a test-environment before activating it on an existing production site and always make a backup before activating!
Bug reports for WP Multilang are welcomed on GitHub. Please note GitHub is not a support forum, and issues that aren’t properly qualified as bugs will be closed.