From 222b01f5169f1c7e69762e0e8904c24f78f71882 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 28 Jul 2010 11:52:48 +0200 Subject: update to MediaWiki 1.16.0 --- languages/classes/LanguageAr.php | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'languages/classes/LanguageAr.php') diff --git a/languages/classes/LanguageAr.php b/languages/classes/LanguageAr.php index 01c921a0..70a53f86 100644 --- a/languages/classes/LanguageAr.php +++ b/languages/classes/LanguageAr.php @@ -6,22 +6,39 @@ * @author Niklas Laxström */ class LanguageAr extends Language { - function convertPlural( $count, $forms ) { if ( !count($forms) ) { return ''; } - $forms = $this->preConvertPlural( $forms, 5 ); + $forms = $this->preConvertPlural( $forms, 6 ); - if ( $count == 1 ) { + if ( $count == 0 ) { $index = 0; - } elseif( $count == 2 ) { + } elseif ( $count == 1 ) { $index = 1; - } elseif( $count < 11 && $count > 2 ) { + } elseif( $count == 2 ) { $index = 2; - } elseif( $count % 100 == 0) { + } elseif( $count % 100 >= 3 && $count % 100 <= 10 ) { $index = 3; - } else { + } elseif( $count % 100 >= 11 && $count % 100 <= 99 ) { $index = 4; + } else { + $index = 5; } return $forms[$index]; } + + /** + * Temporary hack for bug 9413: replace Arabic presentation forms with their + * standard equivalents. + * + * FIXME: This is language-specific for now only to avoid the negative + * performance impact of enabling it for all languages. + */ + function normalize( $s ) { + global $wgFixArabicUnicode; + $s = parent::normalize( $s ); + if ( $wgFixArabicUnicode ) { + $s = $this->transformUsingPairFile( 'normalize-ar.ser', $s ); + } + return $s; + } } -- cgit v1.2.3-54-g00ecf