src/Gelembjuk/Locale/Utils.php
public function fixMissedKeysFromList($lines,$group,$locale,$deflocale,$skipfiles = true, $textlinesplitter = "\n") {
		$list = $this->getEmptyKeysWithDefValues($group,$locale,$deflocale,$skipfiles);
		
		if (count($list) != count($lines)) {
			throw new \Exception(sprintf('Wrong count of input lines. %d vs %d',count($list),count($lines)));
		}
		
		$translate = $this->getTranslateObject(true);
		
		$translate->setLocale($locale);
		
		try {
			$translates = $translate->getDataForGroup($group);
		} catch (\Exception $e) {
			$translates = array();
		}
		// assign new values and keys
		foreach ($list as $key => $value) {
			$value = array_shift($lines);
			
			$translates[$key] = $value;
		}
		
		$groupfile = $translate->getGroupFile($group,$locale);
		
		array_walk($translates, function(&$value, $key) { $value = "$key = $value"; });
		
		$groupfilecontents .= implode($textlinesplitter,$translates).$textlinesplitter;
		
		file_put_contents($groupfile,$groupfilecontents);
		
		return true;
	}
public function fixMissedKeysFromList($lines,$group,$locale,$deflocale,$skipfiles = true, $textlinesplitter = "\n") {
		$list = $this->getEmptyKeysWithDefValues($group,$locale,$deflocale,$skipfiles);
		
		if (count($list) != count($lines)) {
			throw new \Exception(sprintf('Wrong count of input lines. %d vs %d',count($list),count($lines)));
		}
		
		$translate = $this->getTranslateObject(true);
		
		$translate->setLocale($locale);
		
		try {
			$translates = $translate->getDataForGroup($group);
		} catch (\Exception $e) {
			$translates = array();
		}
		// assign new values and keys
		foreach ($list as $key => $value) {
			$value = array_shift($lines);
			
			$translates[$key] = $value;
		}
		
		$groupfile = $translate->getGroupFile($group,$locale);
		
		array_walk($translates, function(&$value, $key) { $value = "$key = $value"; });
		
		$groupfilecontents .= implode($textlinesplitter,$translates).$textlinesplitter;
		
		file_put_contents($groupfile,$groupfilecontents);
		
		return true;
	}
public function fixMissedKeysFromList ( $ lines , $ group , $ locale , $ deflocale , $ skipfiles = true , $ textlinesplitter = "\n" ) { $ list = $ this -> getEmptyKeysWithDefValues ( $ group , $ locale , $ deflocale , $ skipfiles ) ; if ( count ( $ list ) != count ( $ lines ) ) { throw new \ Exception ( sprintf ( 'Wrong count of input lines. %d vs %d' , count ( $ list ) , count ( $ lines ) ) ) ; } $ translate = $ this -> getTranslateObject ( true ) ; $ translate -> setLocale ( $ locale ) ; try { $ translates = $ translate -> getDataForGroup ( $ group ) ; } catch ( \ Exception $ e ) { $ translates = array ( ) ; } // assign new values and keys foreach ( $ list as $ key => $ value ) { $ value = array_shift ( $ lines ) ; $ translates [ $ key ] = $ value ; } $ groupfile = $ translate -> getGroupFile ( $ group , $ locale ) ; array_walk ( $ translates , function ( & $ value , $ key ) { $ value = "$key = $value" ; } ) ; $ groupfilecontents .= implode ( $ textlinesplitter , $ translates ) . $ textlinesplitter ; file_put_contents ( $ groupfile , $ groupfilecontents ) ; return true ; }
Receives a group of values as a list and assigns to missed keys in a group of locale.
It can be used to quick translate of values as text file with a value per line.

@param string $group Translation group
@param string $locale Locale to compare to default locale
@param string $deflocale Default locale to use as a base for comparing
@param bool $skipfiles If to skip keys pointing to files with a text

@return bool
Receives a group of values as a list and assigns to missed keys in a group of locale . It can be used to quick translate of values as text file with a value per line .