PHPackages                             robotdance/php-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. robotdance/php-i18n

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

robotdance/php-i18n
===================

Simple I18N library for PHP

v0.0.8(10y ago)02541MITPHPPHP &gt;=5.3.2

Since Jun 1Pushed 10y ago1 watchersCompare

[ Source](https://github.com/robotdance/php-i18n)[ Packagist](https://packagist.org/packages/robotdance/php-i18n)[ RSS](/packages/robotdance-php-i18n/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (8)Dependencies (6)Versions (9)Used By (1)

PHP-I18n
========

[](#php-i18n)

[![Code Climate](https://camo.githubusercontent.com/d16130e1f7c6dbc2223ff7d14b0583146ff9bad9444f70ad7ad162dde0a13848/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f726f626f7464616e63652f7068702d6931386e2f6261646765732f6770612e737667)](https://codeclimate.com/github/robotdance/php-i18n)[![Test Coverage](https://camo.githubusercontent.com/bf1d0c0ba23d0b2d36ef7a7eba1834d8becd5341fec4a482f1fc8e68df61e561/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f726f626f7464616e63652f7068702d6931386e2f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/robotdance/php-i18n/coverage)[![Issue Count](https://camo.githubusercontent.com/3015d003f869a4247b45d3f5a196d3e17459f3a6449a679a8992abe6278cc69a/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f726f626f7464616e63652f7068702d6931386e2f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/robotdance/php-i18n)[![Build Status](https://camo.githubusercontent.com/0b9ed338b3f943908994cad2bd72edd41334b4702cf74aca094227ced62aed23/68747470733a2f2f7472617669732d63692e6f72672f726f626f7464616e63652f7068702d6931386e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/robotdance/php-i18n)

PHP-I18n is a simple I18N and L10n library.

Setup
-----

[](#setup)

PHP-I18n uses [Composer](http://getcomposer.org) as dependency management tool.

`$ composer install`

Use
---

[](#use)

Create a folder called `config/locales` at your app/module, and put your locale YAML files there. (an example of valid YAML file can found in the source). Then call `I18n::t`, in one of the ways below.

### Simple key/value lookup

[](#simple-keyvalue-lookup)

```
$translated = I18n::t('example_message');
```

### Locale override

[](#locale-override)

```
$translated = I18n::t('example_message', [], 'pt_BR');
```

### Injecting arguments

[](#injecting-arguments)

```
$translated = I18n::t('hello_message', ['user' => 'Bob']); // 'Hello Bob'
```

**Note about formatting** currently the library does not apply formatting to arguments.

### Localisation

[](#localisation)

Create a section 'l10n' on your locale file and follow the source standards.

```
$value = I18n::l(true);    // 'verdadeiro'
$value = I18n::l(123.45); // '123,45'

```

Running tests
-------------

[](#running-tests)

`$ ./bin/phpunit`

Contribute
----------

[](#contribute)

Fork, write tests, code, submit pull request. Coverage must remains at 100%.

References
----------

[](#references)

[PHP the right way](http://www.phptherightway.com)[Fixing PHP errors automatically](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically)[PHP SPL Exceptions](http://www.php.net/manual/en/spl.exceptions.php)[What exception subclasses are buit in](http://stackoverflow.com/questions/10838257/what-exception-subclasses-are-built-into-php)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 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

Every ~3 days

Total

8

Last Release

3654d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1504086?v=4)[Marcos Menegazzo](/maintainers/MarcosMenegazzo)[@MarcosMenegazzo](https://github.com/MarcosMenegazzo)

---

Top Contributors

[![MarcosMenegazzo](https://avatars.githubusercontent.com/u/1504086?v=4)](https://github.com/MarcosMenegazzo "MarcosMenegazzo (15 commits)")

---

Tags

phpi18nlibrary

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/robotdance-php-i18n/health.svg)

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

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[gettext/php-scanner

PHP scanner for gettext

15504.3k15](/packages/gettext-php-scanner)[jayesh/laravel-gemini-translator

An interactive command to extract and generate Laravel translations using Gemini AI.

702.2k1](/packages/jayesh-laravel-gemini-translator)[o80/i18n

Easy library to manage i18n with PHP.

1031.5k](/packages/o80-i18n)

PHPackages © 2026

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