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

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

phpnomad/translate
==================

2.0.2(3w ago)03.9k[1 PRs](https://github.com/phpnomad/translate/pulls)4MITPHPCI passing

Since Jan 18Pushed 3w ago2 watchersCompare

[ Source](https://github.com/phpnomad/translate)[ Packagist](https://packagist.org/packages/phpnomad/translate)[ Docs](https://github.com/phpnomad/core)[ RSS](/packages/phpnomad-translate/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (7)Versions (10)Used By (4)

phpnomad/translate
==================

[](#phpnomadtranslate)

[![Latest Version](https://camo.githubusercontent.com/f31470f15953526101363659b3702f50522c86822c025ae1f2d17af2680bc249/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f7472616e736c6174652e737667)](https://packagist.org/packages/phpnomad/translate)[![Total Downloads](https://camo.githubusercontent.com/f2cd892091256ca05603d84152278d59977de1668704d84f2985331ae2519e3d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f7472616e736c6174652e737667)](https://packagist.org/packages/phpnomad/translate)[![PHP Version](https://camo.githubusercontent.com/fe3a180014444ebb544ecb2583a0bab1250559d8ecf16a060f4cd17370c76755/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f7472616e736c6174652e737667)](https://packagist.org/packages/phpnomad/translate)[![License](https://camo.githubusercontent.com/2f5b095969f4acf1bfed2a3e367aefdcb2c70f35534d0e8021e845af80a19047/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f7472616e736c6174652e737667)](https://packagist.org/packages/phpnomad/translate)

`phpnomad/translate` is the abstract translation contract PHPNomad applications use to localize strings. It defines a `TranslationStrategy` interface with methods for singular and plural translation, each accepting an optional disambiguation context, plus a few small supporting interfaces for text domain and language signals. Domain and locale resolution lives inside the concrete strategy, so application code can call `translate()` without knowing which backend is wired in behind it.

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

[](#installation)

```
composer require phpnomad/translate
```

Overview
--------

[](#overview)

- `TranslationStrategy` defines `translate()` and `translatePlural()`. Both accept an optional disambiguation context (for example, distinguishing a noun from a verb with the same spelling).
- `HasTextDomain` and `HasLanguage` are thin interfaces for strategies that need a text domain or a language code from their environment.
- `HeaderLanguageProvider` reads `HTTP_ACCEPT_LANGUAGE` and returns a two-character language code, or null when no header is present.
- Concrete backends live in integration packages. `phpnomad/symfony-translation-integration` wires the strategy to Symfony Translation, and `phpnomad/gettext-integration` wires it to gettext.
- When no translation exists for a given string, the contract is to return the original text unchanged, so missing translations never break call sites.

Documentation
-------------

[](#documentation)

Full documentation lives at [phpnomad.com](https://phpnomad.com).

License
-------

[](#license)

MIT. See [LICENSE.txt](LICENSE.txt).

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance90

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.5% 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 ~180 days

Total

4

Last Release

21d ago

Major Versions

1.0.0 → 2.0.02026-03-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e6206223bd6f2a57b8ac80605b1b5c3521faaec18ad3f20f25fb728a9a13784?d=identicon)[tstandiford](/maintainers/tstandiford)

---

Top Contributors

[![alexstandiford](https://avatars.githubusercontent.com/u/8210827?v=4)](https://github.com/alexstandiford "alexstandiford (13 commits)")[![malayladu](https://avatars.githubusercontent.com/u/708174?v=4)](https://github.com/malayladu "malayladu (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

frameworki18nlocalizationphpphpnomadplatform-agnostictranslation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phpnomad-translate/health.svg)

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

###  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.

1927.0k1](/packages/smmoosavi-php-gettext)

PHPackages © 2026

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