@@ -84,7 +84,6 @@ class FileStatusEnum
84
84
const TranslatedWip = 'TranslatedWip ' ;
85
85
const TranslatedOk = 'TranslatedOk ' ;
86
86
const TranslatedOld = 'TranslatedOld ' ;
87
- const TranslatedCritial = 'TranslatedCritial ' ;
88
87
const NotInEnTree = 'NotInEnTree ' ;
89
88
}
90
89
@@ -95,6 +94,7 @@ class FileStatusInfo
95
94
public $ size ;
96
95
public $ hash ;
97
96
public $ skip ;
97
+ public $ days ;
98
98
public $ adds ;
99
99
public $ dels ;
100
100
public $ syncStatus ;
@@ -133,7 +133,6 @@ public static function getKey( $fileStatus ) {
133
133
switch ( $ fileStatus ) {
134
134
case FileStatusEnum::RevTagProblem:
135
135
case FileStatusEnum::TranslatedOld:
136
- case FileStatusEnum::TranslatedCritial:
137
136
return "files_outdated " ;
138
137
break ;
139
138
case FileStatusEnum::TranslatedWip:
@@ -356,7 +355,6 @@ function computeSyncStatus( $enFiles , $trFiles , $gitData , $lang )
356
355
357
356
// TranslatedOk
358
357
// TranslatedOld
359
- // TranslatedCritial
360
358
if ( strlen ( $ trFile ->hash ) == 40 )
361
359
{
362
360
if ( $ enFile ->hash == $ trFile ->hash )
@@ -366,16 +364,20 @@ function computeSyncStatus( $enFiles , $trFiles , $gitData , $lang )
366
364
$ trFile ->syncStatus = FileStatusEnum::TranslatedOld;
367
365
368
366
$ cwd = getcwd ();
369
-
370
367
chdir ( 'en ' );
368
+ //adds,dels
371
369
$ subject = `git diff --numstat $ trFile ->hash -- {$ filename }`;
372
- chdir ( $ cwd );
373
370
if ( $ subject )
374
371
{
375
372
preg_match ('/(\d+)\s+(\d+)/ ' , $ subject , $ matches );
376
373
if ($ matches )
377
374
[, $ enFile ->adds , $ enFile ->dels ] = $ matches ;
378
375
}
376
+ //days
377
+ $ days = `git show --no-patch --format='%ct' $ enFile ->hash -- {$ filename }`;
378
+ if ( $ days != "" )
379
+ $ enFile ->days = floor ( ( time () - $ days ) / 86400 );
380
+ chdir ( $ cwd );
379
381
380
382
if ( $ enFile ->skip )
381
383
{
@@ -495,22 +497,15 @@ function print_html_header( $lang )
495
497
table { margin-left: auto; margin-right: auto; text-align: left; border-spacing: 2px; }
496
498
th { color: white; background-color: #666699; padding: 0.2em; text-align: center; vertical-align: middle; }
497
499
td { padding: 0.2em 0.3em; }
498
- .oc { white-space: nowrap; overflow: hidden; max-width: 7em; }
499
500
.copy { margin:0; padding: 0; font-size:small; }
500
501
.copy:hover { text-transform: uppercase; }
501
502
.copy:active { background: aqua; font-weight: bold; }
502
- .o { white-space: nowrap; overflow: hidden; max-width: 5em; }
503
- .c { text-align: center; }
504
- .r { text-align: right; }
505
503
.b { font-weight: bold; }
506
- .white { color: white ; }
507
- .black { color: black ; }
508
- .bgblue { background-color: #666699; }
504
+ .c { text-align: center ; }
505
+ .o { white-space: nowrap; overflow: hidden; max-width: 5em ; }
506
+ .oc { white-space: nowrap; overflow: hidden; max-width: 7em; }
509
507
.bggray { background-color: #dcdcdc;}
510
- .bggreen { background-color: #68d888;}
511
508
.bgorange { background-color: #f4a460;}
512
- .bgred { background-color: #ff6347;}
513
- .bgyellow { background-color: #eee8aa;}
514
509
</style>
515
510
</head>
516
511
<body>
@@ -551,18 +546,18 @@ function print_html_translators( $translators , $enFiles, $trFiles )
551
546
</table>
552
547
<p/>
553
548
<table class="c">
554
- <tr class=blue >
549
+ <tr>
555
550
<th rowspan=2>Translator's name</th>
556
551
<th rowspan=2>Contact email</th>
557
552
<th rowspan=2>Nick</th>
558
553
<th rowspan=2>V<br>C<br>S</th>
559
554
<th colspan=4>Files maintained</th>
560
555
</tr>
561
556
<tr>
562
- <th style="color:#000000" >upto-<br>date</th>
563
- <th style="color:#000000" >old</th>
564
- <th style="color:#000000" >wip</th>
565
- <th class="blue" >sum</th>
557
+ <th>upto-<br>date</th>
558
+ <th>old</th>
559
+ <th>wip</th>
560
+ <th>sum</th>
566
561
</tr>
567
562
HTML ;
568
563
$ files_uptodate = 0 ;
@@ -748,7 +743,7 @@ function print_html_untranslated($enFiles)
748
743
{
749
744
$ path = $ en ->path ;
750
745
$ path2 = $ path == '' ? '/ ' : $ path ;
751
- print " <tr><th class='blue' colspan='3'> $ path2</th></tr> " ;
746
+ print " <tr><th colspan='3'> $ path2</th></tr> " ;
752
747
}
753
748
$ size = $ en ->size < 1024 ? 1 : floor ( $ en ->size / 1024 );
754
749
@@ -795,6 +790,7 @@ function print_html_files( $enFiles , $trFiles , $lang )
795
790
<th colspan="2">Hash</th>
796
791
<th rowspan="2">Maintainer</th>
797
792
<th rowspan="2">Status</th>
793
+ <th rowspan="2">Days</th>
798
794
</tr>
799
795
<tr>
800
796
<th>en</th>
@@ -822,7 +818,7 @@ function print_html_files( $enFiles , $trFiles , $lang )
822
818
{
823
819
$ path = $ en ->path ;
824
820
$ path2 = $ path == '' ? '/ ' : $ path ;
825
- print " <tr><th colspan='6 ' class='blue c'> $ path2</th></tr> " ;
821
+ print " <tr><th colspan='7 ' class='c'> $ path2</th></tr> " ;
826
822
}
827
823
$ ll = strtolower ( $ lang );
828
824
$ kh = hash ( 'sha256 ' , $ key );
@@ -834,6 +830,10 @@ function print_html_files( $enFiles , $trFiles , $lang )
834
830
$ h1 = "<a href='https://github.com/php/doc-en/blob/ {$ en ->hash }/ $ key'> {$ en ->hash }</a> " ;
835
831
$ h2 = "<a href='https://github.com/php/doc-en/blob/ {$ tr ->hash }/ $ key'> {$ tr ->hash }</a> " ;
836
832
833
+ $ bgdays = '' ;
834
+ if ($ en ->days != null && $ en ->days > 90 )
835
+ $ bgdays = 'bgorange ' ;
836
+
837
837
if ($ en ->adds != null )
838
838
$ ch = "<span style='color: darkgreen;'>+ {$ en ->adds }</span> <span style='color: firebrick;'>- {$ en ->dels }</span> " ;
839
839
else
@@ -843,17 +843,15 @@ function print_html_files( $enFiles , $trFiles , $lang )
843
843
$ st = $ tr ->completion ;
844
844
print <<<HTML
845
845
<tr class="bggray">
846
- <td class="l" > $ nm</td>
846
+ <td> $ nm</td>
847
847
<td class="c"> $ ch</td>
848
848
<td class="oc">
849
- <button class="btn copy" data-clipboard-text=" {$ en ->hash }">
850
- Copy
851
- </button>
852
- $ h1
849
+ <button class="btn copy" data-clipboard-text=" {$ en ->hash }">Copy</button> $ h1
853
850
</td>
854
851
<td class="o"> $ h2</td>
855
852
<td class="c"> $ ma</td>
856
853
<td class="c"> $ st</td>
854
+ <td class="c {$ bgdays }"> {$ en ->days }</td>
857
855
</tr>
858
856
HTML ;
859
857
}
@@ -882,7 +880,7 @@ function print_html_notinen()
882
880
if ( $ path !== $ en ->path )
883
881
{
884
882
$ path = $ en ->path ;
885
- print " <tr><th class='blue' colspan='2'>/ $ path</th></tr> " ;
883
+ print " <tr><th colspan='2'>/ $ path</th></tr> " ;
886
884
}
887
885
print <<<HTML
888
886
<tr class=bggray>
0 commit comments