PHPackages                             karunais13/simple-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. karunais13/simple-js-localization

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

karunais13/simple-js-localization
=================================

Laravel Simple JS localization

3.0.2(4y ago)048MITPHPPHP &gt;=5.4.0

Since Oct 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/karunais13/simple-js-localization)[ Packagist](https://packagist.org/packages/karunais13/simple-js-localization)[ RSS](/packages/karunais13-simple-js-localization/feed)WikiDiscussions master Synced today

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

Simple JS Localization
======================

[](#simple-js-localization)

###### NOTE: Support laravel 5.0 and above.

[](#note-support-laravel-50-and-above)

[Laravel](http://laravel.com/) has some pretty sweet functions for translation, but the function only limited to blade or php file only. Thus, This package convert all your localization messages from your Laravel app to JavaScript with a simple logic to interact with those messages following a very similar syntax you are familiar with.

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

[](#installation)

Install the usual [composer](https://getcomposer.org/) way.

###### Run this command at root directory of your project

[](#run-this-command-at-root-directory-of-your-project)

```
"composer require karunais13/laravel-simple-js-localization"
```

#### For Laravel 5.5 and below add provider in config file like below :

[](#for-laravel-55-and-below-add-provider-in-config-file-like-below-)

###### app/config/app.php

[](#appconfigappphp)

```
	...

	'providers' => array(
		...
		Karu\SimpleJsLocalization\SimpleJsLocalizationProvider::class,
	]
```

Usage
-----

[](#usage)

The `Simple JS Localization ` package provides a command that generate the JavaScript version of all your messages found at: `resources/lang` (Laravel 5) directory. The resulting JavaScript file will contain all your messages plus a simple logic to use on javascript.

### Generating JS messages

[](#generating-js-messages)

```
php artisan localization:generate-js
```

### Compressing the JS file (minified)

[](#compressing-the-js-file-minified)

```
php artisan localization:generate-js -c
```

With the default configuration, this will create a public/js/simple-js-localise.js file to include in your page, or build.

```

```

**Note: You'll have to run localization:generate-js if you change your localization files.**

### Set Locale

[](#set-locale)

```
window.lang.setLocale("{{ app()->getLocale() }}");
```

### Get Message

[](#get-message)

```
window.lang.get("Hello");
//> "Hello";
// If locale set to `es`
//> "Hola" (based on localization from lang folder in resources)
```

Licence
-------

[](#licence)

[View the licence in this repo.](https://github.com/karunais13/laravel-simple-js-localization/blob/master/LICENSE)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 94.7% 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 ~56 days

Recently: every ~154 days

Total

12

Last Release

1795d ago

Major Versions

v1.1.3 → v2.0.02020-03-04

v2.0.0 → v3.0.02021-05-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/557d71567cf6385655c701d049fee56bd708e833e9442eae25cb935f3d31db2f?d=identicon)[karunais13](/maintainers/karunais13)

---

Top Contributors

[![karunais13](https://avatars.githubusercontent.com/u/18754736?v=4)](https://github.com/karunais13 "karunais13 (18 commits)")[![CaddyDz](https://avatars.githubusercontent.com/u/13698160?v=4)](https://github.com/CaddyDz "CaddyDz (1 commits)")

---

Tags

laravellocalizationtranslationJS

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/karunais13-simple-js-localization/health.svg)

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

###  Alternatives

[mariuzzo/laravel-js-localization

Laravel Localization in JavaScript

6073.9M3](/packages/mariuzzo-laravel-js-localization)[kkomelin/laravel-translatable-string-exporter

Translatable String Exporter for Laravel

3291.4M10](/packages/kkomelin-laravel-translatable-string-exporter)[tio/laravel

Add this package to localize your Laravel application (PHP, JSON or GetText).

170318.5k](/packages/tio-laravel)[opgginc/codezero-laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

2770.1k1](/packages/opgginc-codezero-laravel-localized-routes)[longman/laravel-multilang

Package to integrate multi language (multi locale) functionality in Laravel 5.x

5514.4k1](/packages/longman-laravel-multilang)

PHPackages © 2026

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