Siebrand has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/89155


Change subject: Use group source language
......................................................................

Use group source language

Instead of hard coded "en".

Bug: 55607
Change-Id: I6ebb1cfeab3b5c065eb28e6d69a4329b2655b493
---
M scripts/createCheckIndex.php
1 file changed, 10 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/55/89155/1

diff --git a/scripts/createCheckIndex.php b/scripts/createCheckIndex.php
index f88cb87..8ce7006 100644
--- a/scripts/createCheckIndex.php
+++ b/scripts/createCheckIndex.php
@@ -41,12 +41,6 @@
                        unset( $codes[$wgTranslateDocumentationLanguageCode] );
                }
 
-               // Skip source language code
-               unset( $codes['en'] );
-
-               $codes = array_keys( $codes );
-               sort( $codes );
-
                $reqGroups = $this->getOption( 'group' );
                if ( $reqGroups ) {
                        $reqGroups = explode( ',', $reqGroups );
@@ -61,6 +55,7 @@
                /** @var $g MessageGroup */
                foreach ( $groups as $g ) {
                        $id = $g->getId();
+                       $sourceLanguage = $g->getSourceLanguage();
 
                        // Skip groups that are not requested
                        if ( $reqGroups && !in_array( $id, $reqGroups ) ) {
@@ -75,14 +70,21 @@
                        }
 
                        // Initialise messages, using unique definitions if 
appropriate
-                       $collection = $g->initCollection( 'en', true );
+                       $collection = $g->initCollection( $sourceLanguage, true 
);
                        if ( !count( $collection ) ) {
                                continue;
                        }
 
                        $this->output( "Working with $id: ", $id );
 
-                       foreach ( $codes as $code ) {
+                       // Skip source language code
+                       $langCodes = $codes;
+                       unset( $langCodes[$sourceLanguage] );
+
+                       $langCodes = array_keys( $langCodes );
+                       sort( $langCodes );
+
+                       foreach ( $langCodes as $code ) {
                                $this->output( "$code ", $id );
 
                                $problematic = array();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ebb1cfeab3b5c065eb28e6d69a4329b2655b493
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>

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

Reply via email to