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

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

eklundkristoffer/js-localization
================================

Laravel package to provide localizations to the Javascript code.

1.1(7y ago)054MITPHPPHP &gt;=5.4.0

Since Oct 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/eklundkristoffer/laravel-js-localization)[ Packagist](https://packagist.org/packages/eklundkristoffer/js-localization)[ RSS](/packages/eklundkristoffer-js-localization/feed)WikiDiscussions laravel-5 Synced today

READMEChangelog (2)Dependencies (4)Versions (8)Used By (0)

laravel-js-localization
=======================

[](#laravel-js-localization)

[![Build Status](https://camo.githubusercontent.com/6c68a01bde38c841d9ead09199f12670b02c7c22ab2ebc1c44f7eff78a3982cc/68747470733a2f2f7472617669732d63692e6f72672f616e64797765722f6c61726176656c2d6a732d6c6f63616c697a6174696f6e2e7376673f6272616e63683d6c61726176656c2d35)](https://travis-ci.org/andywer/laravel-js-localization) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/97a57c1402961437474d50a7296b3e10d3969e32894579aeb5a480e14f7e4a98/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e64797765722f6c61726176656c2d6a732d6c6f63616c697a6174696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6c61726176656c2d35)](https://scrutinizer-ci.com/g/andywer/laravel-js-localization/?branch=laravel-5) [![Code Coverage](https://camo.githubusercontent.com/b3c8a534a18ce7a9331690219d1b4e870e1d7ef42979202a7b6b63d8dc65b5e4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e64797765722f6c61726176656c2d6a732d6c6f63616c697a6174696f6e2f6261646765732f636f7665726167652e706e673f623d6c61726176656c2d35)](https://scrutinizer-ci.com/g/andywer/laravel-js-localization/?branch=laravel-5) [![Total Downloads](https://camo.githubusercontent.com/ee72936ad0fbf61f8b437291574474f8f696f8c99a7c117c135109f32ffb5109/68747470733a2f2f706f7365722e707567782e6f72672f616e64797765722f6a732d6c6f63616c697a6174696f6e2f646f776e6c6f6164732e737667)](https://packagist.org/packages/andywer/js-localization)

Simple, ease-to-use and flexible package for the [Laravel](http://laravel.com/) web framework. Allows you to use localized messages of the Laravel webapp (see `resources/lang` directory) in your Javascript code. You may easily configure which messages you need to export.

**⚠️ Looking for a new maintainer. Please contact me if you are interested.**

Branches
--------

[](#branches)

LaravelBranch5.xlaravel-54.2laravel-4.24.1laravel-4.1 (near end of life)4.0laravel-4.0 (end of life)Installation
------------

[](#installation)

Add the following line to the `require` section of your Laravel webapp's `composer.json` file:

```
    "require": {
        "andywer/js-localization": "dev-laravel-5"    // "dev-laravel-4.1", "dev-laravel-4.2" for Laravel 4
    }
```

Run `composer update` to install the package.

Finally add the following line to the `providers` array of your `app/config/app.php` file:

```
    'providers' => [
        /* ... */
        JsLocalization\JsLocalizationServiceProvider::class
    ]
```

Configuration
-------------

[](#configuration)

Run `php artisan vendor:publish` first. This command copies the package's default configuration to `config/js-localization.php`.

You may now edit this file to define the messages you need in your Javascript code. Just edit the `messages` array in the config file.

Example (exports all reminder messages):

```
