summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-27 14:57:41 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-27 14:57:41 -0400
commit645d5270cd1fe69925bc5723a136dbb8cf04f66f (patch)
treedff0fed3b4e083a406ff9948386851912b03b552
parent817a336500b0a264249d72f790dcac6193ccb013 (diff)
downloadtranslate-645d5270cd1fe69925bc5723a136dbb8cf04f66f.tar.gz
translate-645d5270cd1fe69925bc5723a136dbb8cf04f66f.zip
translate: Update update.php to support the new backend
Not switched yet, need to work on it more
-rwxr-xr-xupdate.php27
1 files changed, 19 insertions, 8 deletions
diff --git a/update.php b/update.php
index 324eb54..c38474d 100755
--- a/update.php
+++ b/update.php
@@ -87,17 +87,28 @@ function genstats() {
list($lastrev, $lastupdate) = getlastupdated($lang);
$stat = array('name' => $lang, 'total' => 0, 'missing' => 0, 'desc' => 0, 'source' => 0, 'last_update' => $lastupdate, 'last_update_rev' => $lastrev);
foreach(explode("\n", $output) as $line) {
- switch(trim($line)) {
- case '### This phrase below was not present in the translated file':
+ if (preg_match('/### This phrase below was not present in the translated file/', $line) || // DELETEME
+ preg_match('/### This phrase is missing entirely, copying from english!/', $line)) {
$stat['missing']++;
- break;
- case '### The <source> section differs from the english!':
+ } elseif (preg_match('/### The <source> section differs from the english!/', $line) || // DELETEME
+ preg_match("/### The <source> section for '.*' is missing! Copying from english!/", $line) ||
+ preg_match("/### The <source> section for '.*' differs from the english!/", $line)) {
$stat['source']++;
- break;
- case '### The \'desc\' field differs from the english!':
+ } elseif (preg_match("/### The 'desc' field differs from the english!/", $line) || // DELETEME
+ preg_match("/### The 'desc' field for '.*' differs from the english!/", $line) ||
+ preg_match("/### The 'user' field for '.*' differs from the english!/", $line)) {
$stat['desc']++;
- break;
- case '<phrase>':
+ } elseif (preg_match("/### The <dest> section for '.*' is missing! Copying from english!/", $line) ||
+ preg_match("/### The <dest> section for '.*' is blank! Copying from english!/", $line)) {
+ $stat['dest']++;
+ } elseif (preg_match("/### The <dest> section for '.*' is identical to english!/", $line)) {
+ $stat['destdup']++; break;
+ } elseif (preg_match("/### The <voice> section for '.*' is missing! Copying from english!/", $line) ||
+ preg_match("/### The <voice> section for '.*' is blank! Copying from english!/", $line)) {
+ $stat['voice']++;
+ } elseif (preg_match("/### The <voice> section for '.*' is identical to english!/", $line)) {
+ $stat['voicedup']++; break;
+ } elseif (preg_match('/<phrase>/', $line)) {
$stat['total']++;
}
}