Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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/
2 changes: 1 addition & 1 deletion languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function print_usage()
{
print <<<USAGE
usage: [--clone] [--undo] [--pull] [--mark] [--quiet]
[--list-cvs] [--list-ssv] [--rev] [--all]
[--list-csv] [--list-ssv] [--rev] [--all]
[lang] [lang] ...

Options that operates on local repositories:
Expand Down
61 changes: 58 additions & 3 deletions scripts/translation/lib/RevcheckRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,64 @@ private function parseTranslationXml() : void
}
}

private function saveRevcheckData()
public function saveRevcheckData()
{
$json = json_encode( $this->revData , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT );
file_put_contents( __DIR__ . "/../../../.revcheck.json" , $json );
// doc-base/temp

$tmpDir = __DIR__ . '/../../../temp';
if ( ! file_exists( $tmpDir ) )
mkdir( $tmpDir );

// Full revcheck data in JSON

$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

$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 );
}
}
Empty file removed temp/.gitkeep
Empty file.
Loading