3
3
namespace Barryvdh \TranslationManager ;
4
4
5
5
use Illuminate \Support \Arr ;
6
+ use Illuminate \Support \Str ;
6
7
use Symfony \Component \Finder \Finder ;
7
8
use Illuminate \Filesystem \Filesystem ;
8
9
use Illuminate \Contracts \Events \Dispatcher ;
@@ -259,13 +260,13 @@ public function exportTranslations($group = null, $json = false)
259
260
if ($ group == '* ' ) {
260
261
return $ this ->exportAllTranslations ();
261
262
} else {
262
- if (starts_with ($ group , 'vendor ' )) {
263
+ if (Str:: startsWith ($ group , 'vendor ' )) {
263
264
$ vendor = true ;
264
265
}
265
266
}
266
267
267
268
$ tree = $ this ->makeTree (Translation::ofTranslatedGroup ($ group )
268
- ->orderByGroupKeys (array_get ($ this ->config , 'sort_keys ' , false ))
269
+ ->orderByGroupKeys (Arr:: get ($ this ->config , 'sort_keys ' , false ))
269
270
->get ());
270
271
271
272
foreach ($ tree as $ locale => $ groups ) {
@@ -276,7 +277,7 @@ public function exportTranslations($group = null, $json = false)
276
277
$ locale_path = $ locale .DIRECTORY_SEPARATOR .$ group ;
277
278
if ($ vendor ) {
278
279
$ path = $ basePath .'/ ' .$ group .'/ ' .$ locale ;
279
- $ locale_path = str_after ($ group , '/ ' );
280
+ $ locale_path = Str:: after ($ group , '/ ' );
280
281
}
281
282
$ subfolders = explode (DIRECTORY_SEPARATOR , $ locale_path );
282
283
array_pop ($ subfolders );
@@ -303,7 +304,7 @@ public function exportTranslations($group = null, $json = false)
303
304
304
305
if ($ json ) {
305
306
$ tree = $ this ->makeTree (Translation::ofTranslatedGroup (self ::JSON_GROUP )
306
- ->orderByGroupKeys (array_get ($ this ->config , 'sort_keys ' , false ))
307
+ ->orderByGroupKeys (Arr:: get ($ this ->config , 'sort_keys ' , false ))
307
308
->get (), true );
308
309
309
310
foreach ($ tree as $ locale => $ groups ) {
@@ -344,7 +345,7 @@ protected function makeTree($translations, $json = false)
344
345
$ this ->jsonSet ($ array [$ translation ->locale ][$ translation ->group ], $ translation ->key ,
345
346
$ translation ->value );
346
347
} else {
347
- array_set ($ array [$ translation ->locale ][$ translation ->group ], $ translation ->key ,
348
+ Arr:: set ($ array [$ translation ->locale ][$ translation ->group ], $ translation ->key ,
348
349
$ translation ->value );
349
350
}
350
351
}
0 commit comments