Skip to content

Commit 2763834

Browse files
authored
Merge pull request #61 from successamp/master
Update readme with Elixir 4.0+ example.
2 parents c0adbbe + 33648cd commit 2763834

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
This package convert all your localization messages from your Laravel app to JavaScript with a small library to interact with those messages following a very similar syntax you are familiar with.
1616

17-
#### Features
17+
### Features
1818

1919
- Support Laravel 4.2.x, Laravel 5.0.x, Laravel 5.1.x, Laravel 5.2.x and Laravel 5.3.x.
2020
- Includes [Lang.js](https://github.com/rmariuzzo/lang.js) (a thin library highly inspired on Laravel's [`Translator`](https://laravel.com/api/5.3/Illuminate/Translation/Translator.html) class).
@@ -91,6 +91,7 @@ gulp.task('langjs', shell.task('php artisan lang:js -c public/js/messages.js'));
9191
```
9292

9393
#### Using [Laravel's elixir](http://laravel.com/docs/elixir) (optional)
94+
Before Elixir 4.0:
9495

9596
```js
9697
elixir.extend('langjs', function(path) {
@@ -101,6 +102,15 @@ elixir.extend('langjs', function(path) {
101102
return this.queueTask('langjs');
102103
});
103104
```
105+
Elixir 4.0+:
106+
```js
107+
var Task = elixir.Task;
108+
elixir.extend('langjs', function(path) {
109+
new Task('langjs', function() {
110+
gulp.src('').pipe(shell('php artisan lang:js ' + (path || 'public/js/messages.js')));
111+
});
112+
});
113+
```
104114

105115
And use it like this:
106116

0 commit comments

Comments
 (0)