From 4bf94803b98ce206d71c12c3cd25605d16876697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20L=20F=20S=20Bacci?= Date: Sat, 12 Sep 2026 21:10:41 -0300 Subject: [PATCH 1/2] Export files ok list and year long outdated counts. --- languages.php | 2 +- scripts/translation/lib/RevcheckRun.php | 58 ++++++++++++++++++++++++- temp/.gitkeep | 0 3 files changed, 57 insertions(+), 3 deletions(-) delete mode 100644 temp/.gitkeep diff --git a/languages.php b/languages.php index 5926b777e5..2d6e80734d 100644 --- a/languages.php +++ b/languages.php @@ -42,7 +42,7 @@ function print_usage() { print <<revData , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT ); - file_put_contents( __DIR__ . "/../../../.revcheck.json" , $json ); + file_put_contents( "{$tmpDir}/revcheck.json" , $json ); + + // TranslatedOk simple list + + $fp = fopen( "{$tmpDir}/files-ok.txt" , 'w' ); + $oldy1 = 0; + $oldy2 = 0; + + foreach ( $this->revData->fileDetail as $item ) + { + if ( $item->status == RevcheckStatus::TranslatedOk ) + { + $path = $item->path; + $name = $item->name; + + if ( $path == '.' ) + $line = "{$name}\n"; + else + $line = "{$path}/{$name}\n"; + + fwrite( $fp , $line ); + } + + if ( $item->status == RevcheckStatus::TranslatedOld ) + { + if ( $item->days > 365 ) + $oldy1++; + if ( $item->days > 730 ) + $oldy2++; + } + } + fclose( $fp ); + + // Files outdated more than N years, count + + $filey1 = "{$tmpDir}/files-outdated-1y.txt"; + $filey2 = "{$tmpDir}/files-outdated-2y.txt"; + + if ( file_exists( $filey1 ) ) + unlink( $filey1 ); + if ( file_exists( $filey2 ) ) + unlink( $filey2 ); + + if ( $oldy1 > 0 ) + file_put_contents( $filey1 , $oldy1 ); + if ( $oldy2 > 0 ) + file_put_contents( $filey2 , $oldy2 ); } } diff --git a/temp/.gitkeep b/temp/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 From 9cd2ccdbf4cc41b1932a48f91c02525a941d3adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20L=20F=20S=20Bacci?= Date: Mon, 14 Sep 2026 13:51:05 -0300 Subject: [PATCH 2/2] Clean ups --- .gitignore | 4 +--- scripts/translation/lib/RevcheckRun.php | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 8e5220c8b2..4236585caa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,9 @@ + # Files generated by the configure script .manual.xml -.revcheck.json version.xml sources.xml -# File use to generate entities by configure script fileModHistory.php - # A plece for all temporary or generated files (idempotent build) temp/ diff --git a/scripts/translation/lib/RevcheckRun.php b/scripts/translation/lib/RevcheckRun.php index c492626f19..bca5e236e8 100644 --- a/scripts/translation/lib/RevcheckRun.php +++ b/scripts/translation/lib/RevcheckRun.php @@ -264,9 +264,10 @@ public function saveRevcheckData() if ( ! file_exists( $tmpDir ) ) mkdir( $tmpDir ); - // Full revdata in JSON + // Full revcheck data in JSON - $json = json_encode( $this->revData , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT ); + $conf = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT; + $json = json_encode( $this->revData , $conf ); file_put_contents( "{$tmpDir}/revcheck.json" , $json ); // TranslatedOk simple list