Skip to content

Commit

Permalink
Merge branch 'master' of github.com:potsky/laravel-localization-helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
potsky committed Oct 3, 2014
2 parents cdc750e + e426908 commit f912a5d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,23 @@ else
fi
```

##### Simulate all operations (do not write anything) with a dry run

```
php artisan localization:missing -r
```

##### Open all must-edit files at the end of the process

```
php artisan localization:missing -e
```

You can edit the editor path in your configuration file. By default, editor is *Sublime Text* on *Mac OS X* :

```
'editor_command_line' => '/Applications/Sublime\\ Text.app/Contents/SharedSupport/bin/subl'
```

### Command `localization:find`

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"license" : "GPL-3.0+",
"require" : {
"php" : ">=5.3.0",
"illuminate/support" : "~4.1"
"illuminate/support" : ">=4.1"
},
"autoload" : {
"classmap" : [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,24 @@ public function fire()
}

$this->line( 'Save files:' );
$open_files = '';
foreach ($job as $file_lang_path => $file_content) {
if ( ! $this->option( 'dry-run' ) ) {
file_put_contents( $file_lang_path , $file_content );
}
$this->line( " <info>" . $this->get_short_path( $file_lang_path ) );
if ( $this->option('editor') ) {
exec( $this->editor . ' ' . $file_lang_path );
$open_files.= ' ' . escapeshellarg( $file_lang_path );
}
}
$this->line( '' );

$this->info( 'Process done!' );

if ( $this->option('editor') ) {
exec( $this->editor . $open_files );
}

} else {
$this->line( '' );
$this->comment( 'Process aborted. No file have been changed.' );
Expand Down
2 changes: 2 additions & 0 deletions src/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
'Lang::Get' => array(
'@Lang::Get\(\s*(\'.*\')\s*(,.*)*\)@U',
'@Lang::Get\(\s*(".*")\s*(,.*)*\)@U',
'@Lang::get\(\s*(\'.*\')\s*(,.*)*\)@U',
'@Lang::get\(\s*(".*")\s*(,.*)*\)@U',
),
'trans_choice' => array(
'@trans_choice\(\s*(\'.*\')\s*,.*\)@U',
Expand Down

0 comments on commit f912a5d

Please sign in to comment.