Skip to content

Commit f912a5d

Browse files
committed
Merge branch 'master' of github.com:potsky/laravel-localization-helpers
2 parents cdc750e + e426908 commit f912a5d

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,23 @@ else
131131
fi
132132
```
133133

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

136+
```
137+
php artisan localization:missing -r
138+
```
139+
140+
##### Open all must-edit files at the end of the process
141+
142+
```
143+
php artisan localization:missing -e
144+
```
145+
146+
You can edit the editor path in your configuration file. By default, editor is *Sublime Text* on *Mac OS X* :
147+
148+
```
149+
'editor_command_line' => '/Applications/Sublime\\ Text.app/Contents/SharedSupport/bin/subl'
150+
```
135151

136152
### Command `localization:find`
137153

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"license" : "GPL-3.0+",
1212
"require" : {
1313
"php" : ">=5.3.0",
14-
"illuminate/support" : "~4.1"
14+
"illuminate/support" : ">=4.1"
1515
},
1616
"autoload" : {
1717
"classmap" : [

src/Potsky/LaravelLocalizationHelpers/Commands/LocalizationMissing.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,18 +316,24 @@ public function fire()
316316
}
317317

318318
$this->line( 'Save files:' );
319+
$open_files = '';
319320
foreach ($job as $file_lang_path => $file_content) {
320321
if ( ! $this->option( 'dry-run' ) ) {
321322
file_put_contents( $file_lang_path , $file_content );
322323
}
323324
$this->line( " <info>" . $this->get_short_path( $file_lang_path ) );
324325
if ( $this->option('editor') ) {
325-
exec( $this->editor . ' ' . $file_lang_path );
326+
$open_files.= ' ' . escapeshellarg( $file_lang_path );
326327
}
327328
}
328329
$this->line( '' );
329330

330331
$this->info( 'Process done!' );
332+
333+
if ( $this->option('editor') ) {
334+
exec( $this->editor . $open_files );
335+
}
336+
331337
} else {
332338
$this->line( '' );
333339
$this->comment( 'Process aborted. No file have been changed.' );

src/config/config.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
'Lang::Get' => array(
5454
'@Lang::Get\(\s*(\'.*\')\s*(,.*)*\)@U',
5555
'@Lang::Get\(\s*(".*")\s*(,.*)*\)@U',
56+
'@Lang::get\(\s*(\'.*\')\s*(,.*)*\)@U',
57+
'@Lang::get\(\s*(".*")\s*(,.*)*\)@U',
5658
),
5759
'trans_choice' => array(
5860
'@trans_choice\(\s*(\'.*\')\s*,.*\)@U',

0 commit comments

Comments
 (0)