Skip to content

Commit 9f9d242

Browse files
author
Norton Grådi
committed
Merge pull request #27 from RockKeeper/master
Update LocalizationMissing.php
2 parents 937f45e + a343442 commit 9f9d242

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Potsky/LaravelLocalizationHelpers/Command/LocalizationMissing.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,12 @@ public function fire()
339339
$welcome_lemmas = array_diff_key( $new_lemmas , $old_lemmas );
340340
$already_lemmas = array_intersect_key( $old_lemmas , $new_lemmas );
341341

342+
// disable check for obsolete lemma and consolidate with already_lemmas
343+
if ( $this->option( 'disable-obsolete-check' ) ){
344+
$already_lemmas = array_unique($obsolete_lemmas + $already_lemmas);
345+
$obsolete_lemmas = [];
346+
}
347+
342348
ksort( $obsolete_lemmas );
343349
ksort( $welcome_lemmas );
344350
ksort( $already_lemmas );
@@ -668,9 +674,10 @@ protected function getOptions()
668674
array( 'no-comment' , 'c' , InputOption::VALUE_NONE , 'Do not add comments in lang files for lemma definition' ) ,
669675
array( 'no-date' , 'd' , InputOption::VALUE_NONE , 'Do not add the date of execution in the lang files' ) ,
670676
array( 'no-obsolete' , 'o' , InputOption::VALUE_NONE , 'Do not write obsolete lemma' ) ,
671-
array( 'output-flat' , 'of' , InputOption::VALUE_NONE , 'Output arrays are flat (do not use sub-arrays and keep dots in lemma)' ) ,
677+
array( 'output-flat' , 'w' , InputOption::VALUE_NONE , 'Output arrays are flat (do not use sub-arrays and keep dots in lemma)' ) ,
672678
array( 'silent' , 's' , InputOption::VALUE_NONE , 'Use this option to only return the exit code (use $? in shell to know whether there are missing lemma or nt)' ) ,
673-
array( 'php-file-extension' , 'ex' , InputOption::VALUE_OPTIONAL , 'PHP file extension' , 'php' ) ,
679+
array( 'php-file-extension' , 'x' , InputOption::VALUE_OPTIONAL , 'PHP file extension' , 'php' ) ,
680+
array( 'disable-obsolete-check' , 'z' , InputOption::VALUE_NONE , 'Use this option to disable check for obsolete lemmas' ) ,
674681
);
675682
}
676683

0 commit comments

Comments
 (0)