<commit_before>Laravel JS Localization
=======================

> Laravel Localization in JavaScript.

![Laravel 5.1](https://img.shields.io/badge/Laravel-5.1-f4645f.svg)
![Laravel 5.0](https://img.shields.io/badge/Laravel-5.0-f4645f.svg)
![Laravel 4.2](https://img.shields.io/badge/Laravel-4.2-f4645f.svg)
[![Latest Stable Version](https://poser.pugx.org/mariuzzo/laravel-js-localization/v/stable.svg)](https://packagist.org/packages/mariuzzo/laravel-js-localization)
[![Total Downloads](https://poser.pugx.org/mariuzzo/laravel-js-localization/downloads.svg)](https://packagist.org/packages/mariuzzo/laravel-js-localization)
[![License](https://poser.pugx.org/mariuzzo/laravel-js-localization/license.svg)](https://packagist.org/packages/mariuzzo/laravel-js-localization)

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.

Support Laravel 4.2.x, Laravel 5 and Laravel 5.1.x.

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

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

    "mariuzzo/laravel-js-localization": "1.2.0"

Run:

    composer update

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

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

That's it!

Usage
-----

This project comes with a command that generate the JavaScript version of all your messages found at: `app/lang` or `resources/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
php artisan lang:js
```
**Specifying a custom target**
```php
php artisan lang:js public/assets/dist/lang.dist.js
```
**Compressing the JS file**
```php
php artisan lang:js -c
```
**Use [gulp](http://gulpjs.com/) to publish (optional):**

install `gulp-shell` from https://github.com/sun-zheng-an/gulp-shell with `npm install --save-dev gulp-shell` 
and then run it directly in your `gulpfile.js`:<commit_msg>Fix wrong code types<commit_after>Laravel JS Localization
=======================

> Laravel Localization in JavaScript.

![Laravel 5.1](https://img.shields.io/badge/Laravel-5.1-f4645f.svg)
![Laravel 5.0](https://img.shields.io/badge/Laravel-5.0-f4645f.svg)
![Laravel 4.2](https://img.shields.io/badge/Laravel-4.2-f4645f.svg)
[![Latest Stable Version](https://poser.pugx.org/mariuzzo/laravel-js-localization/v/stable.svg)](https://packagist.org/packages/mariuzzo/laravel-js-localization)
[![Total Downloads](https://poser.pugx.org/mariuzzo/laravel-js-localization/downloads.svg)](https://packagist.org/packages/mariuzzo/laravel-js-localization)
[![License](https://poser.pugx.org/mariuzzo/laravel-js-localization/license.svg)](https://packagist.org/packages/mariuzzo/laravel-js-localization)

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.

Support Laravel 4.2.x, Laravel 5 and Laravel 5.1.x.

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

Add the following line to you `composer.json` file under `require`.
```json
"mariuzzo/laravel-js-localization": "1.2.0"
```
Run:
```shell
composer update
```
In your Laravel app go to `app/config/app.php` and add the following service provider:
```php
'providers' => array(
    ...
    'Mariuzzo\LaravelJsLocalization\LaravelJsLocalizationServiceProvider'
    ...
)
```
That's it!

Usage
-----

This project comes with a command that generate the JavaScript version of all your messages found at: `app/lang` or `resources/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**
```shell
php artisan lang:js
```
**Specifying a custom target**
```shell
php artisan lang:js public/assets/dist/lang.dist.js
```
**Compressing the JS file**
```shell
php artisan lang:js -c
```
**Use [gulp](http://gulpjs.com/) to publish (optional):**

install `gulp-shell` from https://github.com/sun-zheng-an/gulp-shell with `npm install --save-dev gulp-shell` 
and then run it directly in your `gulpfile.js`:
{'fraction_non_alphanumeric': 0.15449241540256708, 'fraction_numerical': 0.014935822637106185, 'mean_word_length': 4.4808184143222505, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 20, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1901241', 'n_tokens_mistral': 1500, 'n_tokens_neox': 1409, 'n_words': 361}