PHPackages                             wpbp/i18n-notice - 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. wpbp/i18n-notice

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

wpbp/i18n-notice
================

Handle i18n for plugins, based on Yoast i18n-module

33.7kPHP

Since Jan 18Pushed 3y agoCompare

[ Source](https://github.com/WPBP/i18n-notice)[ Packagist](https://packagist.org/packages/wpbp/i18n-notice)[ RSS](/packages/wpbp-i18n-notice/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

i18n notice
===========

[](#i18n-notice)

This repository is a [fork of the original library](https://github.com/Yoast/i18n-module) that is deprecated by Yoast. Just changed the classes name and internal references to Yoast, so to migrate it is just enough to update your `composer.json` and classes in your PHP code.

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 wpbp/i18n-notice
```

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

```
new I18n_Notice(
	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 I18n_Notice(
	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 I18n_Notice_WordPressOrg(
	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 I18n_Notice(
	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 I18n_Notice_WordPressOrg(
	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

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/403283?v=4)[Daniele Scasciafratte](/maintainers/Mte90)[@Mte90](https://github.com/Mte90)

---

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)")[![Rarst](https://avatars.githubusercontent.com/u/737584?v=4)](https://github.com/Rarst "Rarst (4 commits)")[![Mte90](https://avatars.githubusercontent.com/u/403283?v=4)](https://github.com/Mte90 "Mte90 (4 commits)")[![Dieterrr](https://avatars.githubusercontent.com/u/16388834?v=4)](https://github.com/Dieterrr "Dieterrr (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)")[![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)")[![diedexx](https://avatars.githubusercontent.com/u/5352634?v=4)](https://github.com/diedexx "diedexx (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)")

### Embed Badge

![Health badge](/badges/wpbp-i18n-notice/health.svg)

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

###  Alternatives

[php-translation/translator

Translator services

25224.8k5](/packages/php-translation-translator)[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)
