protected function processNewLemmas($family, array $new_lemmas = [], array $old_lemmas = [])
    {
        // Get new lemmas
        $lemmas = array_diff_key($new_lemmas, $old_lemmas);

        // Remove any never obsolete values
        if ($this->config('ask_for_value') === false) {
            $lemmas = array_filter($lemmas, function ($key) {
                if ($this->neverObsolete($key)) {
                    $this->line("        <comment>Manually add:</comment> <info>{$key}</info>");
                    $this->has_new = true;

                    return false;
                }

                return true;
            }, ARRAY_FILTER_USE_KEY);
        }

        // Process new lemmas
        if (count($lemmas) > 0) {
            $this->is_dirty = true;
            $this->has_new = true;

            // Sort lemmas by key
            ksort($lemmas);

            $this->info("    " . count($lemmas) . " new strings to translate");

            foreach ($lemmas as $key => $path) {
                $value = $this->decodeKey($key);

                // Only ask for feedback when it's not a dirty check
                if ($this->option('dirty') === false && $this->config('ask_for_value') === true) {
                    $value = $this->ask(
                        "{$family}.{$value}", $this->createSuggestion($value)
                    );
                }

                if ($this->option('verbose')) {
                    $this->line("        <info>{$key}</info> in " . $this->getShortPath($path));
                }

                Arr::set($this->final_lemmas,
                    $key, str_replace('%LEMMA', $value, $this->option('new-value'))
                );
            }

            return true;
        }

        return false;
    }
protected function processNewLemmas($family, array $new_lemmas = [], array $old_lemmas = [])
    {
        // Get new lemmas
        $lemmas = array_diff_key($new_lemmas, $old_lemmas);

        // Remove any never obsolete values
        if ($this->config('ask_for_value') === false) {
            $lemmas = array_filter($lemmas, function ($key) {
                if ($this->neverObsolete($key)) {
                    $this->line("        <comment>Manually add:</comment> <info>{$key}</info>");
                    $this->has_new = true;

                    return false;
                }

                return true;
            }, ARRAY_FILTER_USE_KEY);
        }

        // Process new lemmas
        if (count($lemmas) > 0) {
            $this->is_dirty = true;
            $this->has_new = true;

            // Sort lemmas by key
            ksort($lemmas);

            $this->info("    " . count($lemmas) . " new strings to translate");

            foreach ($lemmas as $key => $path) {
                $value = $this->decodeKey($key);

                // Only ask for feedback when it's not a dirty check
                if ($this->option('dirty') === false && $this->config('ask_for_value') === true) {
                    $value = $this->ask(
                        "{$family}.{$value}", $this->createSuggestion($value)
                    );
                }

                if ($this->option('verbose')) {
                    $this->line("        <info>{$key}</info> in " . $this->getShortPath($path));
                }

                Arr::set($this->final_lemmas,
                    $key, str_replace('%LEMMA', $value, $this->option('new-value'))
                );
            }

            return true;
        }

        return false;
    }
protected function processNewLemmas ( $ family , array $ new_lemmas = [ ] , array $ old_lemmas = [ ] ) { // Get new lemmas $ lemmas = array_diff_key ( $ new_lemmas , $ old_lemmas ) ; // Remove any never obsolete values if ( $ this -> config ( 'ask_for_value' ) === false ) { $ lemmas = array_filter ( $ lemmas , function ( $ key ) { if ( $ this -> neverObsolete ( $ key ) ) { $ this -> line ( "        <comment>Manually add:</comment> <info>{$key}</info>" ) ; $ this -> has_new = true ; return false ; } return true ; } , ARRAY_FILTER_USE_KEY ) ; } // Process new lemmas if ( count ( $ lemmas ) > 0 ) { $ this -> is_dirty = true ; $ this -> has_new = true ; // Sort lemmas by key ksort ( $ lemmas ) ; $ this -> info ( "    " . count ( $ lemmas ) . " new strings to translate" ) ; foreach ( $ lemmas as $ key => $ path ) { $ value = $ this -> decodeKey ( $ key ) ; // Only ask for feedback when it's not a dirty check if ( $ this -> option ( 'dirty' ) === false && $ this -> config ( 'ask_for_value' ) === true ) { $ value = $ this -> ask ( "{$family}.{$value}" , $ this -> createSuggestion ( $ value ) ) ; } if ( $ this -> option ( 'verbose' ) ) { $ this -> line ( "        <info>{$key}</info> in " . $ this -> getShortPath ( $ path ) ) ; } Arr :: set ( $ this -> final_lemmas , $ key , str_replace ( '%LEMMA' , $ value , $ this -> option ( 'new-value' ) ) ) ; } return true ; } return false ; }
Process new lemmas.

@param string $family
@param array  $new_lemmas
@param array  $old_lemmas

@return bool
Process new lemmas .