src/Commands/TransCommand.php
private function fillKey()
    {
        $languages = $this->manager->languages();

        if ($this->languageKey) {
            if (! in_array($this->languageKey, $languages)) {
                $this->error(sprintf('Language (%s) could not be found!', $this->languageKey));

                return;
            }

            // If a language key was specified then we prompt for it only.
            $languages = [$this->languageKey];
        }

        $values = $this->collectValues($languages);

        $this->manager->fillKeys(
            str_replace($this->packageName.'::', '', $this->fileName),
            [$this->key => $values]
        );

        foreach ($values as $languageKey => $value) {
            $this->line("<fg=yellow>{$this->fileName}.{$this->key}:{$languageKey}</> was set to \"<fg=yellow>{$value}</>\" successfully.");
        }
    }
private function fillKey()
    {
        $languages = $this->manager->languages();

        if ($this->languageKey) {
            if (! in_array($this->languageKey, $languages)) {
                $this->error(sprintf('Language (%s) could not be found!', $this->languageKey));

                return;
            }

            // If a language key was specified then we prompt for it only.
            $languages = [$this->languageKey];
        }

        $values = $this->collectValues($languages);

        $this->manager->fillKeys(
            str_replace($this->packageName.'::', '', $this->fileName),
            [$this->key => $values]
        );

        foreach ($values as $languageKey => $value) {
            $this->line("<fg=yellow>{$this->fileName}.{$this->key}:{$languageKey}</> was set to \"<fg=yellow>{$value}</>\" successfully.");
        }
    }
private function fillKey ( ) { $ languages = $ this -> manager -> languages ( ) ; if ( $ this -> languageKey ) { if ( ! in_array ( $ this -> languageKey , $ languages ) ) { $ this -> error ( sprintf ( 'Language (%s) could not be found!' , $ this -> languageKey ) ) ; return ; } // If a language key was specified then we prompt for it only. $ languages = [ $ this -> languageKey ] ; } $ values = $ this -> collectValues ( $ languages ) ; $ this -> manager -> fillKeys ( str_replace ( $ this -> packageName . '::' , '' , $ this -> fileName ) , [ $ this -> key => $ values ] ) ; foreach ( $ values as $ languageKey => $ value ) { $ this -> line ( "<fg=yellow>{$this->fileName}.{$this->key}:{$languageKey}</> was set to \"<fg=yellow>{$value}</>\" successfully." ) ; } }
Fill a translation key in all languages.

@return void
Fill a translation key in all languages .