PHPackages                             yoast/i18n-module - 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. yoast/i18n-module

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

yoast/i18n-module
=================

Handle i18n for WordPress plugins.

3.1.1(7y ago)221.2M↓37.6%2[5 issues](https://github.com/Yoast/i18n-module/issues)[1 PRs](https://github.com/Yoast/i18n-module/pulls)1GPL-2.0-or-laterPHPPHP &gt;=5.2

Since Apr 22Pushed 2y ago14 watchersCompare

[ Source](https://github.com/Yoast/i18n-module)[ Packagist](https://packagist.org/packages/yoast/i18n-module)[ Docs](https://github.com/Yoast/i18n-module)[ RSS](/packages/yoast-i18n-module/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (14)Used By (1)

[![CS](https://github.com/Yoast/i18n-module/actions/workflows/cs.yml/badge.svg)](https://github.com/Yoast/i18n-module/actions/workflows/cs.yml)[![Lint](https://github.com/Yoast/i18n-module/actions/workflows/lint.yml/badge.svg)](https://github.com/Yoast/i18n-module/actions/workflows/lint.yml)[![Code Climate](https://camo.githubusercontent.com/8d8f0bb3cf313a52b18ff72e210b9b8db61b2d9fb80b9d8f835adf91ca0db00a/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f596f6173742f6931386e2d6d6f64756c652f6261646765732f6770612e737667)](https://codeclimate.com/github/Yoast/i18n-module)

⚠️ Update September 28th 2023 ⚠️

We have discontinued development on this project. If you're interested in this module, we happily refer you to a well-maintained fork by [@mte90](https://github.com/WPBP/i18n-notice/commits?author=Mte90) at .

Yoast i18n module
=================

[](#yoast-i18n-module)

Promote your own translation site for people who are using your plugin in another language than `en_US`.

Example of the rendered promo box
---------------------------------

[](#example-of-the-rendered-promo-box)

[![Example promo box 1](https://cloud.githubusercontent.com/assets/5147598/17158139/66429a10-5394-11e6-8d6d-5da0e0a5b074.png)](https://cloud.githubusercontent.com/assets/5147598/17158139/66429a10-5394-11e6-8d6d-5da0e0a5b074.png)

[![Example promo box 2](https://cloud.githubusercontent.com/assets/5147598/17158143/6ed2f33c-5394-11e6-825b-a0fc04f2df83.png)](https://cloud.githubusercontent.com/assets/5147598/17158143/6ed2f33c-5394-11e6-825b-a0fc04f2df83.png)

The image, the name of your plugin and the name of your translation project are all configurable (see example below). The name of the language is retrieved from your GlotPress install, as is the percentage translated. The box doesn't display when a language has been translated for 90% or more.

How to use this module
----------------------

[](#how-to-use-this-module)

Include it in your project using composer:

```
composer require yoast/i18n-module
```

Alternatively you can include the library as a submodule. Make sure the class is loaded and instantiate it like this:

```
new Yoast_I18n_v3(
	array(
		'textdomain'     => '{your text domain}',
		'project_slug'   => '{your probject slug}',
		'plugin_name'    => '{your plugin name}',
		'hook'           => '{the hook to display the message box on}',
		'glotpress_url'  => '{url to your glotpress installation; http://translate.yoast.com}',
		'glotpress_name' => '{name of your glotpress installation}',
		'glotpress_logo' => '{url to a logo which will be shown}',
		'register_url '  => '{url to use when registering for a project}',
	)
);
```

If the service you are using doesn't follow the GlotPress conventions for the URLs, you may want to pass directly the full `api_url`to get the list of available translations, instead of letting the class build it from `glotpress_url`:

```
new Yoast_I18n_v3(
	array(
		'textdomain'     => '{your text domain}',
		'project_slug'   => '{your probject slug}',
		'plugin_name'    => '{your plugin name}',
		'hook'           => '{the hook to display the message box on}',
		'api_url'        => '{url the JSON list of the available languages}',
		'glotpress_name' => '{name of your glotpress installation}',
		'glotpress_logo' => '{url to a logo which will be shown}',
		'register_url '  => '{url to use when registering for a project}',
	)
);
```

Because translate.wordpress.org is also a GlotPress installation you can use the i18n-module to promote translation your plugin on there. To do this you can use the dedicated wordpress.org class:

```
new Yoast_I18n_WordPressOrg_v3(
	array(
		'textdomain'  => '{your text domain}',
		'plugin_name' => '{your plugin name}',
		'hook'        => '{hook to display the message box on}',
	)
);
```

### Customize where and when to render the message

[](#customize-where-and-when-to-render-the-message)

Since 3.0.0 you can also decide to render the message in a message-box of your own, just provide the second argument to the constructor as `false` to disable the showing of the box by the module itself.

```
$i18n_module = new Yoast_I18n_v3(
	array(
		'textdomain'     => '{your text domain}',
		'project_slug'   => '{your probject slug}',
		'plugin_name'    => '{your plugin name}',
		'hook'           => '{the hook to display the message on - not used in this example}',
		'glotpress_url'  => '{url to your glotpress installation; http://translate.yoast.com}',
		'glotpress_name' => '{name of your glotpress installation}',
		'glotpress_logo' => '{url to a logo which will be shown}',
		'register_url '  => '{url to use when registering for a project}',
	),
	false
);

$message = $i18n_module->get_promo_message();
```

```
$i18n_module = new Yoast_I18n_WordPressOrg_v3(
	array(
		'textdomain'  => '{your text domain}',
		'plugin_name' => '{your plugin name}',
		'hook'        => '{hook to display the message on - not used in this example}',
	),
	false
);

$message = $i18n_module->get_promo_message();
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~134 days

Recently: every ~153 days

Total

12

Last Release

2569d ago

Major Versions

1.2.1 → 2.0.02017-02-02

2.1.0-RC1 → 3.0.0-RC12017-08-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/6629c5cbca8a0a1133c6a3a9df23fe802036694d8d79b10b7606a4355e5cb6df?d=identicon)[YoastSystem](/maintainers/YoastSystem)

![](https://www.gravatar.com/avatar/802d833fa2bf883123eb3f8cb032848abf23ca6da4f0dbe867ebcd8448820679?d=identicon)[jdevalk](/maintainers/jdevalk)

---

Top Contributors

[![jrfnl](https://avatars.githubusercontent.com/u/663378?v=4)](https://github.com/jrfnl "jrfnl (73 commits)")[![moorscode](https://avatars.githubusercontent.com/u/2005352?v=4)](https://github.com/moorscode "moorscode (18 commits)")[![atimmer](https://avatars.githubusercontent.com/u/584693?v=4)](https://github.com/atimmer "atimmer (16 commits)")[![IreneStr](https://avatars.githubusercontent.com/u/17744553?v=4)](https://github.com/IreneStr "IreneStr (14 commits)")[![boblinthorst](https://avatars.githubusercontent.com/u/11849359?v=4)](https://github.com/boblinthorst "boblinthorst (13 commits)")[![omarreiss](https://avatars.githubusercontent.com/u/1488816?v=4)](https://github.com/omarreiss "omarreiss (4 commits)")[![Dieterrr](https://avatars.githubusercontent.com/u/16388834?v=4)](https://github.com/Dieterrr "Dieterrr (4 commits)")[![Rarst](https://avatars.githubusercontent.com/u/737584?v=4)](https://github.com/Rarst "Rarst (4 commits)")[![afercia](https://avatars.githubusercontent.com/u/1682452?v=4)](https://github.com/afercia "afercia (3 commits)")[![enricobattocchi](https://avatars.githubusercontent.com/u/15989132?v=4)](https://github.com/enricobattocchi "enricobattocchi (3 commits)")[![Mte90](https://avatars.githubusercontent.com/u/403283?v=4)](https://github.com/Mte90 "Mte90 (2 commits)")[![bintzandt](https://avatars.githubusercontent.com/u/8782235?v=4)](https://github.com/bintzandt "bintzandt (2 commits)")[![maartenleenders](https://avatars.githubusercontent.com/u/26220788?v=4)](https://github.com/maartenleenders "maartenleenders (1 commits)")[![rensw90](https://avatars.githubusercontent.com/u/7293908?v=4)](https://github.com/rensw90 "rensw90 (1 commits)")[![terw-dan](https://avatars.githubusercontent.com/u/11272096?v=4)](https://github.com/terw-dan "terw-dan (1 commits)")[![diedexx](https://avatars.githubusercontent.com/u/5352634?v=4)](https://github.com/diedexx "diedexx (1 commits)")[![noud-github](https://avatars.githubusercontent.com/u/39429596?v=4)](https://github.com/noud-github "noud-github (1 commits)")

---

Tags

wordpress

### Embed Badge

![Health badge](/badges/yoast-i18n-module/health.svg)

```
[![Health](https://phpackages.com/badges/yoast-i18n-module/health.svg)](https://phpackages.com/packages/yoast-i18n-module)
```

###  Alternatives

[qtranslate/qtranslate-xt

qTranslate-XT (eXTended): Adds user-friendly multilingual content support, stored in single post.

59935.5k](/packages/qtranslate-qtranslate-xt)[grappler/polylang-slug

Allows same slug for multiple languages in Polylang

29511.8k](/packages/grappler-polylang-slug)[wearerequired/traduttore

WordPress.org-style translation API for your WordPress projects.

7910.3k](/packages/wearerequired-traduttore)[wearerequired/traduttore-registry

Allows loading translation files from a custom GlotPress site running Traduttore

1566.7k6](/packages/wearerequired-traduttore-registry)[wcm/wcm-lang-switch

Adds a button to the admin toolbar. This buttons allows users to seamlessly switch between available languages..

212.0k](/packages/wcm-wcm-lang-switch)[afragen/translations-updater

This framework provides automatic decoupled languate pack updates from a public repository for your WordPress plugin or theme.

211.8k](/packages/afragen-translations-updater)

PHPackages © 2026

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