PHPackages                             natxet/twig-po - 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. natxet/twig-po

ActiveLibrary

natxet/twig-po
==============

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

22.4k↓50%3[2 issues](https://github.com/natxet/twig-po/issues)PHP

Since Nov 9Pushed 10y ago1 watchersCompare

[ Source](https://github.com/natxet/twig-po)[ Packagist](https://packagist.org/packages/natxet/twig-po)[ RSS](/packages/natxet-twig-po/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

twig-po
=======

[](#twig-po)

Extract translation keys from twig templates and move them to PO

Instructions
------------

[](#instructions)

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

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

```

Then, go to folder and execute:

```
./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

```
./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')

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

```

For help:

```
./console help find:tags

```

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

```
msgfmt -cv -o messages.mo messages.po

```

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

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

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

---

Top Contributors

[![natxet](https://avatars.githubusercontent.com/u/1036236?v=4)](https://github.com/natxet "natxet (20 commits)")

### Embed Badge

![Health badge](/badges/natxet-twig-po/health.svg)

```
[![Health](https://phpackages.com/badges/natxet-twig-po/health.svg)](https://phpackages.com/packages/natxet-twig-po)
```

PHPackages © 2026

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