PHPackages                             kgaut/potx - 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. kgaut/potx

ActiveDrupal-module[Localization &amp; i18n](/categories/localization)

kgaut/potx
==========

Translation template extractor port for Drupal 8

16593.1k↓18.9%10[1 issues](https://github.com/kgaut/drupal-potx/issues)[1 PRs](https://github.com/kgaut/drupal-potx/pulls)PHP

Since Aug 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/kgaut/drupal-potx)[ Packagist](https://packagist.org/packages/kgaut/potx)[ RSS](/packages/kgaut-potx/feed)WikiDiscussions 8.x-1.x Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

NOTE from @kgaut :

This is a quick and dirty port for d8, this readme file is not accurate. @see :

How to make it works ?

- download this module in modules folder (if you use composer : `composer require kgaut/potx`)
- enable it : `drush en potx`
- extract translation with drush : `drush @ALIAS potx single --include=modules/contrib/potx/ --modules=MYMODULE_MACHINE_NAME --api=8`

Thanks to @rodrigoaguilera you can now export tranlated string from the database : `drush @ALIAS potx single --modules=MYMODULE_MACHINE_NAME --api=8 --language=es`

ABOUT
=====

[](#about)

The goal of the Translation Template Extractor project is to provide command line and web based Gettext translation template extractor functionality for Drupal. These translation templates are used by teams to translate Drupal to their language of choice. There are basically two ways to use the contents of this project:

- Copy potx.inc and potx-cli.php to the directory you would like to generate translation templates for and run php potx-cli.php. The translation templates will get generated in the current directory.
- Install the module on a Drupal site as you would with any other module. Once potx module is turned on, you can go to the "Extract" tab on the "Translate interface" administration interface, select the module or modules or theme or themes you want to have a translation template for, and submit the form. You will get one single template file generated.

    Note: If you only get a white browser screen as response to the extraction request, the memory limit for PHP on the server is probably too low, try to set that higher.

The module also includes optional Coder () integration, allowing you to spot translatability errors in modules while doing your regular code review.

USING potx-cli.php ON THE COMMAND LINE
======================================

[](#using-potx-cliphp-on-the-command-line)

Translation templates can easily be created by running the potx-cli.php script on all source files that contain translatable strings.

1. Copy the potx-cli.php and potx.inc to whatever folder you would like to generate template files in.
2. Run 'php potx-cli.php' and the script will autodiscover all possible files to generate templates for.
3. Translation templates are generated in this folder, if you have the proper rights to create files here.

You can try 'php potx-cli.php --help' to get a list of more options.

The contents of files depend on the mode you use. By default, one single general.pot file will be generated. You can use the "core" mode to generate Drupal core templates (one file per directory, repeated usage of the same string in multiple directories folded into general.pot, .info files folded into general.pot). Or you can use the "multiple" mode which is similar to the "core" mode, but .info files are folded into their module template files.

In case of "core" and "multiple" mode, the generated general.pot will contain strings that occur more than once in the source files. This will help translators to maintain a single translation for them.

CREDITS
=======

[](#credits)

Command line extractor functionality orignally by Jacobo Tarrio &lt;jtarrio \[at\] alfa21.com&gt; (2003, 2004 Alfa21 Outsourcing)

Greatly optimized by Brandon Bergren (2007)

Currently maintained by Gabor Hojtsy &lt;gabor \[at\] hojtsy.hu&gt;

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.5% 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/98c8cc2314f3a86369098d1465b7144f6c4249e82d98c6f39fabb76bb97d396d?d=identicon)[kgaut](/maintainers/kgaut)

---

Top Contributors

[![goba](https://avatars.githubusercontent.com/u/235185?v=4)](https://github.com/goba "goba (137 commits)")[![hero-m](https://avatars.githubusercontent.com/u/648850?v=4)](https://github.com/hero-m "hero-m (23 commits)")[![kgaut](https://avatars.githubusercontent.com/u/736910?v=4)](https://github.com/kgaut "kgaut (22 commits)")[![MPParsley](https://avatars.githubusercontent.com/u/1823998?v=4)](https://github.com/MPParsley "MPParsley (5 commits)")[![eiriksm](https://avatars.githubusercontent.com/u/865153?v=4)](https://github.com/eiriksm "eiriksm (4 commits)")[![wundo](https://avatars.githubusercontent.com/u/113942?v=4)](https://github.com/wundo "wundo (3 commits)")[![zlyware](https://avatars.githubusercontent.com/u/1180836?v=4)](https://github.com/zlyware "zlyware (2 commits)")[![rodrigoaguilera](https://avatars.githubusercontent.com/u/655187?v=4)](https://github.com/rodrigoaguilera "rodrigoaguilera (2 commits)")[![aries1980](https://avatars.githubusercontent.com/u/517870?v=4)](https://github.com/aries1980 "aries1980 (2 commits)")[![podarok](https://avatars.githubusercontent.com/u/563412?v=4)](https://github.com/podarok "podarok (1 commits)")[![zero2one](https://avatars.githubusercontent.com/u/133124?v=4)](https://github.com/zero2one "zero2one (1 commits)")[![SebCorbin](https://avatars.githubusercontent.com/u/645207?v=4)](https://github.com/SebCorbin "SebCorbin (1 commits)")[![csegarra](https://avatars.githubusercontent.com/u/8962726?v=4)](https://github.com/csegarra "csegarra (1 commits)")[![makara](https://avatars.githubusercontent.com/u/30970?v=4)](https://github.com/makara "makara (1 commits)")[![penyaskito](https://avatars.githubusercontent.com/u/516163?v=4)](https://github.com/penyaskito "penyaskito (1 commits)")

### Embed Badge

![Health badge](/badges/kgaut-potx/health.svg)

```
[![Health](https://phpackages.com/badges/kgaut-potx/health.svg)](https://phpackages.com/packages/kgaut-potx)
```

###  Alternatives

[symfony/translation

Provides tools to internationalize your application

6.6k836.5M2.1k](/packages/symfony-translation)[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

169661.4M4.8k](/packages/nesbot-carbon)[joedixon/laravel-translation

A tool for managing all of your Laravel translations

717911.4k11](/packages/joedixon-laravel-translation)[illuminate/translation

The Illuminate Translation package.

6936.4M495](/packages/illuminate-translation)[lajax/yii2-translate-manager

Translation management extension for Yii 2

227578.8k13](/packages/lajax-yii2-translate-manager)[larswiegers/laravel-translations-checker

Make sure your laravel translations are checked and are included in all languages.

256423.2k2](/packages/larswiegers-laravel-translations-checker)

PHPackages © 2026

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