]> git.immae.eu Git - github/wallabag/wallabag.git/blob - vendor/umpirsky/twig-gettext-extractor/README.md
34eff88cdd0c62f97b9feec381e135a0cace6a3b
[github/wallabag/wallabag.git] / vendor / umpirsky / twig-gettext-extractor / README.md
1 Twig Gettext Extractor [![Build Status](https://secure.travis-ci.org/umpirsky/Twig-Gettext-Extractor.png?branch=master)](http://travis-ci.org/umpirsky/Twig-Gettext-Extractor)
2 ======================
3
4 The Twig Gettext Extractor is [Poedit](http://www.poedit.net/download.php)
5 friendly tool which extracts translations from twig templates.
6
7 ## Installation
8
9 The recommended way to install Twig Gettext Extractor is through
10 [composer](http://getcomposer.org).
11
12 ```json
13 {
14 "require": {
15 "umpirsky/twig-gettext-extractor": "1.1.*"
16 }
17 }
18 ```
19
20 ## Setup
21
22 By default, Poedit does not have the ability to parse Twig templates.
23 This can be resolved by adding an additional parser (Edit > Preferences > Parsers)
24 with the following options:
25
26 - Language: `Twig`
27 - List of extensions: `*.twig`
28 - Invocation:
29 - Parser command: `<project>/vendor/bin/twig-gettext-extractor --sort-output --force-po -o %o %C %K -L PHP --files %F`
30 - An item in keyword list: `-k%k`
31 - An item in input file list: `%f`
32 - Source code charset: `--from-code=%c`
33
34 <img src="http://i.imgur.com/f9px2.png" />
35
36 Now you can update your catalog and Poedit will synchronize it with your twig
37 templates.
38
39 ## Tests
40
41 To run the test suite, you need [composer](http://getcomposer.org) and
42 [PHPUnit](https://github.com/sebastianbergmann/phpunit).
43
44 $ composer install --dev
45 $ phpunit
46
47 ## License
48
49 Twig Gettext Extractor is licensed under the MIT license.