motivast/polylang-string-extractor

Polylang String Extractor is a plugin provided for extract translatable strings from WordPress functions to Polylang.

dev-master 2020-04-23 15:19 UTC

This package is auto-updated.

Last update: 2024-04-24 00:22:23 UTC


README

plugin downloads rating php support

travis coverage maintainability

Polylang String Extractor is a plugin provided for extract translatable strings from WordPress native translation functions like __() or _e() to Polylang "Strings translations" table.

Why? ☝️

Polylang is great plugin to translate WordPress. It provide ease way to translate pages, posts, custom post types and strings. Strings however must be translated with pll__ or pll_e functions and registered with pll_register_string to display in "Strings translations" table. It can be very time consuming to adjust your theme or plugin to be compatible with Polylang string translations functionality.

This plugin will scan themes and plugins and search for native WordPress translations functions like __() or _e(), extract strings from them and add to "Strings translations" table in Polylang.

Installation 📦

  1. Visit Plugins > Add New
  2. Search for “Polylang String Extractor”
  3. Install and activate “Polylang String Extractor"

or

  1. Download plugin from wordpres.org repository or release section.
  2. Upload the polylang-string-extractor directory to your /wp-content/plugins/ directory
  3. Activate the plugin through the"‘Plugins" menu in WordPress

Usage 🔥

After plugin activation Polylang String Extractor will automaticly scan your theme and plugins loooking for WordPress translation functions. To rescan theme and plugins again you can go to "Strings Translations" of the "Polylang" plugin and click "Scan for translations" button.

Supported functions:

  • __()
  • _e()
  • _x()
  • _ex()
  • esc_attr__()
  • esc_html__()
  • esc_attr_e()
  • esc_html_e()
  • esc_attr_x()
  • esc_html_x()
  • _n()
  • _nx()
  • _n_noop()
  • _nx_noop()

Polylang String Extractor has support for functions which translate plurals like _n() but Polylang itself do not has such a functionality. Translating this kind of strings may cause unexpected results.

Contribute ✋

Please make sure to read the Contribution guide before making a pull request.

Thank you to all the people who already contributed to Polylang String Extractor!

License 📖

The project is licensed under the GNU GPLv2 (or later).

Copyright (c) 2018-present, Motivast