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

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

ride/lib-i18n
=============

Internationalization library of the Ride framework

1.1.0(1y ago)15.1k1[1 PRs](https://github.com/all-ride/ride-lib-i18n/pulls)20MITPHP

Since Nov 29Pushed 1y ago7 watchersCompare

[ Source](https://github.com/all-ride/ride-lib-i18n)[ Packagist](https://packagist.org/packages/ride/lib-i18n)[ RSS](/packages/ride-lib-i18n/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (11)Used By (20)

Ride: I18n Library
==================

[](#ride-i18n-library)

Internationalization library of the PHP Ride framework.

What's In This Library
----------------------

[](#whats-in-this-library)

### Locale

[](#locale)

A *Locale* is the interface for a locale definition. This is a simple representation with a name, code and extra properties.

These locales are contained in a *LocaleManager* instance. This manager controls the current and default locale.

A *LocaleIO* feeds the *LocaleManager* with locales. The locales should be sorted in the order of importance for the system. The first locale is considered the default locale.

### Negotiator

[](#negotiator)

A *Negotiator* is used to detect the current locale. It's invoked when the current locale is not set.

You can use the *ChainedNegotiator* to implement multiple detection mechanisms in a chain.

### Translator

[](#translator)

A *Translator* is the interface to translate keys into a localized string. The interface supports a difference between singular and plural forms of a translation key.

The translators are managed by a *TranslatorManager*. *Translator* instances can be requested with the *Locale* instance.

### I18n

[](#i18n)

The I18n class glues the different parts together into an easy facade.

Code Sample
-----------

[](#code-sample)

Check this code sample to see the possibilities of this library:

```
