r73873 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73872‎ | r73873 | r73874 >
Date:07:39, 28 September 2010
Author:nikerabbit
Status:resolved
Tags:
Comment:
Quickfix for not exporting invalid language codes
Modified paths:
  • /trunk/extensions/Translate/Groups.php (modified) (history)
  • /trunk/extensions/Translate/scripts/export.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/export.php
@@ -104,7 +104,7 @@
105105
106106 foreach ( $langs as $lang ) {
107107 // Do not export if language code is to be skipped.
108 - if( in_array( $lang, $skip ) ) {
 108+ if( in_array( $lang, $skip ) && !$group->isValidLanguage( $lang ) ) {
109109 continue;
110110 }
111111
Index: trunk/extensions/Translate/Groups.php
@@ -440,6 +440,16 @@
441441 return $code;
442442 }
443443 }
 444+
 445+ /**
 446+ * Checks whether a language code can be used in this group.
 447+ * @param $code \string
 448+ * @return \bool
 449+ */
 450+ public function isValidLanguage( $code ) {
 451+ return $this->mapCode( $code ) !== 'x-invalidLanguageCode';
 452+ }
 453+
444454 }
445455
446456 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r73920FIx bug in r73873. Should be 'or' instead of 'and'siebrand17:20, 28 September 2010

Status & tagging log