PHPackages                             galette/smarty-xgettext - 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. [Templating &amp; Views](/categories/templating)
4. /
5. galette/smarty-xgettext

AbandonedArchivedLibrary[Templating &amp; Views](/categories/templating)

galette/smarty-xgettext
=======================

Smarty xgettext features

1.2.4(4y ago)025.0k↓50%BSD-3-ClausePHPPHP ^7.3 || ^8

Since Sep 10Pushed 4y agoCompare

[ Source](https://github.com/galette/smarty-xgettext)[ Packagist](https://packagist.org/packages/galette/smarty-xgettext)[ Docs](https://github.com/galette/smarty-xgettext)[ Fund](https://paypal.me/pools/c/8u4dEPpM0q)[ RSS](/packages/galette-smarty-xgettext/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (13)Used By (0)

Smarty xgettext
===============

[](#smarty-xgettext)

A command line utility to extract translations source strings from [Smarty templates](https://smarty.net) to a PO-Template (`.pot`) file.

This utility will scan templates for `{_T string=""}` placeholders for translation strings and output a `.pot` file (`.po` template).

Features:

- scan files and directories recursively,
- include original string location,
- supports plurals `{_T string="singular" plural="plural"}`,
- supports contexts `{_T string="string" context="mycontext"}`,
- supports comments `{_T string="string" comment="Explanation"}`
- supports domains `{_T string="string" domain="mydomain""}`, `{_T string="singular" plural="plural" domain="mydomain}`, ...

Usage:

```
./vendor/bin/smarty-xgettext -o smarty.pot

find templates -name '*.tpl.html' -o -name '*.tpl.text' -o -name '*.tpl.js' -o -name '*.tpl.xml' | xargs ./vendor/bin/smarty-xgettext -o smarty.pot

```

If a parameter is a directory, the template files within will be parsed, recursively.

If you want to combine Smarty translations with your PHP ones, you can combine results with the `msgcat` command:

```
./vendor/bin/smarty-xgettext.php -o smarty.pot /path/to/source/templates
xgettext /path/to/source/php --keyword=_T --output=php.pot
msgcat -o project.pot --use-first php.pot smarty.pot

```

Developing
----------

[](#developing)

1. clone this repository
2. [get composer](https://getcomposer.org/download/)
3. install composer dependencies: `php composer.phar install`
4. start using it: `php bin/smarty-xgettext`

Initially based on [tsmatry2c](https://github.com/smarty-gettext/tsmarty2c). Original project (which seems not maintained) was using Smarty blocks while Galette relies on a function.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 57% 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 ~153 days

Recently: every ~89 days

Total

11

Last Release

1633d ago

Major Versions

0.1.2 → 1.0.02020-06-27

PHP version history (2 changes)0.1.0PHP ^5.5.9 || ^7.0

1.2.0PHP ^7.3 || ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/50348be212ab6478818bc77ee3ceacf35ee49cbaf0f2fc822db7f07f406d7a80?d=identicon)[trasher](/maintainers/trasher)

---

Top Contributors

[![glensc](https://avatars.githubusercontent.com/u/199095?v=4)](https://github.com/glensc "glensc (69 commits)")[![trasher](https://avatars.githubusercontent.com/u/224733?v=4)](https://github.com/trasher "trasher (51 commits)")[![kumy](https://avatars.githubusercontent.com/u/176794?v=4)](https://github.com/kumy "kumy (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/galette-smarty-xgettext/health.svg)

```
[![Health](https://phpackages.com/badges/galette-smarty-xgettext/health.svg)](https://phpackages.com/packages/galette-smarty-xgettext)
```

###  Alternatives

[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[vincentlanglet/twig-cs-fixer

A tool to automatically fix Twig code style

3348.4M67](/packages/vincentlanglet-twig-cs-fixer)[friendsoftwig/twigcs

Checkstyle automation for Twig

3586.1M61](/packages/friendsoftwig-twigcs)[braincrafted/bootstrap-bundle

BraincraftedBootstrapBundle integrates Bootstrap into Symfony2 by providing templates, Twig extensions, services and commands.

3932.0M33](/packages/braincrafted-bootstrap-bundle)[asm89/twig-lint

Standalone twig linter.

1186.0M2](/packages/asm89-twig-lint)

PHPackages © 2026

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