More-Lang

Popis

More-Lang has some excellent features:

  • Clean design. More-Lang saves each localized post text as a custom field, this brings some benefits: it will not leave any trace on the UI after deactivation; it can minimize the DB space usage.
  • More-Lang works in such a way: it treats the configured languages as a default language plus any number of extra lanuages, the default language works in the default way of WordPress, More-Lang handles the extra languages. That’s why it is named More-Lang.
  • Simple & easy to use admin UI.
  • In-place language switchers & editors on the admin panels.
  • There are built-in editors for: posts, taxonomy terms, menus, widgets, general settings.
  • RTL languages support.

Known Issues

  • Autosave is not supported for the WordPress releases before 4.6 or after 5.0.
  • Array values(same meta_key for multiple metas in a post) are not supported for the Custom Fields.
    I think Array values in the Custom Fields are seldom used, if you do need this, try another approach: save Array values in a field, delimited by special characters.

Snímky obrazovky

  • The configuration page. Three languages are configured here("English" & "Deutsch" & "中文", "English" is the default). You can add more languages from the "Add Locale" section. You can get help by hovering on the "?" icon.
  • Multilingual "Site Title" & "Tagline" editor.
  • Posts: Multilingual "Title" & "Content" editor.
  • Posts: Multilingual "Excerpt" & "Custom Fields" editor.
  • Multilingual taxonomy terms editor.
  • Multilingual menu items editor. More-Lang provides a language switcher menu item.
  • Multilingual widgets editor. More-Lang provides a language switcher widget. Note: for a newly added widget, the More-Lang editors will not get activated; only after the widget is saved, the More-Lang editors get activated.
  • Autosave & revision management. More-Lang provides excellent support for autosave & revision.
  • Translating of any text. If an in-place editor is not present, you can translate the text here, see more details in the FAQ.
  • The support for the Gutenberg editor introduced in WordPress 5.0. The "Update"/"Publish" buttons will only update the default language. The "Update Translation" button will update all the localized versions.

Instalace

  1. Upload the plugin files to the /wp-content/plugins/more-lang directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‚Plugins‘ screen in WordPress.
  3. Use the ‚More-Lang Plugin Setting‘ screen to configure the plugin.
  4. The „Settings -> Permalinks -> Permalink Settings“ should not be „Plain“.
  5. If you want to clear all the More-Lang data, firstly, you need to set Clear the More-Lang data when „Delete“ More-Lang on the Plugins panel on the ‚More-Lang Plugin Setting‘ screen, then delete the More-Lang plugin through the ‚Plugins‘ screen.

Časté dotazy

How to customize the frontend language switcher styles?

More-Lang provides two filters:

  • ‚morelang_front_cssurl‘, filters the css url styling the language switcher. Parameters: ‚$front_css_url‘, the built-in css url.
  • ‚morelang_flag_url‘, filters the flag icon urls. Parameters: ‚$img_src‘, the original url; ‚$locale‘, the current requested locale; ‚$position‘, where to be placed, it can be „menu“ or „panel“.
    After the release 1.8.5, you can also check „Do not use the default styles for the language switchers“, then ‚morelang_front_cssurl‘ filter is not needed.
How to localize external plugins?
  • If the plugin uses short codes, it’s usually very simple: create short code for every language, then paste the short codes to the related content.
  • If the plugin uses widgets, try this way: find out the filters used for the texts, add your filter handlers in your theme to return localized texts.
  • The premium add-on More-Lang Pro provides support for WooCommerce, and Post-related plugins like Elementor, Yoast SEO, etc.
How to translate text without an in-place editor?

More-Lang provides in-place editors as far as possible. If it does not provide in some cases(e.g., the Name of a Custom Field), you can translate in the „Translation“ page,
and in most cases(the only exception is the the_meta() function), you need to make code change to get the localized text, there are 2 approaches:

  • Use the translating filter:   apply_filters('morelang_translate_text', $default_text)   .
  • Use the translating function:   _ml_t($default_text, $any='')   . This approach is more concise. Its shortcoming is that it is a function,
    if you deactivate the More-Lang plugin, your site may fail. To avoid the fail, you can add a fallback function in your theme’s functions.php file, e.g.:

    if (! function_exists( '_ml_t' )) { function _ml_t($default_text, $any='') { return $default_text; }; }
    

The $any parameter is optional, _ml_t() doesn’t use it at all. You can simply ignore it, or set it to the $domain of the WordPress __($text, $domain) function,
then if one day you would like to uninstall the More-Lang plugin, you can simply replace „_ml_t“ with „__“ to use the default approach of WordPress.

After you make code change in the above ways, you will have some texts needed to be translated. You can add the texts to the translation page automatically:

  • Implement the filter morelang_texts_to_translate (parameter: $arr), then More-Lang will fill the translation table with the texts returned by the filter, e.g.:

    add_filter( 'morelang_texts_to_translate', function( $arr ) { return array_merge($arr, ['text 1', 'text 2', 'text 3']); } );
    

There’s very good reason for not providing in-place editors for the Names of Custom Fields(and similar scenarios):
the in-place editors can appear in many Posts, which can lead to inconsistent translation.

What about reordering or modifying the supported languages?
  • No additional work is required for reordering the non-default languages.
  • If you change the default language to another language after entering any content for either of the two languages,
    the link from the content to the language will be broken, you need to re-enter the content.
  • No additional work is required adding new languages.
  • No additional work is required for modifying all the fields except the Locale.
  • If you modify a Locale after entering any content for the language, the link from the content to the language will be broken, you need to re-enter the content.
Where are the More-Lang data saved?
  • The setting data is saved in the „wp_options“ table, with „morelang_nml_option“ as the option_name.
  • The localized post title, post content, post excerpt, custom fields and menu items are saved in „wp_postmeta“ table.
  • All the other localized options are saved in the „wp_options“ table.

All the More-Lang related data have „morelang_nml_“ in their keys or names, which can be used to identify them.

Recenze

9. 10. 2019
Thanks a lot for this plugin, despite it doesn't work with another KB plugin (but this KB plugin doesn't work with all translation plugin also) Not, like other plugins, here, you have not thousend of options, you can switch from language to another without upload at each time the page. Easy to use, light, great ! I suggest to use the DeepL plugin by Fluenx with this one for auto-translate your html content. (Note that you need a subscription to the DeepL API) https://wordpress.org/plugins/wpdeepl/ Thanks!
22. 4. 2018
this plugin is pretty much very good, you can translate near everything, best thing is its very intuitive, not 300 000 options where you end up thinking "omg i am fed up of configurations, just do it" the single problem i had was with right-to-left writing langs, my theme is messup, but this did happend me with another plugin i tested, at least this one allows me to patch it partially, by editing the language code for something else. if it has some button to auto translate the post then you could retouch the wrong words, at least just for posts and pages, that would be awesome, i give still 5 stars because there must be lot of hours on this, it pretty much works, and its free, regards
10. 3. 2018
I was looking for a simple plugin to bring multlingual compatibility to my site that will allow me not to duplicate all the tags, categories, posts and pages for each language i need. Thanks to the author of this plugin, posts tags and categories may become ambilingual for every language you choose. If there is no certain translation the default text will be used. Also i found that tags/categories description lacks translation. And the page title get's it's value from default page header even if there is a translation for a chosen language, it's not right. Hope it will be fixed in upcoming updates.
Přečtěte si všech 6 recenzí

Autoři

More-Lang je otevřený software. Následující lidé přispěli k vývoji tohoto pluginu.

Přeložte “More-Lang” do svého jazyka.

Zajímá vás vývoj?

Prohledejte kód, podívejte se do SVN repozitáře, nebo se přihlaste k odběru protokolu vývoje pomocí RSS.

Přehled změn

1.8.9 (2019-10-09)

  • Fixed a menu item issue: Custom Link with relative URL didn’t work for the default language.
  • Added HTML entity support to the „CSS Selector“ input on the settiong page.
  • Improved the setting page tooltips & readme.txt.

1.8.8 (2019-08-01)

  • Fixed the deprecated function ‚create_function‘ issue in dev mode of PHP 7.2+.
  • Some other trivial improvements.

1.8.7 (2019-06-07)

  • Fixed a Setting page issue: not working in specific environment.
  • Some other trivial improvements.

1.8.6 (2019-05-01)

  • Improved the interfaces for extension.
  • Improved the UI.

1.8.5 (2019-03-31)

  • Added the „Do not use the default styles for the language switchers“ option.
  • Improved the usability of the Translating page.
  • Improved the interfaces for extension.

1.8.4 (2019-03-15)

  • Fixed a WP_Widget_Text issue: not showing toolbar & language switcher.
  • Improved the plugin setting page.
  • Improved the loading of js files.

1.8.3 (2019-03-03)

  • Improved RTL support for the Gutenberg editor.
  • Improved revision creation for the Gutenberg editor.
  • Some other trivial improvements(autosave control, empty tip, faq link).

1.8.2 (2019-02-16)

  • Added RTL support for the Gutenberg editor.
  • Added revision creation for the Gutenberg editor.

1.8.1 (2019-01-26)

  • Added the support for the Gutenberg editor meta blocks.

1.8.0 (2019-01-01)

  • Added the support for the Gutenberg editor (the support for the meta blocks was not completed).

1.7.3 (2018-11-16)

  • Improved the search results.
  • Improved the data format of taxonomy-terms.

1.7.2 (2018-11-08)

  • Added the localization of term-description.
  • Added the translating function: _ml_t($default_text, $any='').

1.7.1 (2018-10-26)

  • Some minor changes: document improvement, and little code refactor.

1.7.0 (2018-10-10)

  • Added the support for translating of any text, which can be used if an in-place editor is not present.

1.6.8 (2018-08-11)

  • Improved the plugin extension interface (this change has no impact on the previous installations).

1.6.7 (2018-06-28)

This version fixed 2 compatibility issues for older WordPress:
* Fixed missing argument warnings for the ‚get_terms‘ & ‚_wp_post_revision_fields‘ filters in pre WordPress 4.6.

1.6.6 (2018-06-26)

  • Fixed an ‚is_rtl()‘ calling issue (function undefined) in pre WordPress 4.6.

1.6.5 (2018-06-18)

This version includes some minor usability changes:
* Changed the revision comparing lang-heading from locale to language name.
* Changed the rich editor language switcher styles to display scroll-y-bar only when the height overflows.
* Changed the action button styles.

1.6.4 (2018-06-13)

  • Added the „pop-up language switcher on the rich editors“ option.
  • Fixed a WP_Widget_Text display issue: the default value is displayed after saving, & not sync with the returned values.
  • Fixed a WP_Widget_Text saving issue: not save the inputed in text mode.

1.6.3 (2018-06-03)

  • Added support for the „wp-login.php“ URLs.
  • Fixed a RTL styling issue in the case that the default language is RTL.

1.6.2 (2018-06-01)

  • Added setting RTL style if the default language is RTL.
  • Added the language switcher for the „login“ and „register“ pages.
  • Added the „submit“ button state(enabled/disabled) change according to the setting change.
  • Improved the recovery of previous language selection.

1.6.1 (2018-05-18)

  • Added setting RTL direction even when the corresponding language pack is not installed.
  • Added language selection recovery for async-widgets: „Image“, „Audio“, „Video“, „Gallery“, „Custom HTML“ and „Text“.

1.6.0 (2018-05-08)

  • Added the RTL languages support.
  • Keeping language info when searching.
  • Added the recovery function of previous language selection.

1.5.1 (2018-03-31)

  • The improvement of autosave support.
  • The improvement of „Missing Content Placeholder“ option.

1.5.0 (2018-03-19)

  • Added „Language“ column to the Posts lists to show the translation status of each Post.
  • Fixed an overwriting issue when creating new autosave record.
  • Few other trivial changes.

1.4.0 (2018-03-11)

  • Added the support for Autosave (the WordPress releases before 4.6 are not supported).
  • Added the management of localized fields in revisions.

1.3.2 (2018-02-26)

  • Fixed the error of ‚$this‘ parameter in PHP7+.
  • Added the support for WP_Widget_Custom_HTML in WP4.8.X.
  • Added the support for the WP_Widget_Text in WP4.8~WP4.8.1.

1.3.1 (2018-02-11)

  • Added the localization of the WP_Widget_Custom_HTML.

1.3.0 (2018-01-31)

This version added support for the widgets upgrade in WP4.8~WP4.9:
* Added the localization of the WP_Widget_Text rich editor.
* Added the localization of widget titles of Image, Audio, Video, Gallery, Custom HTML.

1.2.3 (2018-01-08)

  • Added the ‚get_terms‘ filter handler.
  • The Refactor of the „ext“ directory structure (no function change).

1.2.2 (2018-01-01)

This version includes a minor change:
* Admin language switcher tabs improvement (just some CSS change).

1.2.1 (2017-12-21)

This version includes some minor changes:
* No redirection cache on the browsers (otherwise there might be issue in newer Firefox).
* Sync language selection for rich editors.

1.2.0 (2017-12-13)

  • New feature: Redirect according to the browser’s preferred languages when the front page is requested.
  • Fixed a ‚get_the_excerpt‘ filter issue in pre WP 4.5.0.
  • Other trivial changes.

1.1.3 (2017-11-26)

  • The setting page UI change.
  • The pre-defined locales change.
  • Other trivial changes.