PHPackages                             andres-ml/cakephp-i18n - 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. andres-ml/cakephp-i18n

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

andres-ml/cakephp-i18n
======================

I18n plugin for CakePHP

2.0.1(3mo ago)12.4k—6.3%1PHPPHP &gt;=7.2

Since Jan 10Pushed 3mo agoCompare

[ Source](https://github.com/andres-ml/cakephp-i18n)[ Packagist](https://packagist.org/packages/andres-ml/cakephp-i18n)[ Docs](https://github.com/andres-ml/cakephp-i18n)[ RSS](/packages/andres-ml-cakephp-i18n/feed)WikiDiscussions master Synced 1mo ago

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

I18n plugin for CakePHP
=======================

[](#i18n-plugin-for-cakephp)

Allows setting a default domain for translations.

Before:

```
__('members'); // outputs members
__d('hospitals', 'members'); // outputs patients
```

```
__n('Record', 'Records', 2); // outputs Record or Records
__dn('hospitals', 'Record', 'Records', 2); // outputs Visit or Visits
```

```
__x('written communication', 'He read the first letter'); // Adds additional context for use during translation
__dx('hospitals', 'eye chart viewing', 'He read the first letter'); // Adds additional context for use during translation
```

```
__xn('character', 'Spy', 'Spies', 2); // Adds additional context for use during translation
__dxn('hospitals', 'to see', 'Spy', 'Spies', 2); // Adds additional context for use during translation
```

With plugin:

```
use Aml\I18n\I18n;

__('members');                      // outputs members
__t('members');                     // outputs members
__n('Record', 'Records', 2);        // outputs Records
__tn('Record', 'Records', 1);       // outputs Record

I18n::domain('hospitals');
__('members');                      // still outputs members
__t('members');                     // outputs patients
__n('Record', 'Records', 2);        // outputs Visits
__tn('Record', 'Records', 1);       // outputs Visit
```

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

```
composer require andres-ml/cakephp-i18n

```

Usage
-----

[](#usage)

Automatically load the plugin by running `bin/cake plugin load Aml/I18n`

Manually load the plugin in `src/Application.php` `bootstrap()` function by adding the following line

```
$this->addPlugin('Aml/I18n');
```

Wherever you would use [`__()`](https://book.cakephp.org/4.0/en/core-libraries/global-constants-and-functions.html#__), you can now use `__t()`.

Wherever you would use [`__n()`](https://book.cakephp.org/4.0/en/core-libraries/global-constants-and-functions.html#__n), you can now use `__tn()`.

Wherever you would use [`__x()`](https://book.cakephp.org/4.0/en/core-libraries/global-constants-and-functions.html#__x), you can now use `__tx()`.

Wherever you would use [`__xn()`](https://book.cakephp.org/4.0/en/core-libraries/global-constants-and-functions.html#__xn), you can now use `__txn()`.

Remember to create a *domain*.po file next to each default.po file for each domain you want to support. ()

To automatically generate the default.pot base file:

```
bin/cake aml/I18n.i18n extract

```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance78

Regular maintenance activity

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~788 days

Total

4

Last Release

117d ago

Major Versions

1.2 → 2.02024-08-22

PHP version history (2 changes)v1.1PHP &gt;=5.4.16

1.2PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/485d3a19a3843896470f8d9d516c6b4af2d50a8d19b7dd5d4e197358304a55ae?d=identicon)[andres-ml](/maintainers/andres-ml)

---

Top Contributors

[![andres-ml](https://avatars.githubusercontent.com/u/21081145?v=4)](https://github.com/andres-ml "andres-ml (8 commits)")[![challgren](https://avatars.githubusercontent.com/u/88909?v=4)](https://github.com/challgren "challgren (4 commits)")

---

Tags

i18ncakephp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/andres-ml-cakephp-i18n/health.svg)

```
[![Health](https://phpackages.com/badges/andres-ml-cakephp-i18n/health.svg)](https://phpackages.com/packages/andres-ml-cakephp-i18n)
```

###  Alternatives

[symfony/string

Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way

1.8k724.1M825](/packages/symfony-string)[symfony/intl

Provides access to the localization data of the ICU library

2.6k199.8M1.1k](/packages/symfony-intl)[gettext/gettext

PHP gettext manager

70530.2M101](/packages/gettext-gettext)[gettext/languages

gettext languages with plural rules

7530.3M10](/packages/gettext-languages)[inpsyde/multilingual-press

Simply THE multisite-based free open source plugin for your multilingual websites.

2414.0k1](/packages/inpsyde-multilingual-press)[dereuromark/cakephp-translate

A CakePHP plugin for managing translations

1710.4k](/packages/dereuromark-cakephp-translate)

PHPackages © 2026

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