PHPackages                             xaoc/laravel-js-localization - 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. xaoc/laravel-js-localization

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

xaoc/laravel-js-localization
============================

Laravel Localization in JavaScript

1.0.2(11y ago)47.2k2MITPHPPHP &gt;=5.3.0

Since May 1Pushed 8y ago2 watchersCompare

[ Source](https://github.com/xAockd/Laravel-JS-Localization)[ Packagist](https://packagist.org/packages/xaoc/laravel-js-localization)[ Docs](https://github.com/rmariuzzo/laravel-js-localization)[ RSS](/packages/xaoc-laravel-js-localization/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (4)Used By (0)

Laravel JS Localization
=======================

[](#laravel-js-localization)

> Laravel Localization in JavaScript.

This is a simple package that convert all your localization messages of your Laravel app to JavaScript, and provides a small JavaScript library to interact with those messages.

For larvel 4.\* use

Support Laravel 5.0.

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

[](#installation)

Add the following line to you `composer.json` file under `require`.

```
"xaoc/laravel-js-localization": "dev-master"

```

Run:

```
composer update

```

In your Laravel app go to `config/app.php` and add the following service provider:

```
'providers' => array(
    ...
    'Mariuzzo\LaravelJsLocalization\LaravelJsLocalizationServiceProvider'
    ...
)

```

That's it!

Usage
-----

[](#usage)

This project comes with a command that generate the JavaScript version of all your messages found at: `app/lang` directory. The resulting JavaScript file will have the whole bunch of messages and a thin library similar to Laravel's `Lang` class.

**Generating JS messages**

```
php artisan lang:js

```

**Specifying a custom target**

```
php artisan lang:js public/assets/dist/lang.dist.js

```

**Compressing the JS file**

```
php artisan lang:js -c

```

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

[](#documentation)

This is the documentation regarding the thin JavaScript library. The library highly inspired on Laravel's `Lang` class.

**Getting a message**

```
Lang.get('messages.home');

```

**Getting a message with replacements**

```
Lang.get('messages.welcome', { name: 'Joe' });

```

**Changing the locale**

```
Lang.setLocale('es');

```

**Checking if a message key exists**

```
Lang.has('messages.foo');

```

**Support for singular and plural message based on a count**

```
Lang.choice('messages.apples', 10);

```

**Calling the `choice` method with replacements**

```
Lang.choice('messages.apples', 10, { name: 'Joe' });

```

For more detailed information, take a look at the source: [Lang.js](https://github.com/xAockd/Laravel-JS-Localization/blob/master/src/js/lang.js).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 54.2% 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 ~9 days

Total

3

Last Release

4375d ago

### Community

Maintainers

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

---

Top Contributors

[![rmariuzzo](https://avatars.githubusercontent.com/u/439839?v=4)](https://github.com/rmariuzzo "rmariuzzo (26 commits)")[![xAockd](https://avatars.githubusercontent.com/u/3390348?v=4)](https://github.com/xAockd "xAockd (14 commits)")[![gpopoteur](https://avatars.githubusercontent.com/u/952557?v=4)](https://github.com/gpopoteur "gpopoteur (7 commits)")[![koss-shtukert](https://avatars.githubusercontent.com/u/709096?v=4)](https://github.com/koss-shtukert "koss-shtukert (1 commits)")

---

Tags

laravellocalizationi18njavascriptJSlang

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xaoc-laravel-js-localization/health.svg)

```
[![Health](https://phpackages.com/badges/xaoc-laravel-js-localization/health.svg)](https://phpackages.com/packages/xaoc-laravel-js-localization)
```

###  Alternatives

[mariuzzo/laravel-js-localization

Laravel Localization in JavaScript

6073.9M3](/packages/mariuzzo-laravel-js-localization)[laravel-lang/publisher

Localization publisher for your Laravel application

2167.7M24](/packages/laravel-lang-publisher)[michele-angioni/laravel-js-lang-converter

Laravel Localization in JavaScript

2565.2k](/packages/michele-angioni-laravel-js-lang-converter)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

3812.2k](/packages/erag-laravel-lang-sync-inertia)

PHPackages © 2026

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