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

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

biniweb/i18n
============

Simple Component for internationalizing

029PHP

Since Mar 31Pushed 12y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

PHP i18n
========

[](#php-i18n)

Simple PHP i18n

Some of its features:

- Translations in ini-files
- Return array of translation (suitable also for Mustache engine template)

Setup
-----

[](#setup)

To use the i18n class, look at the test/example.php or test/example\_mustache.php and test/example\_mustache.html. You will find there a simple tutorial for this class in the file. Otherwise follow these easy five steps:

### 1. Create language files

[](#1-create-language-files)

To use this class, you have to use ini files for the translated strings. This could look like this:

`en.ini` (English)

```
greeting = "Hello World!"

[category]
somethingother = "Something other..."
```

`de.ini` (German)

```
greeting = "Hallo Welt!"

[category]
somethingother = "Etwas anderes..."
```

### 2. Initialize the class

[](#2-initialize-the-class)

`example.php`

```
$data = [
    'file_path' => 'languages/{LANGUAGE}.ini',
];
$configVo = new \Biniweb\I18n\Vo\I18nConfigVo($data);

$l = \Biniweb\I18n\I18n::getInstance()->init($configVo);
```

### 3. Use the localizations

[](#3-use-the-localizations)

`example.php`

```
A greeting:
Something other:
```

Mustache
--------

[](#mustache)

### 2. Initialize the class with Mustache

[](#2-initialize-the-class-with-mustache)

`example_mustache.php`

```
$data = [
    'file_path' => 'languages/{LANGUAGE}.ini',
];
$configVo = new \Biniweb\I18n\Vo\I18nConfigVo($data);

$l = \Biniweb\I18n\I18n::getInstance()->init($configVo);

$content = join('', file('example_mustache.html'));

$engine = new Mustache_Engine();

echo $engine->render($content, [
    'l' => $l,
]);
```

### 3. html template

[](#3-html-template)

`example_mustache.html`

```
A greeting: {{#l}} {{greeting}} {{/l}}
Something other: {{#l}} {{category_somethingother}} {{/l}}
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/142618085?v=4)[biniweb](/maintainers/biniweb)[@biniweb](https://github.com/biniweb)

---

Top Contributors

[![maniscalcogiuseppe82](https://avatars.githubusercontent.com/u/203675849?v=4)](https://github.com/maniscalcogiuseppe82 "maniscalcogiuseppe82 (30 commits)")[![Philipp15b](https://avatars.githubusercontent.com/u/425358?v=4)](https://github.com/Philipp15b "Philipp15b (23 commits)")[![eduardo-marcolino](https://avatars.githubusercontent.com/u/808889?v=4)](https://github.com/eduardo-marcolino "eduardo-marcolino (1 commits)")

### Embed Badge

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

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

###  Alternatives

[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)
