Skip to content

Smart WP-CLI command to cache the Twig templates so they can be read by PoEdit

Notifications You must be signed in to change notification settings

level-level/clarkson-wp-cli-twig-translations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clarkson WP-CLI Twig Translation commando

What

Parses all Twig files in your current themes templates directory to .php files.

How

  1. Install package via composer require level-level/clarkson-wp-cli-twig-translations.

  2. Run wp clarkson-twig-translations prepare-files which dumps rendered .php files in a dist directory in your current active theme.

  3. Make sure your PoEdit .pot or .po file configuration loads this dist 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 the templates are located in.

About

Smart WP-CLI command to cache the Twig templates so they can be read by PoEdit

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages