Download the PHP package publishpress/bundled-translations without Composer
On this page you can find all versions of the php package publishpress/bundled-translations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download publishpress/bundled-translations
More information about publishpress/bundled-translations
Files in publishpress/bundled-translations
Package bundled-translations
Short Description Forces WordPress plugins to use their bundled translations instead of global translations from wordpress.org.
License GPL-3.0-or-later
Homepage http://publishpress.com/
Informations about the package bundled-translations
PublishPress Bundled Translations
Forces WordPress plugins to use their bundled translations instead of the global translations downloaded from translate.wordpress.org.
How It Works
This library hooks into WordPress's load_textdomain_mofile filter. When WordPress tries to load a .mo file from the global wp-content/languages/plugins/ directory, the filter redirects it to the plugin's own bundled languages/ directory instead.
Requirements
- PHP >= 7.2.5
- WordPress
Installation
Add the package to your plugin's lib/composer.json:
Then run:
Usage
In your plugin's main PHP file, include the library and instantiate it:
Disabling
The library can be disabled in two ways:
Via PHP Constant
Add to wp-config.php or anywhere before the plugin loads:
Via WordPress Filter
Running tests
-
Install dependencies at the repository root:
-
Configure the environment for WPBrowser’s WPLoader: copy
.env.exampleto.envand set the variables for your local WordPress test install and database (see the comments in.env.example). -
Link the dummy plugin to this tree — integration tests load the library from
tests/Support/Data/DummyPlugin/lib/vendor/. That install must be a Composer path symlink so it tracks your edits undercore/. From the repo root:…or:
-
Edit code — change
core/for the library; add or extend Codeception/WPBrowser specs undertests/(integration Cests live intests/Integration/). -
Rebuild test actors if you change suite modules (e.g.
tests/Integration.suite.yml): -
Run the suite:
Run one Cest file or method, for example:
License
GPL-3.0-or-later