Parses all Twig files in your current themes templates
directory to .php
files.
-
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"
Free PoEdit doesn't scans Twig files. If you do want PoEdit to do this, buy the Pro version.
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.