jenkins-bot has submitted this change and it was merged.

Change subject: Don't show the incorrect total translators count
......................................................................


Don't show the incorrect total translators count

It counts translators to different languages, even though it's just
one person.

This patch just removes the irrelevant number.
In a subsequent patch it will be counted and displayed properly.

Bug: T91054
Change-Id: I9a193a4d713dd76c13144d05b03a3f8f07085cd0
---
M modules/stats/ext.cx.stats.js
1 file changed, 22 insertions(+), 13 deletions(-)

Approvals:
  Nikerabbit: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/stats/ext.cx.stats.js b/modules/stats/ext.cx.stats.js
index 2504697..c3fbc19 100644
--- a/modules/stats/ext.cx.stats.js
+++ b/modules/stats/ext.cx.stats.js
@@ -112,24 +112,33 @@
                                // Required for coloring.
                                max = table[ i ][ j ] > max ? table[ i ][ j ] : 
max;
 
-                               // Total(to)
-                               table[ i ][ trgLen + 1 ] = table[ i ][ trgLen + 
1 ] || 0;
-                               table[ i ][ trgLen + 1 ] += table[ i ][ j ];
+                               // Translators must come from the database 
directly,
+                               // so that a translator who translated to or 
from several
+                               // languages won't be counted twice
+                               if ( property !== 'translators' ) {
+                                       // Total(to)
+                                       table[ i ][ trgLen + 1 ] = table[ i ][ 
trgLen + 1 ] || 0;
+                                       table[ i ][ trgLen + 1 ] += table[ i ][ 
j ];
 
-                               // Total(from)
-                               table[ srcLen + 1 ] = table[ srcLen + 1 ] || [];
-                               table[ srcLen + 1 ][ j ] = table[ srcLen + 1 ][ 
j ] || 0;
-                               table[ srcLen + 1 ][ j ] += table[ i ][ j ];
+                                       // Total(from)
+                                       table[ srcLen + 1 ] = table[ srcLen + 1 
] || [];
+                                       table[ srcLen + 1 ][ j ] = table[ 
srcLen + 1 ][ j ] || 0;
+                                       table[ srcLen + 1 ][ j ] += table[ i ][ 
j ];
+                               }
                        }
 
-                       // Total translations
-                       table[ srcLen + 1 ] = table[ srcLen + 1 ] || [];
-                       table[ srcLen + 1 ][ trgLen + 1 ] = table[ srcLen + 1 
][ trgLen + 1 ] || 0;
-                       table[ srcLen + 1 ][ trgLen + 1 ] += table[ i ][ trgLen 
+ 1 ];
+                       if ( property !== 'translators' ) {
+                               // Total translations
+                               table[ srcLen + 1 ] = table[ srcLen + 1 ] || [];
+                               table[ srcLen + 1 ][ trgLen + 1 ] = table[ 
srcLen + 1 ][ trgLen + 1 ] || 0;
+                               table[ srcLen + 1 ][ trgLen + 1 ] += table[ i 
][ trgLen + 1 ];
+                       }
                }
 
-               table[ 0 ][ trgLen + 1 ] = mw.msg( 
'cx-stats-table-source-total' );
-               table[ srcLen + 1 ][ 0 ] = mw.msg( 
'cx-stats-table-target-total' );
+               if ( property !== 'translators' ) {
+                       table[ 0 ][ trgLen + 1 ] = mw.msg( 
'cx-stats-table-source-total' );
+                       table[ srcLen + 1 ][ 0 ] = mw.msg( 
'cx-stats-table-target-total' );
+               }
 
                return table;
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/205104
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9a193a4d713dd76c13144d05b03a3f8f07085cd0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: KartikMistry <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to