tool for extracting gettext messages

v4.0.5 2021-10-11 21:38 UTC

This package is auto-updated.

Last update: 2023-02-25 11:54:33 UTC


Tool for extracting gettext phrases from PHP files and Latte templates. Output is generated as a .pot file.

Build Status Latest Stable Version Total Downloads License


To install gettext-extractor install it with composer: $ composer require --dev voda/gettext-extractor

Alternatively you can download a standalone PHAR file from releases page.


./vendor/bin/gettext-extractor [options]

  -h            display this help and exit
  -oFILE        output file, default output is stdout
  -lFILE        log file, default is stderr
  -fFILE        file to extract, can be specified several times
  -kFUNCTION    add FUNCTION to filters, format is:
                default FILTERs are PHP and Latte
                for SINGULAR, PLURAL and CONTEXT '0' means not set
                can be specified several times
  -mKEY:VALUE   set meta header

e.g.: ./vendor/bin/gettext-extractor -o outup/file.pot -f files/to/extract/

Supported file types

  • .php
  • .latte (Nette Latte templates)


GettextExtractor is licensed under the New BSD License.

Based on code from Karel Klíma.