PHPackages                             alldigitalrewards/language-mapper - 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. alldigitalrewards/language-mapper

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

alldigitalrewards/language-mapper
=================================

Language Mapper Library

2.3.0(3w ago)08.2k↓60.8%1MITPHPPHP ^7.0|^8.0

Since Sep 8Pushed 3w ago3 watchersCompare

[ Source](https://github.com/alldigitalrewards/language-mapper)[ Packagist](https://packagist.org/packages/alldigitalrewards/language-mapper)[ RSS](/packages/alldigitalrewards-language-mapper/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (6)Versions (38)Used By (1)

Language Mapper Library
=======================

[](#language-mapper-library)

This is a Language mapper which maps a Language tag, defaulting to 'en' if not found or present

Install
-------

[](#install)

Via Composer

```
$ composer require alldigitalrewards/language-mapper
```

Usage
-----

[](#usage)

```
Returns default en_US since language not found in acceptable list:

$mapper = new LanguageMapper('nz_NZ');
$this->assertSame('en_US', $mapper->getLanguage());

Returns es_ES since language found in acceptable list:

$mapper = new LanguageMapper('es_ES');
$this->assertSame('es_ES', $mapper->getLanguage());

You can pass in short code and/or long code with dashes

$mapper = new LanguageMapper('fr');
$this->assertSame('fr_CA', $mapper->getLanguage());

$mapper = new LanguageMapper('es-ES');
$this->assertSame('es_ES', $mapper->getLanguage());
```

Testing
-------

[](#testing)

```
$ composer test
```

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance95

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 65.3% 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 ~102 days

Recently: every ~379 days

Total

18

Last Release

23d ago

Major Versions

1.4.2 → 2.0.02022-03-31

PHP version history (2 changes)1.0.0PHP ^7.3|^8.0

1.2.0PHP ^7.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2b92b5a53a8e8f3b2e4065273a99f31fe19b950eb058cd1bd620cde48399420?d=identicon)[Houghtelin](/maintainers/Houghtelin)

![](https://www.gravatar.com/avatar/824513e4f32e579f28bf655454ad6bf9ccd1e7c3becc5c21420625b0e13a09ee?d=identicon)[zwalden](/maintainers/zwalden)

![](https://www.gravatar.com/avatar/796fe3ffb035a9d0387d5d055edd60464f869961f983b2edbdf3b42a2abd6b9b?d=identicon)[jmuto2](/maintainers/jmuto2)

---

Top Contributors

[![jmuto2](https://avatars.githubusercontent.com/u/12384482?v=4)](https://github.com/jmuto2 "jmuto2 (32 commits)")[![zwalden](https://avatars.githubusercontent.com/u/6456425?v=4)](https://github.com/zwalden "zwalden (15 commits)")[![jhoughtelin](https://avatars.githubusercontent.com/u/6137941?v=4)](https://github.com/jhoughtelin "jhoughtelin (2 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/alldigitalrewards-language-mapper/health.svg)

```
[![Health](https://phpackages.com/badges/alldigitalrewards-language-mapper/health.svg)](https://phpackages.com/packages/alldigitalrewards-language-mapper)
```

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