Linux 软件免费装

More-Lang

开发者 Clive Zheng
更新时间 2021年8月31日 23:58
捐献地址: 去捐款
PHP版本: 3.8 及以上
WordPress版本: 5.7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

language multilanguage i18n translation localization international multilingual bilingual ClassicPress language switcher

下载

1.3.1 1.1.2 1.1.3 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.2 1.4.0 1.5.0 1.5.1 1.6.0 1.6.1 1.6.2 1.6.3 1.6.5 1.6.6 1.6.8 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.10 1.8.2 1.8.3 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.1 1.9.2 1.9.3 2.0.0 2.0.1 2.1.1 2.1.2 2.2.0 2.3.0 2.4.0 2.4.1 2.5.0 2.5.2 2.5.3 1.1.1 1.6.7 1.8.5 2.1.0 2.5.5 2.5.6 1.0.0 1.1.0

详情介绍:

More-Lang has some excellent features:

安装:

  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 Settings' 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 Settings' screen, then delete the More-Lang plugin through the 'Plugins' screen.

屏幕截图:

  • 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. Note: the Names of Custom Fields should be translated in the "Translations" page.
  • 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.
  • The support for the medias.
  • The support for compatibility with Plugins & Themes in some special cases. The "Special" menu item will not be shown if the option is not checked.

常见问题:

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?

  • The "Enable compatibility with Plugins & Themes in some special cases" option provides solutions for some compatibility issues.
  • If the plugin uses short codes, it's usually very simple: create short code for every language, then paste the short codes to the corresponding contents.
  • The premium add-on More-Lang Pro provides support for WooCommerce, translations of options, and URI-map, etc.
  • 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.

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 certain cases(i.e., the Name of any Custom Field, or the Name of any non-taxonomy Product attribute), you can translate in the "Translations" 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.

更新日志:

2.5.6 (2021-06-04) 2.5.5 (2021-03-31) 2.5.4 (2021-03-23) 2.5.3 (2021-02-26) 2.5.2 (2021-02-08) 2.5.1 (2020-12-16) 2.5.0 (2020-11-01) 2.4.3 (2020-10-21) 2.4.2 (2020-09-30) 2.4.1 (2020-09-16) 2.4.0 (2020-08-21) 2.3.0 (2020-08-01) 2.2.0 (2020-07-21) 2.1.2 (2020-07-15) 2.1.1 (2020-07-11) 2.1.0 (2020-07-01) 2.0.1 (2020-06-19) 2.0.0 (2020-06-09) 1.9.3 (2020-05-19) 1.9.2 (2020-04-10) 1.9.1 (2020-03-19) 1.9.0 (2020-03-11) 1.8.10 (2020-02-03) 1.8.9 (2019-10-09) 1.8.8 (2019-08-01) 1.8.7 (2019-06-07) 1.8.6 (2019-05-01) 1.8.5 (2019-03-31) 1.8.4 (2019-03-15) 1.8.3 (2019-03-03) 1.8.2 (2019-02-16) 1.8.1 (2019-01-26) 1.8.0 (2019-01-01) 1.7.3 (2018-11-16) 1.7.2 (2018-11-08) 1.7.1 (2018-10-26) 1.7.0 (2018-10-10) 1.6.8 (2018-08-11) 1.6.7 (2018-06-28) This version fixed 2 compatibility issues for older Wordpress: 1.6.6 (2018-06-26) 1.6.5 (2018-06-18) This version includes some minor usability changes: 1.6.4 (2018-06-13) 1.6.3 (2018-06-03) 1.6.2 (2018-06-01) 1.6.1 (2018-05-18) 1.6.0 (2018-05-08) 1.5.1 (2018-03-31) 1.5.0 (2018-03-19) 1.4.0 (2018-03-11) 1.3.2 (2018-02-26) 1.3.1 (2018-02-11) 1.3.0 (2018-01-31) This version added support for the widgets upgrade in WP4.8~WP4.9: 1.2.3 (2018-01-08) 1.2.2 (2018-01-01) This version includes a minor change: 1.2.1 (2017-12-21) This version includes some minor changes: 1.2.0 (2017-12-13) 1.1.3 (2017-11-26)