PHPackages                             digirati-labs/extract-twig-strings - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. digirati-labs/extract-twig-strings

ActiveLibrary[Localization &amp; i18n](/categories/localization)

digirati-labs/extract-twig-strings
==================================

Extract translatable resources to Gettext files from Twig templates

v1.0.2(7y ago)01.7k1PHP

Since Apr 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/digirati-co-uk/extract-twig-strings)[ Packagist](https://packagist.org/packages/digirati-labs/extract-twig-strings)[ RSS](/packages/digirati-labs-extract-twig-strings/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

Extract twig string
===================

[](#extract-twig-string)

A console application to extract localizable resources from Twig templates

Installation
------------

[](#installation)

```
composer require digirati-labs/extract-twig-strings

```

Usage
-----

[](#usage)

```
Usage:
  twig-extract [options] [--] []...

Arguments:
  paths                 Paths to the Twig templates to analyze

Options:
  -d, --domain=DOMAIN   The default domain to save translations under [default: "messages"]
  -l, --locale=LOCALE   The locale to associate with exported messages [default: "en_GB"]
  -o, --output=OUTPUT   Path to the directory that messages will be stored in [default: "/Users/stephen.fraser/github.com/digirati-co-uk/extract-twig-strings"]
  -R, --recursive       Search input paths recursively for Twig files
  -x, --format=FORMAT   The format to serialize messages to.  Defaults to: po.  Must be one of: po, mo, xliff, res [default: "po"]
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  Extracts `translate` calls from Twig templates

```

Example:

```
vendor/bin/twig-extract -o exported-translation path/to/templates

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2636d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c0e5a9b913301f2fb80dcb626b96d6e5b324522a8201e09f2761729bd1e8ce3b?d=identicon)[stephenwf](/maintainers/stephenwf)

---

Top Contributors

[![stephenwf](https://avatars.githubusercontent.com/u/8266711?v=4)](https://github.com/stephenwf "stephenwf (7 commits)")

### Embed Badge

![Health badge](/badges/digirati-labs-extract-twig-strings/health.svg)

```
[![Health](https://phpackages.com/badges/digirati-labs-extract-twig-strings/health.svg)](https://phpackages.com/packages/digirati-labs-extract-twig-strings)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M528](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9417.2k58](/packages/open-dxp-opendxp)[chameleon-system/chameleon-base

The Chameleon System core.

1027.9k4](/packages/chameleon-system-chameleon-base)[perplorm/perpl

Perpl is an improved and still maintained fork of Propel2, an open-source Object-Relational Mapping (ORM) for PHP.

249.4k](/packages/perplorm-perpl)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
