diff --git a/application/libraries/PhrasesLib.php b/application/libraries/PhrasesLib.php index 70d6968b4..6bea30b37 100644 --- a/application/libraries/PhrasesLib.php +++ b/application/libraries/PhrasesLib.php @@ -312,12 +312,15 @@ class PhrasesLib // If an error occurred then exit if ($line === false && !feof($srcFileHandle)) return false; - // Search for the end of the array - if (stristr($line, ');')) + // If the first phrase or the end of the array + if ($line == '$phrases = array();' || stristr($line, ');')) { + $first_coma = ','; + if ($line == '$phrases = array();') $first_coma = ''; + // If found then append the new phrase to the current line // and replace the end of the array - $line = str_replace(');', ",\n".var_export($phrase, true)."\n".');', $line); + $line = str_replace(');', $first_coma."\n".var_export($phrase, true)."\n".');', $line); } // In any case copy the line to the temp file @@ -345,7 +348,7 @@ class PhrasesLib { return !(file_put_contents( $phrasesCategoryFile, - ' 'core', - 'category' => 'extensions', - 'phrase' => 'title', - 'insertvon' => 'system', - 'phrases' => - array ( - 0 => - array ( - 'sprache' => 'German', - 'text' => 'Extensions manager', - 'description' => '', - 'insertvon' => 'system', - ), - 1 => - array ( - 'sprache' => 'English', - 'text' => 'Extensions manager', - 'description' => '', - 'insertvon' => 'system', - ), - ), -) -, -array ( - 'app' => 'core', - 'category' => 'extensions', - 'phrase' => 'uploadExtension', - 'insertvon' => 'system', - 'phrases' => - array ( - 0 => - array ( - 'sprache' => 'German', - 'text' => 'Upload extensions package', - 'description' => '', - 'insertvon' => 'system', - ), - 1 => - array ( - 'sprache' => 'English', - 'text' => 'Upload extensions package', - 'description' => '', - 'insertvon' => 'system', - ), - ), -) -, -array ( - 'app' => 'core', - 'category' => 'extensions', - 'phrase' => 'performSql', - 'insertvon' => 'system', - 'phrases' => - array ( - 0 => - array ( - 'sprache' => 'German', - 'text' => 'Execute SQL?', - 'description' => '', - 'insertvon' => 'system', - ), - 1 => - array ( - 'sprache' => 'English', - 'text' => 'Execute SQL?', - 'description' => '', - 'insertvon' => 'system', - ), - ), -) -, -array ( - 'app' => 'core', - 'category' => 'extensions', - 'phrase' => 'changeSuccess', - 'insertvon' => 'system', - 'phrases' => - array ( - 0 => - array ( - 'sprache' => 'German', - 'text' => 'Changes applied successfully', - 'description' => '', - 'insertvon' => 'system', - ), - 1 => - array ( - 'sprache' => 'English', - 'text' => 'Changes applied successfully', - 'description' => '', - 'insertvon' => 'system', - ), - ), -) -, -array ( - 'app' => 'core', - 'category' => 'extensions', - 'phrase' => 'changeError', - 'insertvon' => 'system', - 'phrases' => - array ( - 0 => - array ( - 'sprache' => 'German', - 'text' => 'An error occurred while applying the changes', - 'description' => '', - 'insertvon' => 'system', - ), - 1 => - array ( - 'sprache' => 'English', - 'text' => 'An error occurred while applying the changes', - 'description' => '', - 'insertvon' => 'system', - ), - ), -) -);