2017 © Pedro Peláez
 

library twig-po

Extract {%trans%} keys from twig and insert them in your PO file

image

natxet/twig-po

Extract {%trans%} keys from twig and insert them in your PO file

  • Monday, November 9, 2015
  • by natxet
  • Repository
  • 1 Watchers
  • 3 Stars
  • 61 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 1 Versions
  • 15 % Grown

The README.md

twig-po

Extract translation keys from twig templates and move them to PO, (*1)

Instructions

Fork and install (you need composer for that!):, (*2)

git clone git@github.com:natxet/twig-po.git
cd twig-po
composer install

Then, go to folder and execute:, (*3)

./console find:tags /path/to/twig/templates  /path/to/messages.po Po -d -v -o

Once you see that nothing wrong is going to happen then, (*4)

./console find:tags /path/to/twig/templates  /path/to/messages.po Po

If you want to use it with other tags, for instance, for your PHP files with _('translation'), (*5)

./console find:tags /path/to/twig/templates  /path/to/messages.po Po -t "/_\((?: )?['\"]([^$]*)['\"](?: )?\)/muU"

For help:, (*6)

./console help find:tags

Once you have the PO translated, convert to .mo with your editor or command line:, (*7)

msgfmt -cv -o messages.mo messages.po

(Note: you need to have gettext installed for this command), (*8)

The Versions

09/11 2015

dev-master

9999999-dev https://github.com/natxet/twig-po

Extract {%trans%} keys from twig and insert them in your PO file

  Sources   Download

The Requires

 

twig i18n po