2017 © Pedro Peláez
 

application circlical-twig-extractor

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates.

image

saeven/circlical-twig-extractor

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates.

  • Friday, September 15, 2017
  • by Saeven
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2,013 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 34 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

symfony upgrade fixertwig gettext extractorwisdomcentipedepermissions handlerextraloadgravatarlocurrocountry listtransliterator , (*1)

Twig Gettext Extractor Build Status

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates., (*2)

Installation

Manual

Local

Download the twig-gettext-extractor.phar file and store it somewhere on your computer., (*3)

Global

You can run these commands to easily access twig-gettext-extractor from anywhere on your system:, (*4)

$ sudo wget https://github.com/umpirsky/Twig-Gettext-Extractor/releases/download/1.2.0/twig-gettext-extractor.phar -O /usr/local/bin/twig-gettext-extractor
$ sudo chmod a+x /usr/local/bin/twig-gettext-extractor

Then, just run twig-gettext-extractor., (*5)

Composer

Local

$ composer require umpirsky/twig-gettext-extractor

Global

$ composer global require umpirsky/twig-gettext-extractor

Make sure you have ~/.composer/vendor/bin in your PATH and you're good to go:, (*6)

$ export PATH="$PATH:$HOME/.composer/vendor/bin"

Don't forget to add this line in your .bashrc file if you want to keep this change after reboot., (*7)

Setup

By default, Poedit does not have the ability to parse Twig templates. This can be resolved by adding an additional parser (Edit > Preferences > Parsers) with the following options:, (*8)

  • Language: Twig
  • List of extensions: *.twig
  • Invocation:
    • Parser command: <project>/vendor/bin/twig-gettext-extractor --sort-output --force-po -o %o %C %K -L PHP --files %F (replace <project> with absolute path to your project)
    • An item in keyword list: -k%k
    • An item in input file list: %f
    • Source code charset: --from-code=%c

, (*9)

Now you can update your catalog and Poedit will synchronize it with your twig templates., (*10)

Custom extensions

Twig-Gettext-Extractor registers some default twig extensions. However, if you are using custom extensions, you need to register them first before you can extract the data. In order to achieve that, copy the binfile into some custom place. A common practice would be: cp vendor/bin/twig-gettext-extractor bin/twig-gettext-extractor, (*11)

Now you may add your custom extensions here:, (*12)

$twig->addFunction(new \Twig_SimpleFunction('myCustomExtension', true));
$twig->addFunction(new \Twig_SimpleFunction('myCustomExtension2', true));

Command Line Arguments

You can also specify custom extensions and filters via command line, by adding the --functions and --filters arguments, e.g.:, (*13)

--functions formRow,formElement --filters localizedCurrency

You can specify an unlimited amount of comma-separated function and filter names., (*14)

Similarly, you can specify the location of the gettext executable you want to use with --exec, (*15)

--exec /usr/local/bin/xgettext

The Versions

15/09 2017
03/11 2016

0.9

0.9.0.0

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from Twig templates. This fork from the original has been modified to support saeven/zf2-circlical-trans, which adds text domain support to the trans extension.

  Sources   Download

MIT

The Requires

 

The Development Requires

14/02 2013

1.1.3

1.1.3.0

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Саша Стаменковић

26/01 2013

1.1.2

1.1.2.0

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Саша Стаменковић

08/11 2012

1.1.1

1.1.1.0

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Саша Стаменковић

31/08 2012

1.1.0

1.1.0.0

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates.

  Sources   Download

MIT

The Requires

 

by Саша Стаменковић

29/08 2012

1.0.0

1.0.0.0

A script to extract translations from twig templates.

  Sources   Download

MIT

The Requires

 

by Саша Стаменковић