r85283 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85282‎ | r85283 | r85284 >
Date:21:06, 3 April 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Update plural data for new CLDR
Modified paths:
  • /trunk/extensions/Translate/data/plural-cldr.yaml (modified) (history)
  • /trunk/extensions/Translate/scripts/cldr-plural-to-yaml.php (modified) (history)
  • /trunk/extensions/Translate/scripts/plural-comparison.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/data/plural-cldr.yaml
@@ -11,6 +11,8 @@
1212 bm: Zero
1313 bn: Default
1414 bo: Zero
 15+ br: Rule S
 16+ brx: Default
1517 bs: Rule J
1618 ca: Default
1719 chr: Default
@@ -157,6 +159,7 @@
158160 one: n is 1
159161 Rule L:
160162 few: n mod 10 in 2..4 and n mod 100 not in 12..14
 163+ many: n is not 1 and n mod 10 in 0..1 or n mod 10 in 5..9 or n mod 100 in 12..14
161164 one: n is 1
162165 Rule M:
163166 few: n mod 100 in 3..4
@@ -169,14 +172,22 @@
170173 Rule O:
171174 one: n mod 10 is 1 and n is not 11
172175 Rule P:
173 - many: n is 8 or n is 11
 176+ few: n is 3
 177+ many: n is 6
174178 one: n is 1
175179 two: n is 2
 180+ zero: n is 0
176181 Rule Q:
177182 one: n within 0..2 and n is not 0 and n is not 2
178183 zero: n is 0
179184 Rule R:
180185 few: n in 2..10
181186 one: n within 0..1
 187+ Rule S:
 188+ few: n is 3
 189+ many: n is 6
 190+ one: n is 1
 191+ two: n is 2
 192+ zero: n is 0
182193 Zero: []
183194
Index: trunk/extensions/Translate/scripts/cldr-plural-to-yaml.php
@@ -33,7 +33,7 @@
3434
3535 $doc = new DOMDocument();
3636 $doc->load( 'plurals.xml' );
37 -
 37+
3838 $rulesets = $doc->getElementsByTagName( "pluralRules" );
3939 foreach( $rulesets as $ruleset ) {
4040 $codes = $ruleset->getAttribute( 'locales' );
@@ -69,7 +69,7 @@
7070 }
7171 }
7272
73 - file_put_contents( 'plural-CLDR.yaml', TranslateYaml::dump( array(
 73+ file_put_contents( 'plural-cldr.yaml', TranslateYaml::dump( array(
7474 'locales' => $outLocales,
7575 'rulesets' => $outRulesets,
7676 ) ) );
Index: trunk/extensions/Translate/scripts/plural-comparison.php
@@ -35,7 +35,7 @@
3636 $this->output( sprintf( "%12s %3s %3s %4s\n", 'Code', 'MW', 'Get', 'CLDR' ) );
3737 foreach( $allkeys as $index => $code ) {
3838 $mw = isset( $mwLanguages[$code] ) ? ( $mwLanguages[$code] === false ? '.' : '+' ) : '';
39 - $gt = isset( $gtLanguages[$code] ) ? ( $gtLanguages[$code] === '(n != 1)' ? '.' : '+' ) : '';
 39+ $gt = isset( $gtLanguages[$code] ) ? ( $gtLanguages[$code] === '(n != 1);' ? '.' : '+' ) : '';
4040 $cl = isset( $clLanguages[$code] ) ? ( $clLanguages[$code][0] === 'Default' ? '.' : '+' ) : '';
4141 $this->output( sprintf( "%12s %-3s %-3s %-4s\n", $code, $mw, $gt, $cl ) );
4242

Status & tagging log