-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathconfig-laravel5.php
executable file
·253 lines (239 loc) · 8.83 KB
/
config-laravel5.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<?php
return [
/*
|--------------------------------------------------------------------------
| Folders where to search for lemmas
|--------------------------------------------------------------------------
|
| Localization::Missing will search recursively for lemmas in all php files
| included in these folders. You can use these keywords :
| - %APP : the laravel app folder of your project
| - %BASE : the laravel base folder of your project
| - %PUBLIC : the laravel public folder of your project
| - %STORAGE : the laravel storage folder of your project
| No error or exception is thrown when a folder does not exist.
|
*/
'folders' => [
'%BASE/resources/views',
'%APP/Http/Controllers',
],
/*
|--------------------------------------------------------------------------
| Lang file to ignore
|--------------------------------------------------------------------------
|
| These lang files will not be written
| You can specify :
| - a family like 'message', 'validation', ...
| - a specific file path like '/resources/lang/de/cms.php'
|
*/
'ignore_lang_files' => [
'validation',
],
/*
|--------------------------------------------------------------------------
| Lang folder
|--------------------------------------------------------------------------
|
| You can overwrite where is located your lang folder
| If null or missing, Localization::Missing will search :
| - first in app_path() . DIRECTORY_SEPARATOR . 'lang',
| - then in base_path() . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'lang',
|
*/
'lang_folder_path' => null,
/*
|--------------------------------------------------------------------------
| Methods or functions to search for
|--------------------------------------------------------------------------
|
| Localization::Missing will search lemmas by using these regular expressions
| Several regular expressions can be used for a single method or function.
|
*/
'trans_methods' => [
'json' => [
'@__\(\s*(\'.*\')\s*(,.*)*\)@U',
'@__\(\s*(".*")\s*(,.*)*\)@U',
],
'trans' => [
'@trans\(\s*(\'.*\')\s*(,.*)*\)@U',
'@trans\(\s*(".*")\s*(,.*)*\)@U',
],
'Lang::Get' => [
'@Lang::Get\(\s*(\'.*\')\s*(,.*)*\)@U',
'@Lang::Get\(\s*(".*")\s*(,.*)*\)@U',
'@Lang::get\(\s*(\'.*\')\s*(,.*)*\)@U',
'@Lang::get\(\s*(".*")\s*(,.*)*\)@U',
],
'trans_choice' => [
'@trans_choice\(\s*(\'.*\')\s*,.*\)@U',
'@trans_choice\(\s*(".*")\s*,.*\)@U',
],
'Lang::choice' => [
'@Lang::choice\(\s*(\'.*\')\s*,.*\)@U',
'@Lang::choice\(\s*(".*")\s*,.*\)@U',
],
'@lang' => [
'@\@lang\(\s*(\'.*\')\s*(,.*)*\)@U',
'@\@lang\(\s*(".*")\s*(,.*)*\)@U',
],
'@choice' => [
'@\@choice\(\s*(\'.*\')\s*,.*\)@U',
'@\@choice\(\s*(".*")\s*,.*\)@U',
],
],
/*
|--------------------------------------------------------------------------
| JSON languages
|--------------------------------------------------------------------------
|
| You must set languages you want to generate in JSON format
|
| JSON langages are supported since Laravel 5.4
| https://laravel.com/docs/5.4/localization#using-translation-strings-as-keys
|
*/
'json_languages' => [
'en',
],
/*
|--------------------------------------------------------------------------
| Keywords for obsolete check
|--------------------------------------------------------------------------
|
| Localization::Missing will search lemmas in existing lang files.
| Then it searches in all PHP source files.
| When using dynamic or auto-generated lemmas, you must tell Localization::Missing
| that there are dynamic because it cannot guess them.
|
| Example :
| - in PHP blade code : <span>{{{ trans( "message.user.dynamo.$s" ) }}}</span>
| - in lang/en.message.php :
| - 'user' => array(
| 'dynamo' => array(
| 'lastname' => 'Family name',
| 'firstname' => 'Name',
| 'email' => 'Email address',
| ...
| Then you can define in this parameter value dynamo for example so that
| Localization::Missing will not exclude lastname, firstname and email from
| translation files.
|
*/
'never_obsolete_keys' => [
'dynamic',
'fields',
],
/*
|--------------------------------------------------------------------------
| Obsolete lemma prefix
|--------------------------------------------------------------------------
|
| If you want to keep obsolete lemma in your lang file, they will be stored
| in a sub-array. If not stored in a sub-array, LLH will not be able to
| separate child lemma.
|
| eg : message.section.dog is used
| message.section.cat is not used anymore
| then : message.section.dog will be kept
| LLH:obsolete.message.section.cat will be generated
|
| : is used in the key because : is a special char in laravel lang lemma and
| : are automatically not scanned by LLH.
|
| Do not change this parameter between 2 commands launch because LLH will not
| be able to find obsolete lemma in the second pass and you will need to
| clean up obsolete lemma manually
|
*/
'obsolete_array_key' => 'LLH:obsolete',
/*
|--------------------------------------------------------------------------
| Editor
|--------------------------------------------------------------------------
|
| when using option editor, package will use this command to open your files
|
*/
'editor_command_line' => '/Applications/Sublime\\ Text.app/Contents/SharedSupport/bin/subl',
/*
|--------------------------------------------------------------------------
| Code Style
|--------------------------------------------------------------------------
|
| You can set rules for the code style applied to the generated lang files.
| Available rules are here : https://github.com/FriendsOfPHP/PHP-CS-Fixer
|
| eg: [
| 'array_syntax' => ['syntax' => 'short'],
| '@PSR2' => true,
| ];
|
*/
'code_style' => [
'rules' => null,
],
/*
|--------------------------------------------------------------------------
| Translator
|--------------------------------------------------------------------------
|
| Use the Microsoft translator by default. This is the only available translator now
|
*/
'translator' => 'Microsoft',
/*
|--------------------------------------------------------------------------
| Translators configuration
|--------------------------------------------------------------------------
|
| Microsoft
|
| #### default_language
|
| Set the default language used in your PHP code. If set to null, the translator
| will try to guess it. The default language in your code is the language you use
| in this PHP line for example :
|
| trans( 'message.This is a message in english' );
|
| Supported languages are : ar, bg, ca, cs, da, de, el, en, es, et, fa, fi, fr,
| he, hi, ht, hu, id, it, ja, ko, lt, lv, ms, mww, nl, no, pl, pt, ro, ru, sk,
| sl, sv, th, tr, uk, ur, vi, zh-CHS, zh-CHT
|
| #### client_key
|
| Package can automatically translate your lemma. Follow instructions to retrieve
| your client key here :
| https://github.com/potsky/microsoft-translator-php-sdk#user-content-2-configuration
|
| If you don't want to set these credentials here, set both to null and set
| environment parameters on your computer/server:
| - LLH_MICROSOFT_TRANSLATOR_CLIENT_KEY
|
*/
'translators' => [
'Microsoft' => [
'default_language' => null,
'client_key' => null,
],
],
/*
|--------------------------------------------------------------------------
| Dot notation split
|--------------------------------------------------------------------------
|
| You can set a regex to detect dots in the dot notation.
|
| The default behavior is /\\./ and null is a shortcut.
| I prefer to set it to /\\.(?=[^ .!?])/ which will ignore all dots followed
| by space, dot, ! and ?
|
| This parameter will change nothing if you use the output-flat option of course
|
*/
'dot_notation_split_regex' => null,
];