PHPackages                             titon/g11n - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. titon/g11n

AbandonedLibrary[Queues &amp; Workers](/categories/queues)

titon/g11n
==========

The Titon g11n package handles the localization and internationalization of your application.

0.11.4(12y ago)31071BSD-2PHPPHP &gt;=5.4.0

Since Jan 8Pushed 12y ago1 watchersCompare

[ Source](https://github.com/titon/g11n)[ Packagist](https://packagist.org/packages/titon/g11n)[ Docs](http://titon.io)[ RSS](/packages/titon-g11n/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (32)Used By (1)

G11n v0.11.4 [![Build Status](https://camo.githubusercontent.com/56b46155a03cc576e1c8a41598362db4892b494c7c14bbee602261cd4d26a158/68747470733a2f2f7472617669732d63692e6f72672f7469746f6e2f6731316e2e706e67)](https://travis-ci.org/titon/g11n)
==============================================================================================================================================================================================================================================

[](#g11n-v0114-)

Handles the localization (l10n) and internationalization (i18n) of your application, also known as globalization (g11n). The g11n package provides a robust and extensible way to localize messages, provide locale aware patterns and rules, translate strings, and much more.

The `G11n` class manages locales, translators, and the initialization via HTTP accept headers.

```
use Titon\G11n\Locale;

$g11n = Titon\G11n\G11n:registry();
$g11n->addLocale(new Locale('en'));
$g11n->addLocale(new Locale('fr'));
$g11n->setFallback('en');
$g11n->setTranslator(new Titon\G11n\Translator\MessageTranslator())
    ->setReader(new Titon\Io\Reader\PhpReader())
    ->setStorage(new Titon\Cache\Storage\MemcacheStorage());
$g11n->initialize();
```

If the route package is used in combination with the g11n package, automatic route resolving and URL locale prefixing can be achieved. The g11n `LocaleRoute` should also be used in place of the default `Route`.

```
$router->on('g11n', $g11n);
```

Fetching and translating strings is as easy as calling a single function. Of course the messages will have to exist in the resource lookup path.

```
$message = $g11n->translate('domain.catalog.id');
// or
$message = msg('domain.catalog.id');
// or
$message = __('id', 'catalog', 'domain');
```

### Features

[](#features)

- `G11n` - L10n and I18n management
- `Locale` - Locale configuration
- `Translator` - Message bundle parsing
- `Utility` - Extends Inflector, Format, Number and Validator
- `Route` - Locale aware routing

### Dependencies

[](#dependencies)

- `Common`
- `Event`
- `IO`
- `Cache` (optional for Translator)

### Requirements

[](#requirements)

- PHP 5.4.0
    - Intl
    - Multibyte
    - Gettext (for GettextTranslator)

### To Do

[](#to-do)

- Test gettext functionality
- Implement TranslatableBehavior

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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

Total

31

Last Release

4474d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7fde949ba5bf8f6af95b77cf88fe1362c4cc7519edbcd4f8891f1564da621fdb?d=identicon)[milesj](/maintainers/milesj)

---

Top Contributors

[![milesj](https://avatars.githubusercontent.com/u/143744?v=4)](https://github.com/milesj "milesj (85 commits)")

---

Tags

messageintli18nl10ntranslatelocaleg11ntiton

### Embed Badge

![Health badge](/badges/titon-g11n/health.svg)

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

###  Alternatives

[symfony/intl

Provides access to the localization data of the ICU library

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

Aplus Framework Language Library

2351.7M15](/packages/aplus-language)[aura/intl

The Aura Intl package provides internationalization tools, specifically message translation.

898.3M4](/packages/aura-intl)[gettext/languages

gettext languages with plural rules

7530.3M11](/packages/gettext-languages)[punic/punic

PHP-Unicode CLDR

1542.9M29](/packages/punic-punic)[skillshare/formatphp

Internationalize PHP apps. This library provides an API to format dates, numbers, and strings, including pluralization and handling translations.

8029.6k](/packages/skillshare-formatphp)

PHPackages © 2026

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