PHPackages                             lloc/composer-i18n-scripts - 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. lloc/composer-i18n-scripts

ActiveComposer-plugin[Localization &amp; i18n](/categories/localization)

lloc/composer-i18n-scripts
==========================

Simplify the internationalization of your WordPress plugin or theme using WP-CLI — powered by Composer.

1.0.0(8mo ago)1406GPL-2.0-or-laterPHP

Since Oct 22Pushed 8mo agoCompare

[ Source](https://github.com/lloc/composer-i18n-scripts)[ Packagist](https://packagist.org/packages/lloc/composer-i18n-scripts)[ RSS](/packages/lloc-composer-i18n-scripts/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Composer i18n Scripts
=====================

[](#composer-i18n-scripts)

Automate the internationalization workflow of your WordPress plugin or theme by wiring WP-CLI translation tools into familiar Composer commands.

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

[](#requirements)

- PHP 7.4+ and Composer 2.6+ (Composer plugin API 2.6 is required)
- WP-CLI 2.12+ available on your `$PATH`
- A WordPress plugin or theme with `Text Domain` and `Domain Path` headers defined

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

[](#installation)

```
composer require --dev lloc/composer-i18n-scripts
```

Composer automatically registers the plugin; no manual bootstrap code is needed. Running `composer install` on the project will keep the plugin active for all contributors.

Configuration
-------------

[](#configuration)

The plugin inspects your project root to infer settings:

- Themes: reads `style.css`
- Plugins: reads the main plugin file (matching the directory name or `index.php`)

Provide headers like the following so WP-CLI receives the right text domain and language directory:

```
/*
Plugin Name: Sample Plugin
Text Domain: sample-plugin
Domain Path: /languages
*/
```

If no metadata is found, defaults are `Text Domain: messages` and `Domain Path: /languages`.

Usage
-----

[](#usage)

Run the commands from the WordPress project root so that `wp` can load your environment.

CommandPurpose`composer i18n:make-pot`Scan the source directory and generate `languages/.pot`.`composer i18n:create-po `Copy the `.pot` file to a locale-specific `.po` file (e.g. `de_DE`).`composer i18n:update-po`Merge the current `.pot` changes into every `.po` in `languages/`.`composer i18n:make-mo`Compile all `.po` files into `.mo` binaries.`composer i18n:make-php`Export `.po` translations into PHP array files for performance-sensitive setups.`composer i18n:make-json`Build JavaScript translation catalogs (`*.json`) without purging existing assets.Example workflow:

```
composer i18n:make-pot
composer i18n:update-po
composer i18n:make-json
composer i18n:make-mo
```

Development
-----------

[](#development)

- `composer install` – install dependencies and register the plugin
- `composer qa` – PHPCS (WordPress Coding Standards) + PHPStan level 10
- `composer tests` – run PHPUnit suite under `tests/Commands`
- `composer tests:coverage` – generate HTML coverage in `tests/coverage/`
- `composer cs:fix` – automatically fix style violations

Refer to `AGENTS.md` for contributor conventions, coding standards, and pull request expectations.

Troubleshooting
---------------

[](#troubleshooting)

- **“Text domain is not set”**: ensure your plugin/theme headers declare `Text Domain` and `Domain Path`.
- **WP-CLI not found**: verify `wp` is installed globally or provide an absolute path (e.g. symlink `wp` into `/usr/local/bin`).
- **Translations not picking up new strings**: rerun `composer i18n:make-pot` before updating `.po` files so the template is up to date.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance60

Regular maintenance activity

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

254d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/64e0feadff7575b1389b5460ceec275d1de1eb16dcc1648e35f5779453de72e0?d=identicon)[realloc](/maintainers/realloc)

---

Top Contributors

[![lloc](https://avatars.githubusercontent.com/u/1012205?v=4)](https://github.com/lloc "lloc (14 commits)")

---

Tags

hacktoberfesti18nwordpresswordpress-developmentwordpress-pluginswordpress-theme

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lloc-composer-i18n-scripts/health.svg)

```
[![Health](https://phpackages.com/badges/lloc-composer-i18n-scripts/health.svg)](https://phpackages.com/packages/lloc-composer-i18n-scripts)
```

###  Alternatives

[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k16.7M1.0k](/packages/phpro-grumphp)[symfony/runtime

Enables decoupling PHP applications from global state

74798.8M1.0k](/packages/symfony-runtime)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5344.1M564](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2124.7M203](/packages/drupal-core-project-message)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)[sandersander/composer-link

Adds ability to link local packages for development with composer

98457.9k](/packages/sandersander-composer-link)

PHPackages © 2026

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