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

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

koded/i18n
==========

Simple internationalization library with support for .po and .php translation files

0.9.2(2y ago)0208BSD-3-ClausePHPPHP ^8.1

Since Jan 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/kodedphp/i18n)[ Packagist](https://packagist.org/packages/koded/i18n)[ Docs](https://github.com/kodedphp/i18n/)[ RSS](/packages/koded-i18n/feed)WikiDiscussions master Synced today

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

Koded - i18n
============

[](#koded---i18n)

[![CI](https://github.com/kodedphp/i18n/actions/workflows/ci.yaml/badge.svg)](https://github.com/kodedphp/i18n/actions/workflows/ci.yaml)[![Latest Stable Version](https://camo.githubusercontent.com/0ed1c6f54ed4a3b753f2a3ccf0392077b777d8f98b810b799ad3e64f96b16760/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6f6465642f6931386e2e737667)](https://packagist.org/packages/koded/i18n)[![Minimum PHP Version: 8.1](https://camo.githubusercontent.com/183804d09fec16ca7b6209b007250b7d8db1b915042feb093a9f20e6e1f25359/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e312d3838393242462e737667)](https://php.net/)

A simple internationalization library with support for .po and .php translation files.

```
composer require koded/i18n

```

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

[](#requirements)

- intl
- gettext

Usage
-----

[](#usage)

```
__(string $message, array $arguments => [], string $locale = '');
```

Configuration
-------------

[](#configuration)

The `I18n` class is static and should be configured somewhere in the beginning of your PHP code/script.

```
use Koded\Stdlib\Config;
use Koded\I18n\{ArrayCatalog, DefaultFormatter, I18n, I18nCatalog};

// all conf directives are optional
$config = new Config([
    'translation.catalog' => ArrayCatalog::class,
    'translation.formatter' => DefaultFormatter::class,
    'translation.dir' => '/path/to/your/translation/files',
    'translation.locale' => ['mk_MK', 'de_DE', 'it_IT'],
]);

I18n::register(I18nCatalog::new($config));
```

Translation files
-----------------

[](#translation-files)

### .po files

[](#po-files)

`poedit` is a very good app to work with your translation files.

### .php files

[](#php-files)

The translation file has a simple structure

```
return [
    'language' => '',
    'messages' => [
        // your translation strings goes here
        'original string' => 'translated string',
    ]
];
```

where `messages` contains `key => value` pairs for the translated strings.

Code quality
------------

[](#code-quality)

[![Code Coverage](https://camo.githubusercontent.com/8f6b7c6fab2386b41b54be2cb64c2acc7836b5637f7a0e65482c8f9006da5324/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b6f6465647068702f6931386e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kodedphp/i18n/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a5b8d8b1951e242524c2e8c5ba6a94ba6afff4b471db2cd396c86c697031dd54/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b6f6465647068702f6931386e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kodedphp/i18n/?branch=master)

```
vendor/bin/phpunit
```

License
-------

[](#license)

[![Software license](https://camo.githubusercontent.com/b3775a2de17853a90995faa104f941eef3ad3c40cc89e34b8b1eaea014614d4e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d425344253230332d2d436c617573652d626c75652e737667)](LICENSE)

The code is distributed under the terms of [The 3-Clause BSD license](LICENSE).

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Total

5

Last Release

990d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/02c41fefd80a09d9f349706dbee9f45b9cfe539509881a05af4fa8d3517a878d?d=identicon)[kodeart](/maintainers/kodeart)

---

Top Contributors

[![kodeart](https://avatars.githubusercontent.com/u/202293?v=4)](https://github.com/kodeart "kodeart (51 commits)")

---

Tags

i18ntranslationpomultilanguage

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[gettext/gettext

PHP gettext manager

70232.6M118](/packages/gettext-gettext)[jms/translation-bundle

Puts the Symfony Translation Component on steroids

44311.1M75](/packages/jms-translation-bundle)[inpsyde/multilingual-press

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

2414.0k1](/packages/inpsyde-multilingual-press)[instaclick/translation-editor-bundle

Web editor UI to manage Symfony2 translations (Symfony2 bundle)

2019.5k](/packages/instaclick-translation-editor-bundle)

PHPackages © 2026

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