level-level / clarkson-wp-cli-twig-translations
Smart WP-CLI command to cache the Twig templates so they can be read by PoEdit
Installs: 151 241
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 1
Open Issues: 0
Requires
- twig/html-extra: ^3.1
- twig/intl-extra: ^3.1
- twig/markdown-extra: ^3.1
- twig/string-extra: ^3.1
- twig/twig: ^3.1
Requires (Dev)
- wp-cli/wp-cli: ^2.9
README
What
Parses all Twig files in your current themes templates
directory to .php
files.
How
-
Install package via
composer require level-level/clarkson-wp-cli-twig-translations
. -
Run
wp clarkson-twig-translations prepare-files
which dumps rendered.php
files in adist
directory in your current active theme. -
Make sure your PoEdit
.pot
or.po
file configuration loads thisdist
folder when it updates from source like"X-Poedit-SearchPath-1: dist/rendered-templates\n"
Why
Free PoEdit doesn't scans Twig files. If you do want PoEdit to do this, buy the Pro version.
Filters
clarkson_twig_translations_cache_path
alters the location where to parse to.clarkson_twig_translations_templates_path
alters the location where thetemplates
are located in.