PHPackages                             10quality/gettext-wp-scanner - 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. 10quality/gettext-wp-scanner

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

10quality/gettext-wp-scanner
============================

WordPress scanner for gettext.

v1.0.2(2mo ago)15.5k↓33.3%1MITPHPCI passing

Since Feb 4Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/10quality/gettext-wp-scanner)[ Packagist](https://packagist.org/packages/10quality/gettext-wp-scanner)[ RSS](/packages/10quality-gettext-wp-scanner/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (6)Used By (1)

WordPress scanner for Gettext
=============================

[](#wordpress-scanner-for-gettext)

[![Packagist Version](https://camo.githubusercontent.com/9d2516855696d755ff88c741e81b467cff1eb5e622d4bfbc2a5c7913f5411831/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f31307175616c6974792f676574746578742d77702d7363616e6e6572)](https://camo.githubusercontent.com/9d2516855696d755ff88c741e81b467cff1eb5e622d4bfbc2a5c7913f5411831/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f31307175616c6974792f676574746578742d77702d7363616e6e6572)[![GitHub Workflow Status (with branch)](https://camo.githubusercontent.com/23119a5df0f310b1b3281b12d293dcc0576d07a236181fef04d8aac18b7c3765/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f31307175616c6974792f676574746578742d77702d7363616e6e65722f7068702e796d6c)](https://camo.githubusercontent.com/23119a5df0f310b1b3281b12d293dcc0576d07a236181fef04d8aac18b7c3765/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f31307175616c6974792f676574746578742d77702d7363616e6e65722f7068702e796d6c)[![GitHub](https://camo.githubusercontent.com/8f270922ec9af79f55e8cb065b3d5bcafb0df0975187a7a7cc9911dbcb37f8b9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f31307175616c6974792f676574746578742d77702d7363616e6e6572)](https://camo.githubusercontent.com/8f270922ec9af79f55e8cb065b3d5bcafb0df0975187a7a7cc9911dbcb37f8b9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f31307175616c6974792f676574746578742d77702d7363616e6e6572)

WordPress code scanner to use with [gettext/gettext](https://github.com/php-gettext/Gettext).

The scanner is a PHP based same as the **gettext** package.

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

[](#installation)

```
composer require 10quality/gettext-wp-scanner
```

PHP usage example
-----------------

[](#php-usage-example)

```
use Gettext\Translations;
use Gettext\Generator\PoGenerator;
use TenQuality\Gettext\Scanner\WPPhpScanner;

// Create a new scanner, adding the plugin / theme domain we want to get:
$phpScanner = new WPPhpScanner(
    Translations::create('my-domain')
);

// Scan PHP files
foreach (glob('*.php') as $file) {
    $phpScanner->scanFile($file);
}

//Save the translations in .po files
$generator = new PoGenerator();

foreach ($phpScanner->getTranslations() as $domain => $translations) {
    $generator->generateFile($translations, "locales/{$domain}.po");
}
```

JavaScript usage example
------------------------

[](#javascript-usage-example)

```
use Gettext\Translations;
use Gettext\Generator\PoGenerator;
use TenQuality\Gettext\Scanner\WPJsScanner;

// Create a new scanner, adding the plugin / theme domain we want to get:
$phpScanner = new WPJsScanner(
    Translations::create('my-domain')
);

// Scan PHP files
foreach (glob('*.js') as $file) {
    $phpScanner->scanFile($file);
}

//Save the translations in .po files
$generator = new PoGenerator();

foreach ($phpScanner->getTranslations() as $domain => $translations) {
    $generator->generateFile($translations, "locales/{$domain}.po");
}
```

Coverage
--------

[](#coverage)

**Languages**

- PHP
- JavaScript

**PHP functions**

- `__()`
- `_e()`
- `_n()`
- `_n_noop()`
- `_x()`
- `_nx()`
- `_nx_noop()`
- `esc_attr__()`
- `esc_attr_e()`
- `esc_attr_x()`
- `esc_html__()`
- `esc_html_e()`
- `esc_html_x()`

**JavaScript functions**

- `__()`
- `_x()`
- `_n()`
- `_nx()`

Requirements
------------

[](#requirements)

- [gettext/gettext](https://github.com/php-gettext/Gettext)
- PHP &gt;= 7.2.

License
-------

[](#license)

The MIT License (MIT). Please see `LICENSE` File for more information.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance86

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

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.

###  Release Activity

Cadence

Every ~562 days

Total

3

Last Release

74d ago

### Community

Maintainers

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

---

Top Contributors

[![amostajo](https://avatars.githubusercontent.com/u/1645908?v=4)](https://github.com/amostajo "amostajo (19 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/10quality-gettext-wp-scanner/health.svg)

```
[![Health](https://phpackages.com/badges/10quality-gettext-wp-scanner/health.svg)](https://phpackages.com/packages/10quality-gettext-wp-scanner)
```

###  Alternatives

[illuminate/translation

The Illuminate Translation package.

6936.4M495](/packages/illuminate-translation)[tio/laravel

Add this package to localize your Laravel application (PHP, JSON or GetText).

170318.5k](/packages/tio-laravel)[om/potrans

Command line tool for translate Gettext with Google Translator API or DeepL API

10515.0k4](/packages/om-potrans)[gettext/php-scanner

PHP scanner for gettext

15471.2k12](/packages/gettext-php-scanner)

PHPackages © 2026

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