PHPackages                             gettext/js-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. gettext/js-scanner

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

gettext/js-scanner
==================

Javascript scanner for gettext

v1.1.3(4mo ago)7104.1k↓46.8%2[1 issues](https://github.com/php-gettext/JS-Scanner/issues)3MITPHPPHP ^7.2|^8.0CI failing

Since Nov 4Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/php-gettext/JS-Scanner)[ Packagist](https://packagist.org/packages/gettext/js-scanner)[ Docs](https://github.com/php-gettext/JS-Scanner)[ RSS](/packages/gettext-js-scanner/feed)WikiDiscussions master Synced 2d ago

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

JS Scanner
==========

[](#js-scanner)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bce144c565b26f7c927c99b4b8f31380d7e5a1c892afe40479debb14ddf2ee82/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676574746578742f6a732d7363616e6e65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gettext/js-scanner)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://github.com/php-gettext/PHP-Scanner/workflows/testing/badge.svg)](https://github.com/php-gettext/PHP-Scanner/workflows/testing/badge.svg)[![Quality Score](https://camo.githubusercontent.com/ccb1ffadb2ee0a90bf5003cf3f9b25d716a5e739f4699b0e25bcc77a61777335/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7068702d676574746578742f4a532d5363616e6e65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/php-gettext/JS-Scanner)[![Total Downloads](https://camo.githubusercontent.com/32ea6e602abccb3ed7eb6731dfad965f4977c10eb181fbfc7eafb392d493ebc6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676574746578742f6a732d7363616e6e65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gettext/js-scanner)

Created by Oscar Otero   (MIT License)

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

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

[](#installation)

```
composer require gettext/js-scanner

```

Usage example
-------------

[](#usage-example)

```
use Gettext\Scanner\JsScanner;
use Gettext\Generator\PoGenerator;
use Gettext\Translations;

//Create a new scanner, adding a translation for each domain we want to get:
$jsScanner = new JsScanner(
    Translations::create('domain1'),
    Translations::create('domain2'),
    Translations::create('domain3')
);

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

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

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

---

Please see [CHANGELOG](CHANGELOG.md) for more information about recent changes and [CONTRIBUTING](CONTRIBUTING.md) for contributing details.

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance71

Regular maintenance activity

Popularity38

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% 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 ~571 days

Total

5

Last Release

147d ago

PHP version history (2 changes)v1.0.0PHP ^7.2

v1.1.1PHP ^7.2|^8.0

### Community

Maintainers

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

---

Top Contributors

[![oscarotero](https://avatars.githubusercontent.com/u/377873?v=4)](https://github.com/oscarotero "oscarotero (8 commits)")[![EmTeedee](https://avatars.githubusercontent.com/u/195600?v=4)](https://github.com/EmTeedee "EmTeedee (6 commits)")

---

Tags

code-scanninggettexti18ntranslationi18njavascripttranslationgettextscanner

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gettext-js-scanner/health.svg)

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

###  Alternatives

[gettext/gettext

PHP gettext manager

70232.6M118](/packages/gettext-gettext)[gettext/php-scanner

PHP scanner for gettext

15535.6k16](/packages/gettext-php-scanner)[om/potrans

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

10520.2k9](/packages/om-potrans)[tio/laravel

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

170341.2k](/packages/tio-laravel)[fisharebest/localization

A lightweight localization database and translation tools, with data from the CLDR, IANA, ISO, etc.

29109.6k3](/packages/fisharebest-localization)[leaseweb/gettext-translation-bundle

Easy to use and native (faster) gettext translation support

2460.8k](/packages/leaseweb-gettext-translation-bundle)

PHPackages © 2026

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