File tree Expand file tree Collapse file tree 5 files changed +18
-15
lines changed Expand file tree Collapse file tree 5 files changed +18
-15
lines changed Original file line number Diff line number Diff line change 2
2
3
3
All notable changes to ` laravel-artisan-translations ` will be documented in this file
4
4
5
+ ## 2.0.0 - 2022-04-20
6
+
7
+ - Laravel 9 compatibility
8
+
5
9
## 1.0.0 - 2017-06-01
6
10
7
11
- initial release
Original file line number Diff line number Diff line change @@ -26,34 +26,33 @@ Now add the service provider in `config/app.php` file:
26
26
### Add translations from a single file
27
27
28
28
``` php
29
- php artisan translations:add vendor/typicms/pages/src/resources/ lang/fr.json
29
+ php artisan translations:add vendor/typicms/pages/src/lang/fr.json
30
30
```
31
31
32
- Every translations present in this file will be added to ``` /resources/ lang/fr.json`` ` .
32
+ Every translations present in this file will be added to ` / lang/fr.json` .
33
33
34
34
### Add translations from a directory
35
35
36
36
``` php
37
- php artisan translations:add vendor/typicms/pages/src/resources/ lang
37
+ php artisan translations:add vendor/typicms/pages/src/lang
38
38
```
39
39
40
- Every translations found in this directory will be added to ``` /resources/ lang`` `
40
+ Every translations found in this directory will be added to ` / lang`
41
41
42
42
### Overwrite translations
43
43
44
- By default, translation keys will not be overwritten. You can use the ``` --force `` ` option to overwrite existing keys:
44
+ By default, translation keys will not be overwritten. You can use the ` --force ` option to overwrite existing keys:
45
45
46
46
### Remove translations
47
47
48
48
``` php
49
- php artisan translations:remove vendor/typicms/pages/src/resources/ lang[/lg.json]
49
+ php artisan translations:remove vendor/typicms/pages/src/lang[/lg.json]
50
50
```
51
51
52
- Every translations found in this file/directory will be removed from ``` /resources/lang ```
53
-
52
+ Every translations found in this file/directory will be removed from ` /lang `
54
53
55
54
``` php
56
- php artisan translations:add vendor/typicms/pages/src/resources/ lang --force
55
+ php artisan translations:add vendor/typicms/pages/src/lang --force
57
56
```
58
57
59
58
## Changelog
Original file line number Diff line number Diff line change 16
16
}
17
17
],
18
18
"require" : {
19
- "php" : " ^7.0|^8.0"
20
- },
21
- "require-dev" : {
22
- "phpunit/phpunit" : " ^6.0"
19
+ "php" : " ^8.0.2" ,
20
+ "illuminate/console" : " ^9.0" ,
21
+ "illuminate/filesystem" : " ^9.0"
23
22
},
24
23
"autoload" : {
25
24
"psr-4" : {
Original file line number Diff line number Diff line change @@ -22,14 +22,15 @@ class AddTranslations extends AbstractTranslations
22
22
public function handle ()
23
23
{
24
24
foreach ($ this ->getFiles () as $ file ) {
25
- $ targetDirectory = resource_path ( ' lang ' );
25
+ $ targetDirectory = lang_path ( );
26
26
$ targetPath = $ targetDirectory .'/ ' .$ file ->getBasename ();
27
27
if ($ this ->files ->missing ($ targetDirectory )) {
28
28
$ this ->files ->makeDirectory ($ targetDirectory );
29
29
}
30
30
if ($ this ->files ->missing ($ targetPath )) {
31
31
$ this ->files ->copy ($ file ->getPathname (), $ targetPath );
32
32
$ this ->info ($ targetPath .' created. ' );
33
+
33
34
continue ;
34
35
}
35
36
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class RemoveTranslations extends AbstractTranslations
21
21
public function handle ()
22
22
{
23
23
foreach ($ this ->getFiles () as $ file ) {
24
- $ mainFile = resource_path ( ' lang/ ' . basename ($ file ));
24
+ $ mainFile = lang_path ( basename ($ file ));
25
25
26
26
$ existingTranslations = $ this ->getTranslations ($ mainFile );
27
27
$ newTranslations = $ this ->getTranslations ($ file );
You can’t perform that action at this time.
0 commit comments