PHPackages                             fyre/lang - 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. fyre/lang

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

fyre/lang
=========

A language utility library.

v6.0(7mo ago)0230↓83.3%6MITPHP

Since Oct 26Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/elusivecodes/FyreLang)[ Packagist](https://packagist.org/packages/fyre/lang)[ RSS](/packages/fyre-lang/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (7)Versions (32)Used By (6)

FyreLang
========

[](#fyrelang)

**FyreLang** is a free, open-source language library for *PHP*.

Table Of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Basic Usage](#basic-usage)
- [Methods](#methods)

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

[](#installation)

**Using Composer**

```
composer require fyre/lang

```

In PHP:

```
use Fyre\Lang\Lang;
```

Basic Usage
-----------

[](#basic-usage)

- `$config` is a [*Config*](https://github.com/elusivecodes/FyreConfig).

```
$lang = new Lang($config);
```

The default locale will be resolved from the "*App.defaultLocale*" key in the *Config*.

**Autoloading**

It is recommended to bind the *Lang* to the [*Container*](https://github.com/elusivecodes/FyreContainer) as a singleton.

```
$container->singleton(Lang::class);
```

Any dependencies will be injected automatically when loading from the [*Container*](https://github.com/elusivecodes/FyreContainer).

```
$lang = $container->use(Lang::class);
```

Methods
-------

[](#methods)

**Add Path**

Add a language path.

- `$path` is a string representing the path to add.
- `$prepend` is a boolean indicating whether to prepend the file path, and will default to *false*.

```
$lang->addPath($path, $prepend);
```

**Clear**

Clear all language data.

```
$lang->clear();
```

**Get**

Get a language value.

- `$key` is a string representing the key to lookup.
- `$data` is an array containing data to insert into the language string.

```
$lang = $lang->get($key, $data);
```

See the [*MessageFormatter::formatMessage*](https://www.php.net/manual/en/messageformatter.formatmessage.php) method for details about message formatting.

**Get Default Locale**

Get the default locale.

```
$defaultLocale = $lang->getDefaultLocale();
```

**Get Locale**

Get the current locale.

```
$locale = $lang->getLocale();
```

**Get Paths**

Get the paths.

```
$paths = $lang->getPaths();
```

**Remove Path**

Remove a path.

- `$path` is a string representing the path to remove.

```
$lang->removePath($path);
```

**Set Default Locale**

Set the default locale.

- `$locale` is a string representing the locale.

```
$lang->setDefaultLocale($locale);
```

**Set Locale**

Set the current locale.

- `$locale` is a string representing the locale.

```
$lang->setLocale($locale);
```

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance62

Regular maintenance activity

Popularity11

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Recently: every ~54 days

Total

31

Last Release

238d ago

Major Versions

v1.0.7 → v2.02023-07-15

v2.0 → v3.02023-07-23

v3.1.1 → v4.02024-10-29

v4.1.0 → v5.02024-11-16

v5.1.4 → v6.02025-10-28

### Community

Maintainers

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

---

Top Contributors

[![elusivecodes](https://avatars.githubusercontent.com/u/18050480?v=4)](https://github.com/elusivecodes "elusivecodes (23 commits)")

---

Tags

intllangphptranslation

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/fyre-lang/health.svg)

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

###  Alternatives

[php-translation/translator

Translator services

25224.8k5](/packages/php-translation-translator)[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.

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

PHPackages © 2026

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