PHPackages                             jrmajor/laravel-fluent - 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. jrmajor/laravel-fluent

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

jrmajor/laravel-fluent
======================

Fluent translations for Laravel

v1.3.0(3mo ago)208.4k↑1250%2[2 PRs](https://github.com/jrmajor/laravel-fluent/pulls)MITPHPPHP 8.3 - 8.5CI passing

Since Jun 6Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/jrmajor/laravel-fluent)[ Packagist](https://packagist.org/packages/jrmajor/laravel-fluent)[ Docs](https://github.com/jrmajor/laravel-fluent)[ GitHub Sponsors](https://github.com/jrmajor)[ RSS](/packages/jrmajor-laravel-fluent/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (18)Used By (0)

jrmajor/laravel-fluent
======================

[](#jrmajorlaravel-fluent)

[![Latest Stable Version](https://camo.githubusercontent.com/32772766f90c1ead971c960929ad955f6a8bfcb3c17def2d8f6188304adede91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a726d616a6f722f6c61726176656c2d666c75656e742e737667)](https://packagist.org/packages/jrmajor/laravel-fluent)[![Required PHP Version](https://camo.githubusercontent.com/820b931be2f4e86fe4cee3a22493cf961e38b7dba5fa196ade0fa919ee1bc664/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a726d616a6f722f6c61726176656c2d666c75656e742e737667)](https://packagist.org/packages/jrmajor/laravel-fluent)

Unleash the expressive power of the natural language in your Laravel application with [Project Fluent](https://projectfluent.org), a localization system designed by Mozilla.

Read the [Fluent Syntax Guide](https://projectfluent.org/fluent/guide/) or try it out in the [Fluent Playground](https://projectfluent.org/play/) to learn more about the syntax.

```
shared-photos =
    { $userName } { $photoCount ->
        [one] added a new photo
       *[other] added { $photoCount } new photos
    } to { $userGender ->
        [male] his stream
        [female] her stream
       *[other] their stream
    }.
```

```
__('stream.shared-photos', [
    'userName' => 'jrmajor',
    'photoCount' => 2,
    'userGender' => 'male',
]); // jrmajor added 2 new photos to his stream.
```

This package is a Laravel wrapper around [jrmajor/fluent-php](https://github.com/jrmajor/fluent-php).

You may install it via Composer: `composer require jrmajor/laravel-fluent`. The package will automatically register itself.

Usage
-----

[](#usage)

This package replaces default Laravel translator with `Major\Fluent\Laravel\FluentTranslator`.

```
app('translator') instanceof Major\Fluent\Laravel\FluentTranslator; // true
```

Fluent translations are stored in `.ftl` files. Place them among your `.php` translation files in your Laravel app:

```
/resources
  /lang
    /en
      menu.ftl
      validation.php
    /pl
      menu.ftl
      validation.php

```

If there is no Fluent message for a given key, translator will fall back to a `.php` file, which allows you to introduce Fluent translation format progressively.

Laravel validator uses custom logic for replacing the `:attribute` variable and requires deeply nested keys, which are not supported in Fluent, so you should leave `validation.php` file in the default Laravel format.

The `trans_choice()` helper always falls back to the default translator, as the Fluent format eliminates the need for this function.

You may use the `FluentTranslator::addFunction()` method to register [Fluent functions](https://projectfluent.org/fluent/guide/functions.html).

### Configuration

[](#configuration)

Optionally, you can publish the configuration file with this command:

```
php artisan vendor:publish --tag fluent-config
```

This will publish the following file in `config/fluent.php`:

```
return [

    /*
     * In strict mode, exceptions will be thrown for syntax errors
     * in .ftl files, unknown variables in messages etc.
     * It's recommended to enable this setting in development
     * to make it easy to spot mistakes.
     */
    'strict' => env('APP_ENV', 'production') !== 'production',

    /*
     * Determines if it should use Unicode isolation marks (FSI, PDI)
     * for bidirectional interpolations. You may want to enable this
     * behaviour if your application uses right-to-left script.
     */
    'use_isolating' => false,

];
```

Testing
-------

[](#testing)

```
vendor/bin/phpunit           # Tests
vendor/bin/phpstan analyze   # Static analysis
vendor/bin/php-cs-fixer fix  # Formatting
```

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance80

Actively maintained with recent releases

Popularity33

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 93.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 ~129 days

Recently: every ~194 days

Total

14

Last Release

117d ago

Major Versions

v0.2.1 → v1.0.02023-07-09

PHP version history (8 changes)v0.1.0PHP ^8.0

v0.1.3PHP ~8.0.0 || ~8.1.0

v0.2.0PHP 8.1 - 8.2

v1.0.1PHP 8.1 - 8.3

v1.1.0PHP 8.2 - 8.3

v1.1.1PHP 8.2 - 8.4

v1.2.0PHP 8.3 - 8.4

v1.3.0PHP 8.3 - 8.5

### Community

Maintainers

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

---

Top Contributors

[![jrmajor](https://avatars.githubusercontent.com/u/26096713?v=4)](https://github.com/jrmajor "jrmajor (125 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![mikerockett](https://avatars.githubusercontent.com/u/4586280?v=4)](https://github.com/mikerockett "mikerockett (1 commits)")[![vodik](https://avatars.githubusercontent.com/u/216803?v=4)](https://github.com/vodik "vodik (1 commits)")

---

Tags

localizationinternationalizationi18nlanguagel10npluraltranslationtranslatorlocalegendermozillaftl

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jrmajor-laravel-fluent/health.svg)

```
[![Health](https://phpackages.com/badges/jrmajor-laravel-fluent/health.svg)](https://phpackages.com/packages/jrmajor-laravel-fluent)
```

###  Alternatives

[jrmajor/fluent

Fluent localization system for PHP

2716.9k5](/packages/jrmajor-fluent)[gettext/languages

gettext languages with plural rules

7530.3M11](/packages/gettext-languages)[aplus/language

Aplus Framework Language Library

2351.7M15](/packages/aplus-language)[tractorcow/silverstripe-fluent

Simple localisation for Silverstripe

92421.6k26](/packages/tractorcow-silverstripe-fluent)[delight-im/i18n

Internationalization and localization for PHP

625.2k3](/packages/delight-im-i18n)[inpsyde/multilingual-press

Simply THE multisite-based free open source plugin for your multilingual websites.

2414.0k1](/packages/inpsyde-multilingual-press)

PHPackages © 2026

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