src/Manager.php
public function fillKeys($fileName, array $keys)
    {
        $appends = [];

        foreach ($keys as $key => $values) {
            foreach ($values as $languageKey => $value) {
                $filePath = $this->path."/{$languageKey}/{$fileName}.php";

                Arr::set($appends[$filePath], $key, $value);
            }
        }

        foreach ($appends as $filePath => $values) {
            $fileContent = $this->getFileContent($filePath, true);

            $newContent = array_replace_recursive($fileContent, $values);

            $this->writeFile($filePath, $newContent);
        }
    }
public function fillKeys($fileName, array $keys)
    {
        $appends = [];

        foreach ($keys as $key => $values) {
            foreach ($values as $languageKey => $value) {
                $filePath = $this->path."/{$languageKey}/{$fileName}.php";

                Arr::set($appends[$filePath], $key, $value);
            }
        }

        foreach ($appends as $filePath => $values) {
            $fileContent = $this->getFileContent($filePath, true);

            $newContent = array_replace_recursive($fileContent, $values);

            $this->writeFile($filePath, $newContent);
        }
    }
public function fillKeys ( $ fileName , array $ keys ) { $ appends = [ ] ; foreach ( $ keys as $ key => $ values ) { foreach ( $ values as $ languageKey => $ value ) { $ filePath = $ this -> path . "/{$languageKey}/{$fileName}.php" ; Arr :: set ( $ appends [ $ filePath ] , $ key , $ value ) ; } } foreach ( $ appends as $ filePath => $ values ) { $ fileContent = $ this -> getFileContent ( $ filePath , true ) ; $ newContent = array_replace_recursive ( $ fileContent , $ values ) ; $ this -> writeFile ( $ filePath , $ newContent ) ; } }
Fills translation lines for given keys in different languages.

ex. for $keys = ['name' => ['en' => 'name', 'nl' => 'naam']

@param string $fileName
@param array $keys
@return void
Fills translation lines for given keys in different languages .