PHPackages                             transitive/translate - 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. transitive/translate

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

transitive/translate
====================

Translations…

016

Since May 20Compare

[ Source](https://github.com/RobinDumontChaponet/TransitiveTranslate)[ Packagist](https://packagist.org/packages/transitive/translate)[ RSS](/packages/transitive-translate/feed)WikiDiscussions Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Transitive\\Translate
=====================

[](#transitivetranslate)

Translation layer for the Transitive MVP stack… or not.

This package keeps natural source strings in application code and delegates catalogue lookup to interchangeable backends.

What is included
----------------

[](#what-is-included)

- `Transitive\Translate\Translator`: public translation API, locale fallback, domains, contexts, replacements, ICU formatting, `__invoke`, and `ArrayAccess`.
- `Transitive\Translate\TranslationBackend`: lookup contract implemented by all storage backends.
- `Transitive\Translate\PhpArrayBackend`: loads external PHP catalogue files.
- `Transitive\Translate\ResourceBundleBackend`: loads ICU resource bundles from external locale directories.
- `Transitive\Translate\GettextBackend`: reads `.mo` files directly without relying on gettext process globals.

Installation
------------

[](#installation)

```
composer require transitive/translate
```

PHP `8.1+` and `ext-intl` are required.

Basic usage
-----------

[](#basic-usage)

```
