r104136 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104135‎ | r104136 | r104137 >
Date:08:35, 24 November 2011
Author:siebrand
Status:ok
Tags:
Comment:
Include drafts in output.
Modified paths:
  • /trunk/extensions/cldr/rebuild.php (modified) (history)

Diff [purge]

Index: trunk/extensions/cldr/rebuild.php
@@ -89,7 +89,7 @@
9090 $this->languages = true;
9191 }
9292 if ( $this->languages && $name === 'LANGUAGE' ) {
93 - if ( !isset($attrs["ALT"] ) && !isset( $attrs["DRAFT"] ) ) { // Exclude names that are alt or draft
 93+ if ( !isset($attrs["ALT"] ) ) { // Exclude names that are alt.
9494 $this->parseContents = true;
9595 $this->type = str_replace( '_', '-', strtolower( $attrs['TYPE'] ) );
9696 $this->languageOutput .= "'$this->type' => '";
@@ -160,7 +160,7 @@
161161 $this->currency = true;
162162 }
163163 if ( $this->currency && $name == 'DISPLAYNAME' ) {
164 - if ( !isset( $attrs["DRAFT"] ) && !isset( $attrs["COUNT"] ) ) { // Exclude drafts and plurals
 164+ if ( !isset( $attrs["COUNT"] ) ) { // Exclude plurals.
165165 $this->currencyOutput .= "'$this->type' => '";
166166 $this->parseContents = true;
167167 }
@@ -231,15 +231,13 @@
232232 $this->countries = true;
233233 }
234234 if ( $this->countries && $name === 'TERRITORY' ) {
235 - if ( !isset( $attrs["DRAFT"] ) ) { // Exclude names that are draft
236 - // Exclude alt names unless they are short alternatives (which we prefer)
237 - if ( !isset( $attrs["ALT"] ) || ( isset( $attrs["ALT"] ) && $attrs["ALT"] == 'short' ) ) {
238 - preg_match( '/[A-Z][A-Z]/', $attrs['TYPE'], $matches );
239 - if ( $matches && $matches[0] !== 'ZZ' ) { // Exclude ZZ => Unknown Region
240 - $this->parseContents = true;
241 - $this->type = $matches[0];
242 - $this->countryOutput .= "'$this->type' => '";
243 - }
 235+ // Exclude alt names unless they are short alternatives (which we prefer)
 236+ if ( !isset( $attrs["ALT"] ) || ( isset( $attrs["ALT"] ) && $attrs["ALT"] == 'short' ) ) {
 237+ preg_match( '/[A-Z][A-Z]/', $attrs['TYPE'], $matches );
 238+ if ( $matches && $matches[0] !== 'ZZ' ) { // Exclude ZZ => Unknown Region
 239+ $this->parseContents = true;
 240+ $this->type = $matches[0];
 241+ $this->countryOutput .= "'$this->type' => '";
244242 }
245243 }
246244 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r104152Follow-up r104136: Add draft translations from CLDR 2.0.1siebrand10:47, 24 November 2011

Status & tagging log