Fixed phrases import from old system to the new one

This commit is contained in:
Paolo
2025-11-03 16:32:37 +01:00
parent 16ebbc324e
commit bc2fb32e3e
2 changed files with 7 additions and 127 deletions
+7 -4
View File
@@ -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,
'<?php'."\n\n".'$phrases = array('."\n".');'
'<?php'."\n\n".'$phrases = array();'
) === false);
}
-123
View File
@@ -1,123 +0,0 @@
<?php
$phrases = array(
array (
'app' => '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',
),
),
)
);