PHPackages                             afragen/language-pack-maker - 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. afragen/language-pack-maker

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

afragen/language-pack-maker
===========================

Library that helps create git sourced WordPress Language Packs from po files.

12963PHP

Since Nov 11Pushed 1y ago2 watchersCompare

[ Source](https://github.com/afragen/language-pack-maker)[ Packagist](https://packagist.org/packages/afragen/language-pack-maker)[ RSS](/packages/afragen-language-pack-maker/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Language Pack Maker
===================

[](#language-pack-maker)

Requires PHP 7.0 or higher.

Uses `class Language_Pack_Maker` installed via composer into your local translation repository to create a directory of zip archives of translation .mo/.po/.json files and a `language-pack.json` file containing data to pass to [Git Updater](https://github.com/afragen/git-updater) or [Translations Updater library](https://github.com/afragen/translations-updater).

Install the package via composer.

Run the composer command: `composer require afragen/language-pack-maker:dev-master`

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

[](#requirements)

This library requires all .po files to be in a `/languages` directory located in the repository root.

- It will copy all .po files from `/languages` to a temporary directory.
- It will create .mo files from the .po files.
- It will create .l10n.php files from the .po files.
- It will create .json translation files for your javascript.
- It will create zipfiles in a `/packages` directory in the repository root.
- It will create a `language-pack.json` file in the repository root.
- It will cleanup/remove the temporary directory when finished.

The format of the generated JSON file is as follows.

```
[
  {
    "{language}": [
      {
        "type": "{plugin|theme} from GitHub Updater",
        "slug": "{$slug}",
        "language": "en_US",
        "version": "from GitHub Updater",
        "updated": "PO-Revision-Date from .po file header",
        "package": "/packages/github-updater-en_US.zip",
        "autoupdate": "1"
      }
    ]
  }
]
```

The update transient expects the `$transient->translations` in the following format.

```
$transient->translations( array(
	0 => array(
		'type'       => 'plugin',
		'slug'       => 'akismet',
		'language'   => 'de_CH',
		'version'    => '3.1.11',
		'updated'    => '2016-05-12 18:04:38',
		'package'    => 'https://downloads.wordpress.org/translation/plugin/akismet/3.1.11/de_CH.zip',
		'autoupdate' => 1,

	),
) );
```

[Git Updater](https://github.com/afragen/git-updater) or the [Translations Updater library](https://github.com/afragen/translations-updater) will merge the correlative plugin or theme data with the data retrieved from the `language-pack.json` to add data to the update transient. Language updates will appear in the WordPress dashboard.

To utilize the Language Pack Creator, you will need to open and run `http://localhost//vendor/autoload.php` in localhost. This will create the necessary .mo, .l10n.php, .json, zipfiles, and `language-pack.json`.

With the following added to your `composer.json` file, it will run the sequence described above on `composer make-language-packs`.

```
  "scripts": {
    "make-language-packs": [
      "php ./vendor/autoload.php"
    ]
  }

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 Bus Factor1

Top contributor holds 95.6% 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/82779a185fccde41e1dd3b914bde84cd6be76c8dcb8f6b983f461c8f5687a87e?d=identicon)[afragen](/maintainers/afragen)

---

Top Contributors

[![afragen](https://avatars.githubusercontent.com/u/1296790?v=4)](https://github.com/afragen "afragen (86 commits)")[![ahmader](https://avatars.githubusercontent.com/u/2225278?v=4)](https://github.com/ahmader "ahmader (4 commits)")

### Embed Badge

![Health badge](/badges/afragen-language-pack-maker/health.svg)

```
[![Health](https://phpackages.com/badges/afragen-language-pack-maker/health.svg)](https://phpackages.com/packages/afragen-language-pack-maker)
```

###  Alternatives

[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1926.6k1](/packages/smmoosavi-php-gettext)[laradevs/spanish

labels translated to spanish

166.7k](/packages/laradevs-spanish)

PHPackages © 2026

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