diff --git a/locale/extract-db-locale-terms.php b/locale/extract-db-locale-terms.php index d0566ceccf..979e7e4b77 100644 --- a/locale/extract-db-locale-terms.php +++ b/locale/extract-db-locale-terms.php @@ -1,26 +1,28 @@ query($query) as $row) { - $stringFile = $stringsDir.DIRECTORY_SEPARATOR.$row['cntx'].'.php'; + $stringFile = $stringsDir . DIRECTORY_SEPARATOR . $row['cntx'] . '.php'; if (!is_file($stringFile)) { file_put_contents($stringFile, "", FILE_APPEND); + file_put_contents($stringFile, "\r\n?>" . "\r\n", FILE_APPEND); } - $stringFile = $stringsDir.DIRECTORY_SEPARATOR.'settings-countries.php'; + // Create and populate settings-countries.php + $stringFile = $stringsDir . DIRECTORY_SEPARATOR . 'settings-countries.php'; require '../src/ChurchCRM/data/Countries.php'; require '../src/ChurchCRM/data/Country.php'; + file_put_contents($stringFile, "", FILE_APPEND); - $stringFile = $stringsDir.DIRECTORY_SEPARATOR.'settings-locales.php'; + file_put_contents($stringFile, "\r\n?>" . "\r\n", FILE_APPEND); + + // Create and populate settings-locales.php + $stringFile = $stringsDir . DIRECTORY_SEPARATOR . 'settings-locales.php'; file_put_contents($stringFile, " $value) { - file_put_contents($stringFile, 'gettext("'.$key."\");\r\n", FILE_APPEND); + file_put_contents($stringFile, "gettext('" . $key . "');\r\n", FILE_APPEND); } - file_put_contents($stringFile, "\r\n?>", FILE_APPEND); - echo $stringFile.' updated'; + + file_put_contents($stringFile, "\r\n?>" . "\r\n", FILE_APPEND); + + echo $stringFile . ' updated' . PHP_EOL; } } else { - echo "ERROR: The file $filename does not exist \n"; + echo "ERROR: The file $filename does not exist" . PHP_EOL; } -echo "\n\n=============================================== \n"; -echo "========== Building locale from DB end === \n"; -echo "=============================================== \n"; + +echo <<