Skip to content

Commit f1861c8

Browse files
Laravel 11.x and 12.x support
1 parent 1ea310b commit f1861c8

File tree

11 files changed

+116
-442
lines changed

11 files changed

+116
-442
lines changed

.travis.yml

Lines changed: 0 additions & 218 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# ![Laravel JS Localization - Convert you Laravel messages and use them in the front-end!](.github/assets/banner.svg)
22

3-
![Laravel 5.5](https://img.shields.io/badge/Laravel-5.5-f4645f.svg)
4-
![Laravel 4.2](https://img.shields.io/badge/Laravel-4.2-f4645f.svg)
53
[![Latest Stable Version](https://poser.pugx.org/mariuzzo/laravel-js-localization/v/stable.svg)](https://packagist.org/packages/mariuzzo/laravel-js-localization)
64
[![Total Downloads](https://poser.pugx.org/mariuzzo/laravel-js-localization/downloads.svg)](https://packagist.org/packages/mariuzzo/laravel-js-localization)
75
[![License](https://poser.pugx.org/mariuzzo/laravel-js-localization/license.svg)](https://packagist.org/packages/mariuzzo/laravel-js-localization)
@@ -10,10 +8,10 @@ This package convert all your localization messages from your Laravel app to Jav
108

119
## Features
1210

13-
- Support Laravel 4.2, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 6.x, 7.x and 8.x!
14-
- Includes [Lang.js](https://github.com/rmariuzzo/lang.js) (a thin library highly inspired on Laravel's [`Translator`](https://laravel.com/api/5.4/Illuminate/Translation/Translator.html) class).
11+
- Support Laravel 11.x and 12.x!
12+
- Includes [Lang.js](https://github.com/rmariuzzo/lang.js)
13+
- Lang.js API is based on Laravel's [`Translator`](https://api.laravel.com/docs/master/Illuminate/Translation/Translator.html) class. No need to learn a whole API.
1514
- Allow to specify desired lang files to be converted to JS.
16-
- Lang.js API is based on Laravel's [`Translator`](https://laravel.com/api/5.4/Illuminate/Translation/Translator.html) class. No need to learn a whole API.
1715

1816
<table><tbody><tr><td>
1917

@@ -28,15 +26,9 @@ This package convert all your localization messages from your Laravel app to Jav
2826
composer require mariuzzo/laravel-js-localization
2927
```
3028

31-
In your Laravel app go to `config/app.php` and add the following service provider:
32-
33-
```php
34-
Mariuzzo\LaravelJsLocalization\LaravelJsLocalizationServiceProvider::class
35-
```
36-
3729
## Usage
3830

39-
The `Laravel-JS-Localization` package provides a command that generate the JavaScript version of all your messages found at: `app/lang` (Laravel 4) or `resources/lang` (Laravel 5) directory. The resulting JavaScript file will contain all your messages plus [Lang.js](https://github.com/rmariuzzo/lang.js) (a thin library highly inspired on Laravel's [`Translator`](https://laravel.com/api/5.4/Illuminate/Translation/Translator.html) class).
31+
The `Laravel-JS-Localization` package provides a command that generate the JavaScript version of all your messages found at: `lang` directory. The resulting JavaScript file will contain all your messages plus [Lang.js](https://github.com/rmariuzzo/lang.js) (a thin library highly inspired on Laravel's [`Translator`](https://api.laravel.com/docs/master/Illuminate/Translation/Translator.html) class).
4032

4133
### Generating JS messages
4234

@@ -93,46 +85,6 @@ return [
9385
];
9486
```
9587

96-
### Using [gulp](http://gulpjs.com/) (optional)
97-
98-
Install [`gulp-shell`](https://github.com/sun-zheng-an/gulp-shell) and then run it directly in your `gulpfile.js`:
99-
100-
```js
101-
var shell = require('gulp-shell');
102-
103-
gulp.task('langjs', shell.task('php artisan lang:js -c public/js/messages.js'));
104-
```
105-
106-
### Using [Laravel's elixir](http://laravel.com/docs/elixir) (optional)
107-
Before Elixir 4.0:
108-
109-
```js
110-
elixir.extend('langjs', function(path) {
111-
gulp.task('langjs', function() {
112-
gulp.src('').pipe(shell('php artisan lang:js ' + (path || 'public/js/messages.js')));
113-
});
114-
115-
return this.queueTask('langjs');
116-
});
117-
```
118-
Elixir 4.0+:
119-
```js
120-
var Task = elixir.Task;
121-
elixir.extend('langjs', function(path) {
122-
new Task('langjs', function() {
123-
gulp.src('').pipe(shell('php artisan lang:js ' + (path || 'public/js/messages.js')));
124-
});
125-
});
126-
```
127-
128-
And use it like this:
129-
130-
```js
131-
elixir(function(mix) {
132-
mix.langjs();
133-
});
134-
```
135-
13688
### Using [Laravel's Mix](https://laravel.com/docs/5.4/mix) with Laravel 5.4+ (optional)
13789

13890
Add "[webpack-shell-plugin-next](https://www.npmjs.com/package/webpack-shell-plugin-next)" to package.json's "devDependencies" section.
@@ -153,7 +105,7 @@ mix.webpackConfig({
153105

154106
## Documentation
155107

156-
This is a quick documentation regarding [Lang.js](https://github.com/rmariuzzo/lang.js) (the thin JavaScript library included by `Laravel-JS-Localization`). The [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).
108+
This is a quick documentation regarding [Lang.js](https://github.com/rmariuzzo/lang.js) (the thin JavaScript library included by `Laravel-JS-Localization`). The [Lang.js](https://github.com/rmariuzzo/lang.js) (a thin library highly inspired on Laravel's [`Translator`](https://api.laravel.com/docs/master/Illuminate/Translation/Translator.html) class).
157109

158110
> 💁 Go to [Lang.js documentation]([Lang.js](https://github.com/rmariuzzo/lang.js)) to see all available methods.
159111
@@ -206,7 +158,7 @@ Lang.choice('messages.apples', 10, { name: 'Joe' });
206158
You will need to have installed the following softwares.
207159

208160
- Composer.
209-
- PHP 5.5+.
161+
- PHP 8.2+.
210162

211163
### Development setup
212164

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "library",
55
"keywords": [
66
"laravel",
7-
"laravel 5",
7+
"laravel 12",
88
"localization",
99
"i18n",
1010
"javascript",
@@ -52,24 +52,24 @@
5252
"source": "https://github.com/rmariuzzo/laravel-js-localization"
5353
},
5454
"require": {
55-
"php": "^5.4 || ^7.0 || ^8.0",
56-
"illuminate/config": "^4.2 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
57-
"illuminate/console": "^4.2 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
58-
"illuminate/filesystem": "^4.2 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
55+
"php": "^8.2",
56+
"illuminate/console": "^11.0|^12.0",
57+
"illuminate/filesystem": "^11.0|^12.0",
58+
"illuminate/support": "^11.0|^12.0",
59+
"laravel/framework": "^11.0|^12.0",
5960
"tedivm/jshrink": "~1.0"
6061
},
6162
"require-dev": {
62-
"orchestra/testbench": "^2.2 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
63-
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0"
63+
"phpunit/phpunit": "^11.0"
6464
},
6565
"autoload": {
6666
"psr-4": {
67-
"Mariuzzo\\LaravelJsLocalization\\": "src/Mariuzzo/LaravelJsLocalization/"
67+
"Mariuzzo\\LaravelJsLocalization\\": "src"
6868
}
6969
},
7070
"autoload-dev": {
7171
"psr-4": {
72-
"Mariuzzo\\LaravelJsLocalization\\": "tests/specs"
72+
"Mariuzzo\\LaravelJsLocalization\\Tests\\": "tests"
7373
}
7474
},
7575
"minimum-stability": "stable",

0 commit comments

Comments
 (0)