Skip to content

Commit

Permalink
Merge pull request #11 from kg-bot/analysis-q1Oy3v
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
kg-bot authored Jun 24, 2018
2 parents 90a3208 + 6184255 commit 0e57a68
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
21 changes: 10 additions & 11 deletions src/Console/Commands/ExportMessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace KgBot\LaravelLocalization\Console\Commands;

use Illuminate\Console\Command;
use KgBot\LaravelLocalization\Facades\ExportLocalizations;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local;
use KgBot\LaravelLocalization\Facades\ExportLocalizations;

class ExportMessages extends Command
{
Expand Down Expand Up @@ -42,19 +42,18 @@ public function handle()
{
$messages = ExportLocalizations::export()->toArray();

$filepath = config( 'laravel-localization.js.filepath', resource_path( 'assets/js' ) );
$filename = config( 'laravel-localization.js.filename', 'll_messages.js' );

$adapter = new Local( $filepath );
$filesystem = new Filesystem( $adapter );
$filepath = config('laravel-localization.js.filepath', resource_path('assets/js'));
$filename = config('laravel-localization.js.filename', 'll_messages.js');

$contents = 'export default messages = ' . json_encode( $messages );
$adapter = new Local($filepath);
$filesystem = new Filesystem($adapter);

$filesystem->write( $filename, $contents );
$contents = 'export default messages = '.json_encode($messages);

$filesystem->write($filename, $contents);

$this->info( 'Messages exported to JavaScript file, you can find them at ' . $filepath . DIRECTORY_SEPARATOR
. $filename );
$this->info('Messages exported to JavaScript file, you can find them at '.$filepath.DIRECTORY_SEPARATOR
.$filename);

return true;
}
Expand Down
16 changes: 8 additions & 8 deletions src/config/laravel-localization.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* Route prefix, example of route http://localhost/js/localizations.js
*
*/
'prefix' => env( 'LARAVEL_LOCALIZATION_PREFIX', '/js/localization.js' ),
'prefix' => env('LARAVEL_LOCALIZATION_PREFIX', '/js/localization.js'),

/*
* Route name, defaults to assets.lang
*/
'name' => env( 'LARAVEL_LOCALIZATION_ROUTE_NAME', 'assets.lang' ),
'name' => env('LARAVEL_LOCALIZATION_ROUTE_NAME', 'assets.lang'),

/*
* Middleware used on localization routes.
Expand All @@ -28,8 +28,8 @@
*
* Don't use space in .env directive after ,
*/
'middleware' => ( env( 'LARAVEL_LOCALIZATION_MIDDLEWARE' ) ) ?
explode( ',', env( 'LARAVEL_LOCALIZATION_MIDDLEWARE' ) )
'middleware' => (env('LARAVEL_LOCALIZATION_MIDDLEWARE')) ?
explode(',', env('LARAVEL_LOCALIZATION_MIDDLEWARE'))
: [],
],
'events' => [
Expand All @@ -39,7 +39,7 @@
*
* Here you can change channel on which events will broadcast
*/
'channel' => env( 'LARAVEL_LOCALIZATION_EVENTS_CHANNEL', '' ),
'channel' => env('LARAVEL_LOCALIZATION_EVENTS_CHANNEL', ''),
],
'caches' => [

Expand All @@ -60,12 +60,12 @@
],
'js' => [

/**
/*
* root location to where JavaScript file will be exported
*/
'filepath' => resource_path( 'assets/js' ),
'filepath' => resource_path('assets/js'),

/**
/*
* File name for JavaScript file with exported messages
*/
'filename' => 'll_messages.js',
Expand Down

0 comments on commit 0e57a68

Please sign in to comment.