diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
commit | ca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch) | |
tree | ec04cc15b867bc21eedca904cea9af0254531a11 /languages/classes/LanguageSr.php | |
parent | a22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff) |
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook
* Use only css to hide our menu bar when printing
Diffstat (limited to 'languages/classes/LanguageSr.php')
-rw-r--r-- | languages/classes/LanguageSr.php | 58 |
1 files changed, 47 insertions, 11 deletions
diff --git a/languages/classes/LanguageSr.php b/languages/classes/LanguageSr.php index 35c90102..b26a2543 100644 --- a/languages/classes/LanguageSr.php +++ b/languages/classes/LanguageSr.php @@ -58,16 +58,23 @@ class SrConverter extends LanguageConverter { ); } - /* rules should be defined as -{ekavian | iyekavian-} -or- - -{code:text | code:text | ...}- - update: delete all rule parsing because it's not used - currently, and just produces a couple of bugs - */ + /** + * rules should be defined as -{ekavian | iyekavian-} -or- + * -{code:text | code:text | ...}- + * + * update: delete all rule parsing because it's not used + * currently, and just produces a couple of bugs + * + * @param $rule string + * @param $flags array + * @return array + */ function parseManualRule( $rule, $flags = array() ) { if ( in_array( 'T', $flags ) ) { return parent::parseManualRule( $rule, $flags ); } + $carray = array(); // otherwise ignore all formatting foreach ( $this->mVariants as $v ) { $carray[$v] = $rule; @@ -76,11 +83,15 @@ class SrConverter extends LanguageConverter { return $carray; } - /* + /** * A function wrapper: * - if there is no selected variant, leave the link * names as they were * - do not try to find variants for usernames + * + * @param $link string + * @param $nt Title + * @param $ignoreOtherCond bool */ function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { // check for user namespace @@ -96,9 +107,14 @@ class SrConverter extends LanguageConverter { $link = $oldlink; } - /* + /** * We want our external link captions to be converted in variants, * so we return the original text instead -{$text}-, except for URLs + * + * @param $text string + * @param $noParse bool + * + * @return string */ function markNoConversion( $text, $noParse = false ) { if ( $noParse || preg_match( "/^https?:\/\/|ftp:\/\/|irc:\/\//", $text ) ) @@ -106,9 +122,14 @@ class SrConverter extends LanguageConverter { return $text; } - /* + /** * An ugly function wrapper for parsing Image titles * (to prevent image name conversion) + * + * @param $text string + * @param $toVariant bool + * + * @return string */ function autoConvert( $text, $toVariant = false ) { global $wgTitle; @@ -122,6 +143,11 @@ class SrConverter extends LanguageConverter { /** * It translates text into variant, specials: * - ommiting roman numbers + * + * @param $text string + * @param $toVariant string + * + * @return string */ function translate( $text, $toVariant ) { $breaks = '[^\w\x80-\xff]'; @@ -175,13 +201,23 @@ class LanguageSr extends LanguageSr_ec { $wgHooks['ArticleSaveComplete'][] = $this->mConverter; } + /** + * @param $count int + * @param $forms array + * + * @return string + */ function convertPlural( $count, $forms ) { - if ( !count( $forms ) ) { return ''; } + if ( !count( $forms ) ) { + return ''; + } // if no number with word, then use $form[0] for singular and $form[1] for plural or zero - if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1]; + if ( count( $forms ) === 2 ) { + return $count == 1 ? $forms[0] : $forms[1]; + } - // FIXME: CLDR defines 4 plural forms. Form with decimals missing. + // @todo FIXME: CLDR defines 4 plural forms. Form with decimals missing. // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#ru $forms = $this->preConvertPlural( $forms, 3 ); |