8
8
[ ![ License] ( https://poser.pugx.org/lukasss93/laravel-larex/license )] ( https://packagist.org/packages/lukasss93/laravel-larex )
9
9
![ GitHub Workflow Status] ( https://img.shields.io/github/workflow/status/Lukasss93/laravel-larex/run-tests )
10
10
[ ![ Coveralls github] ( https://img.shields.io/coveralls/github/Lukasss93/laravel-larex )] ( https://coveralls.io/github/Lukasss93/laravel-larex )
11
- [ ![ Chat] ( https://img.shields.io/badge/chat-on%20telegram -blue )] ( https://t.me/Lukasss93 )
11
+ [ ![ Chat] ( https://img.shields.io/badge/chat%20on-telegram -blue )] ( https://t.me/Lukasss93 )
12
12
13
13
Translate your Laravel application from a single CSV file!
14
14
@@ -39,15 +39,15 @@ This step *can be skipped* if package auto-discovery is enabled.
39
39
40
40
2 . Open the * project-root/resources/lang/localization.csv* file and edit it as you see fit.
41
41
42
- 3 . Finally, you can use ` php artisan larex ` to translate your entries from the csv file to the laravel php files.
42
+ 3 . Finally, you can use ` php artisan larex:export ` to translate your entries from the csv file to the laravel php files.
43
43
44
44
### Tips
45
45
* You can import existing laravel php files with ` php artisan larex:import ` .
46
46
* You can use ` php artisan larex:init --base ` to init the CSV file with default Laravel entries.
47
47
* The ** key** column inside the CSV file supports the ** dot notation** for nested arrays.
48
48
* You can watch your CSV file with ` php artisan larex --watch `
49
49
* You can use ` php artisan larex:sort ` to sort the CSV file by group and key.
50
- * Be careful when using the ` php artisan larex ` command! It will overwrite all files named with the group names inside the CSV.
50
+ * Be careful when using the ` php artisan larex:export ` command! It will overwrite all files named with the group names inside the CSV.
51
51
* Be careful when using the ** dot notation** ! Only the ** last** entry will override the value.
52
52
53
53
### Example
@@ -57,9 +57,10 @@ This step *can be skipped* if package auto-discovery is enabled.
57
57
| group | key | en | it |
58
58
| ---| ---| ---| ---|
59
59
| app | hello | Hello | Ciao |
60
- | app | developers | Developers | Sviluppatori |
60
+ | app | list.developers | Developers | Sviluppatori |
61
+ | app | list.teachers | Teachers | Insegnanti |
61
62
62
- 3 . Run ` php artisan larex ` command
63
+ 3 . Run ` php artisan larex:export ` command
63
64
4 . You'll get the following files:
64
65
``` php
65
66
//project-root/resources/lang/en/app.php
@@ -68,7 +69,10 @@ This step *can be skipped* if package auto-discovery is enabled.
68
69
69
70
return [
70
71
'hello' => 'Hello',
71
- 'developers' => 'Developers',
72
+ 'list' => [
73
+ 'developers' => 'Developers',
74
+ 'teachers' => 'Teachers',
75
+ ]
72
76
];
73
77
74
78
//project-root/resources/lang/it/app.php
@@ -77,7 +81,10 @@ This step *can be skipped* if package auto-discovery is enabled.
77
81
78
82
return [
79
83
'hello' => 'Ciao',
80
- 'developers' => 'Sviluppatori',
84
+ 'list' => [
85
+ 'developers' => 'Sviluppatori',
86
+ 'teachers' => 'Insegnanti',
87
+ ]
81
88
];
82
89
```
83
90
0 commit comments