Skip to content

Commit 9c56cca

Browse files
committed
Laravel 9 uses Filesystem V3 so for backward compatibility version 2 of package is required, all changes for Laravel <9 should be done on V1 of this package, all changes for Laravel >9 should be done on V2 of this package
Laravel 9 places language files in root path and not in resources/lang anymore, using lang_path() in this package configuration Minimum PHP version for Laravel 9 is 8.0.2, added php requirement in composer.json
1 parent 3a88810 commit 9c56cca

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

README.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,24 @@ which can later be converted to JSON object and used with libraries like Vue, An
1515

1616
## Installing
1717

18-
Just require this package with composer.
18+
#### Laravel before version 9
1919

2020
```
21-
composer require kg-bot/laravel-localization-to-vue
21+
composer require kg-bot/laravel-localization-to-vue:^1
2222
```
2323

24-
### Laravel 8.0+
25-
Laravel 8.0 require minimum of PHP 7.3. make sure you have at least PHP 7.3 before running composer.
24+
#### Laravel 9
25+
26+
```
27+
composer require kg-bot/laravel-localization-to-vue:^2
28+
```
29+
30+
31+
### Laravel 8+
32+
Laravel 8 requires minimum of PHP 7.3. make sure you have at least PHP 7.3 before running composer.
33+
34+
### Laravel 9+
35+
Laravel 9 requires minimum of PHP 8.0.2 make sure you have at least PHP 8.0.2 before running composer.
2636

2737
### Laravel 5.5+
2838

@@ -46,12 +56,12 @@ You can export config by running
4656
php artisan vendor:publish --provider="KgBot\LaravelLocalization\LaravelLocalizationServiceProvider" --tag=config
4757
```
4858

49-
if you want to parse multiple language directories or some other directory except `resources/lang` you can add multiple
59+
if you want to parse multiple language directories or some other directory except `lang_path()` you can add multiple
5060
paths in config `paths.lang_dirs` inside array.
5161

5262
It can be just one path or multiple paths, for example
5363
```php
54-
paths => [resource_path('lang'), app_path('lang'), app_path('Modules/Blog/lang')]
64+
paths => [lang_path(), app_path('lang'), app_path('Modules/Blog/lang')]
5565
```
5666

5767
You can run your own callback function after export, to do that you must register globally accessible function, for example

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "kg-bot/laravel-localization-to-vue",
33
"description": "Laravel package used to collect all localization files from resources/lang (and custom) directories and sub-directories and make them available as JSON file",
44
"require": {
5+
"php": "^8.0",
56
"laravel/framework": "5.*|^6|^7|^8|^9",
67
"ext-json": "*"
78
},

src/Console/Commands/ExportMessages.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Illuminate\Console\Command;
66
use KgBot\LaravelLocalization\Facades\ExportLocalizations;
7-
use League\Flysystem\Adapter\Local;
7+
use League\Flysystem\Local\LocalFilesystemAdapter as Local;
88
use League\Flysystem\Filesystem;
99

1010
class ExportMessages extends Command

src/Console/Commands/ExportMessagesToFlat.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Illuminate\Console\Command;
66
use KgBot\LaravelLocalization\Facades\ExportLocalizations;
7-
use League\Flysystem\Adapter\Local;
7+
use League\Flysystem\Local\LocalFilesystemAdapter as Local;
88
use League\Flysystem\Filesystem;
99

1010
class ExportMessagesToFlat extends Command

src/config/laravel-localization.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
* In you .env file just add:
8787
* LARAVEL_LOCALIZATION_LANG_DIRS=resources/lang,Modules/Blog/Resources/lang
8888
*/
89-
'lang_dirs' => [resource_path('lang')],
89+
'lang_dirs' => [lang_path()],
9090
],
9191
/**
9292
* You can customize the regexp for lang files to be able to exclude certain files.

0 commit comments

Comments
 (0)