Fixed spacing in languages folder

Added spaces before if
Added some braces for one line statements

Change-Id: I980771894369499646532b13b801db6447381773
This commit is contained in:
umherirrender 2013-04-17 21:10:02 +02:00
parent dd6f294ad7
commit 3c7bcf4658
39 changed files with 459 additions and 349 deletions

View file

@ -275,7 +275,7 @@ class Language {
$alpha = '[a-z]';
$digit = '[0-9]';
$alphanum = '[a-z0-9]';
$x = 'x' ; # private use singleton
$x = 'x'; # private use singleton
$singleton = '[a-wy-z]'; # other singleton
$s = $lenient ? '[-_]' : '-';
@ -1121,7 +1121,9 @@ class Language {
$s .= $this->getMonthNameGen( substr( $ts, 4, 2 ) );
break;
case 'xjx':
if ( !$hebrew ) $hebrew = self::tsToHebrew( $ts );
if ( !$hebrew ) {
$hebrew = self::tsToHebrew( $ts );
}
$s .= $this->getHebrewCalendarMonthNameGen( $hebrew[1] );
break;
case 'd':
@ -1811,7 +1813,7 @@ class Language {
}
if ( strlen( $s ) == 2 ) {
$str = $s . "'";
} else {
} else {
$str = substr( $s, 0, strlen( $s ) - 2 ) . '"';
$str .= substr( $s, strlen( $s ) - 2, 2 );
}
@ -1900,12 +1902,12 @@ class Language {
# will normalize out-of-range values so we don't have to split $minDiff
# into hours and minutes.
$t = mktime( (
(int)substr( $ts, 8, 2 ) ), # Hours
(int)substr( $ts, 10, 2 ) + $minDiff, # Minutes
(int)substr( $ts, 12, 2 ), # Seconds
(int)substr( $ts, 4, 2 ), # Month
(int)substr( $ts, 6, 2 ), # Day
(int)substr( $ts, 0, 4 ) ); # Year
(int)substr( $ts, 8, 2 ) ), # Hours
(int)substr( $ts, 10, 2 ) + $minDiff, # Minutes
(int)substr( $ts, 12, 2 ), # Seconds
(int)substr( $ts, 4, 2 ), # Month
(int)substr( $ts, 6, 2 ), # Day
(int)substr( $ts, 0, 4 ) ); # Year
$date = date( 'YmdHis', $t );
wfRestoreWarnings();
@ -2781,7 +2783,9 @@ class Language {
* @since 1.20
*/
function getDirMarkEntity( $opposite = false ) {
if ( $opposite ) { return $this->isRTL() ? '‎' : '‏'; }
if ( $opposite ) {
return $this->isRTL() ? '‎' : '‏';
}
return $this->isRTL() ? '‏' : '‎';
}
@ -2798,7 +2802,9 @@ class Language {
function getDirMark( $opposite = false ) {
$lrm = "\xE2\x80\x8E"; # LEFT-TO-RIGHT MARK, commonly abbreviated LRM
$rlm = "\xE2\x80\x8F"; # RIGHT-TO-LEFT MARK, commonly abbreviated RLM
if ( $opposite ) { return $this->isRTL() ? $lrm : $rlm; }
if ( $opposite ) {
return $this->isRTL() ? $lrm : $rlm;
}
return $this->isRTL() ? $rlm : $lrm;
}
@ -3030,20 +3036,20 @@ class Language {
$numMatches = preg_match_all( "/(#+)/", $digitGroupingPattern, $matches );
preg_match( "/\d+/", $number, $integerPart );
preg_match( "/\.\d*/", $number, $decimalPart );
$groupedNumber = ( count( $decimalPart ) > 0 ) ? $decimalPart[0]:"";
$groupedNumber = ( count( $decimalPart ) > 0 ) ? $decimalPart[0] : "";
if ( $groupedNumber === $number ) {
// the string does not have any number part. Eg: .12345
return $sign . $groupedNumber;
}
$start = $end = strlen( $integerPart[0] );
while ( $start > 0 ) {
$match = $matches[0][$numMatches -1] ;
$match = $matches[0][$numMatches - 1];
$matchLen = strlen( $match );
$start = $end - $matchLen;
if ( $start < 0 ) {
$start = 0;
}
$groupedNumber = substr( $number, $start, $end -$start ) . $groupedNumber ;
$groupedNumber = substr( $number, $start, $end -$start ) . $groupedNumber;
$end = $start;
if ( $numMatches > 1 ) {
// use the last pattern for the rest of the number
@ -3220,9 +3226,9 @@ class Language {
# We got the first byte only of a multibyte char; remove it.
$string = substr( $string, 0, -1 );
} elseif ( $char >= 0x80 &&
preg_match( '/^(.*)(?:[\xe0-\xef][\x80-\xbf]|' .
'[\xf0-\xf7][\x80-\xbf]{1,2})$/', $string, $m ) )
{
preg_match( '/^(.*)(?:[\xe0-\xef][\x80-\xbf]|' .
'[\xf0-\xf7][\x80-\xbf]{1,2})$/', $string, $m )
) {
# We chopped in the middle of a character; remove it
$string = $m[1];
}
@ -3306,7 +3312,9 @@ class Language {
break;
}
}
if ( $pos >= $textLen ) break; // extra iteration just for above checks
if ( $pos >= $textLen ) {
break; // extra iteration just for above checks
}
# Read the next char...
$ch = $text[$pos];
@ -3439,7 +3447,7 @@ class Language {
function getGrammarForms() {
global $wgGrammarForms;
if ( isset( $wgGrammarForms[$this->getCode()] ) && is_array( $wgGrammarForms[$this->getCode()] ) ) {
return $wgGrammarForms[$this->getCode()];
return $wgGrammarForms[$this->getCode()];
}
return array();
}

View file

@ -344,7 +344,7 @@ class LanguageConverter {
}
}
if( $this->guessVariant( $text, $toVariant ) ) {
if ( $this->guessVariant( $text, $toVariant ) ) {
wfProfileOut( __METHOD__ );
return $text;
}
@ -644,14 +644,14 @@ class LanguageConverter {
if ( $pos === false ) {
// No more markup, append final segment
$fragment = substr( $text, $startPos );
$out .= $shouldConvert? $this->autoConvert( $fragment, $variant ): $fragment;
$out .= $shouldConvert ? $this->autoConvert( $fragment, $variant ) : $fragment;
return $out;
}
// Markup found
// Append initial segment
$fragment = substr( $text, $startPos, $pos - $startPos );
$out .= $shouldConvert? $this->autoConvert( $fragment, $variant ): $fragment;
$out .= $shouldConvert ? $this->autoConvert( $fragment, $variant ) : $fragment;
// Advance position
$startPos = $pos;
@ -687,7 +687,7 @@ class LanguageConverter {
while ( $startPos < $length ) {
$m = false;
preg_match( '/-\{|\}-/', $text, $m, PREG_OFFSET_CAPTURE, $startPos );
preg_match( '/-\{|\}-/', $text, $m, PREG_OFFSET_CAPTURE, $startPos );
if ( !$m ) {
// Unclosed rule
break;
@ -1259,14 +1259,14 @@ class ConverterRule {
$choice = preg_split( $varsep_pattern, $rules );
foreach ( $choice as $c ) {
$v = explode( ':', $c, 2 );
$v = explode( ':', $c, 2 );
if ( count( $v ) != 2 ) {
// syntax error, skip
continue;
}
$to = trim( $v[1] );
$v = trim( $v[0] );
$u = explode( '=>', $v, 2 );
$v = trim( $v[0] );
$u = explode( '=>', $v, 2 );
// if $to is empty, strtr() could return a wrong result
if ( count( $u ) == 1 && $to && in_array( $v, $variants ) ) {
$bidtable[$v] = $to;
@ -1439,7 +1439,7 @@ class ConverterRule {
// then we check its fallback variants.
$variantFallbacks =
$this->mConverter->getVariantFallbacks( $variant );
if( is_array( $variantFallbacks ) ) {
if ( is_array( $variantFallbacks ) ) {
foreach ( $variantFallbacks as $variantFallback ) {
// if current variant's fallback exist in flags
if ( isset( $this->mVariantFlags[$variantFallback] ) ) {

View file

@ -22,21 +22,21 @@
*/
/**
* These determine things like interwikis, language selectors, and so on.
* Safe to change without running scripts on the respective sites.
*
* \xE2\x80\x8E is the left-to-right marker and
* \xE2\x80\x8F is the right-to-left marker.
* They are required for ensuring the correct display of brackets in
* mixed rtl/ltr environment.
*
* Some writing systems require some line-height fixes. This includes
* most Indic scripts, like Devanagari.
* If you are adding support for such a language, add it also to
* the relevant section in skins/common/shared.css.
*
* @ingroup Language
*/
* These determine things like interwikis, language selectors, and so on.
* Safe to change without running scripts on the respective sites.
*
* \xE2\x80\x8E is the left-to-right marker and
* \xE2\x80\x8F is the right-to-left marker.
* They are required for ensuring the correct display of brackets in
* mixed rtl/ltr environment.
*
* Some writing systems require some line-height fixes. This includes
* most Indic scripts, like Devanagari.
* If you are adding support for such a language, add it also to
* the relevant section in skins/common/shared.css.
*
* @ingroup Language
*/
/* private */ $coreLanguageNames = array(
'aa' => 'Qafár af', # Afar
'ab' => 'Аҧсшәа', # Abkhaz
@ -165,7 +165,7 @@
'ho' => 'Hiri Motu', # Hiri Motu
'hr' => 'hrvatski', # Croatian
'hsb' => 'hornjoserbsce', # Upper Sorbian
'ht' => 'Kreyòl ayisyen', # Haitian Creole French
'ht' => 'Kreyòl ayisyen', # Haitian Creole French
'hu' => 'magyar', # Hungarian
'hy' => 'Հայերեն', # Armenian
'hz' => 'Otsiherero', # Herero
@ -219,7 +219,7 @@
'ks-arab' => 'کٲشُر', # Kashmiri (Perso-Arabic script)
'ks-deva' => 'कॉशुर', # Kashmiri (Devanagari script)
'ksh' => 'Ripoarisch', # Ripuarian
'ku' => 'Kurdî', # Kurdish (multiple scripts - defaults to Latin)
'ku' => 'Kurdî', # Kurdish (multiple scripts - defaults to Latin)
'ku-latn' => "Kurdî (latînî)\xE2\x80\x8E", # Northern Kurdish (Latin script)
'ku-arab' => "كوردي (عەرەبی)\xE2\x80\x8F", # Northern Kurdish (Arabic script) (falls back to ckb)
'kv' => 'коми', # Komi-Zyrian (Cyrillic is common script but also written in Latin script)
@ -237,7 +237,7 @@
'liv' => 'Līvõ kēļ', # Livonian
'lmo' => 'lumbaart', # Lombard
'ln' => 'lingála', # Lingala
'lo' => 'ລາວ',# Laotian
'lo' => 'ລາວ', # Laotian
'loz' => 'Silozi', # Lozi
'lt' => 'lietuvių', # Lithuanian
'ltg' => 'latgaļu', # Latgalian

View file

@ -46,13 +46,17 @@ class LanguageBe_tarask extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
// If the actual number is not mentioned in the expression, then just two forms are enough:
// singular for $count == 1
// plural for $count != 1
// For example, "This user belongs to {{PLURAL:$1|one group|several groups}}."
if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
if ( count( $forms ) === 2 ) {
return $count == 1 ? $forms[0] : $forms[1];
}
// @todo FIXME: CLDR defines 4 plural forms instead of 3
// http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
@ -62,10 +66,10 @@ class LanguageBe_tarask extends Language {
return $forms[2];
} else {
switch ( $count % 10 ) {
case 1: return $forms[0];
case 1: return $forms[0];
case 2:
case 3:
case 4: return $forms[1];
case 4: return $forms[1];
default: return $forms[2];
}
}

View file

@ -48,18 +48,19 @@ class LanguageCu extends Language {
# join and array_slice instead mb_substr
$ar = array();
preg_match_all( '/./us', $word, $ar );
if ( !preg_match( "/[a-zA-Z_]/us", $word ) )
if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) {
switch ( $case ) {
case 'genitive': # родительный падеж
if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вики' ) || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вики' ) )
{ }
elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ї' )
if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вики' ) || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вики' ) ) {
} elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ї' ) {
$word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'їѩ';
}
break;
case 'accusative': # винительный падеж
# stub
break;
}
}
return $word;
}
@ -69,14 +70,16 @@ class LanguageCu extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
$forms = $this->preConvertPlural( $forms, 4 );
switch ( $count % 10 ) {
case 1: return $forms[0];
case 2: return $forms[1];
case 1: return $forms[0];
case 2: return $forms[1];
case 3:
case 4: return $forms[2];
case 4: return $forms[2];
default: return $forms[3];
}
}

View file

@ -79,13 +79,13 @@ class LanguageEo extends Language {
*/
function strrtuxCallback( $matches ) {
static $ux = array(
'x' => 'xx' , 'X' => 'Xx' ,
"\xc4\x88" => "Cx" , "\xc4\x89" => "cx" ,
"\xc4\x9c" => "Gx" , "\xc4\x9d" => "gx" ,
"\xc4\xa4" => "Hx" , "\xc4\xa5" => "hx" ,
"\xc4\xb4" => "Jx" , "\xc4\xb5" => "jx" ,
"\xc5\x9c" => "Sx" , "\xc5\x9d" => "sx" ,
"\xc5\xac" => "Ux" , "\xc5\xad" => "ux"
'x' => 'xx', 'X' => 'Xx',
"\xc4\x88" => "Cx", "\xc4\x89" => "cx",
"\xc4\x9c" => "Gx", "\xc4\x9d" => "gx",
"\xc4\xa4" => "Hx", "\xc4\xa5" => "hx",
"\xc4\xb4" => "Jx", "\xc4\xb5" => "jx",
"\xc5\x9c" => "Sx", "\xc5\x9d" => "sx",
"\xc5\xac" => "Ux", "\xc5\xad" => "ux",
);
return strtr( $matches[1], $ux );
}
@ -96,20 +96,20 @@ class LanguageEo extends Language {
*/
function strrtxuCallback( $matches ) {
static $xu = array(
'xx' => 'x' , 'xX' => 'x' ,
'Xx' => 'X' , 'XX' => 'X' ,
"Cx" => "\xc4\x88" , "CX" => "\xc4\x88" ,
"cx" => "\xc4\x89" , "cX" => "\xc4\x89" ,
"Gx" => "\xc4\x9c" , "GX" => "\xc4\x9c" ,
"gx" => "\xc4\x9d" , "gX" => "\xc4\x9d" ,
"Hx" => "\xc4\xa4" , "HX" => "\xc4\xa4" ,
"hx" => "\xc4\xa5" , "hX" => "\xc4\xa5" ,
"Jx" => "\xc4\xb4" , "JX" => "\xc4\xb4" ,
"jx" => "\xc4\xb5" , "jX" => "\xc4\xb5" ,
"Sx" => "\xc5\x9c" , "SX" => "\xc5\x9c" ,
"sx" => "\xc5\x9d" , "sX" => "\xc5\x9d" ,
"Ux" => "\xc5\xac" , "UX" => "\xc5\xac" ,
"ux" => "\xc5\xad" , "uX" => "\xc5\xad"
'xx' => 'x', 'xX' => 'x',
'Xx' => 'X', 'XX' => 'X',
"Cx" => "\xc4\x88", "CX" => "\xc4\x88",
"cx" => "\xc4\x89", "cX" => "\xc4\x89",
"Gx" => "\xc4\x9c", "GX" => "\xc4\x9c",
"gx" => "\xc4\x9d", "gX" => "\xc4\x9d",
"Hx" => "\xc4\xa4", "HX" => "\xc4\xa4",
"hx" => "\xc4\xa5", "hX" => "\xc4\xa5",
"Jx" => "\xc4\xb4", "JX" => "\xc4\xb4",
"jx" => "\xc4\xb5", "jX" => "\xc4\xb5",
"Sx" => "\xc5\x9c", "SX" => "\xc5\x9c",
"sx" => "\xc5\x9d", "sX" => "\xc5\x9d",
"Ux" => "\xc5\xac", "UX" => "\xc5\xac",
"ux" => "\xc5\xad", "uX" => "\xc5\xad",
);
return strtr( $matches[1], $xu ) . strtr( $matches[2], $xu );
}
@ -127,9 +127,9 @@ class LanguageEo extends Language {
if ( $ishigh and !$isutf ) {
# Assume Latin1
$s = utf8_encode( $s );
} else {
if ( preg_match( '/(\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]' .
'|\xc5[\x9c\x9d\xac\xad])/', $s ) )
} elseif ( preg_match( '/(\xc4[\x88\x89\x9c\x9d\xa4\xa5\xb4\xb5]' .
'|\xc5[\x9c\x9d\xac\xad])/', $s )
) {
return $s;
}

View file

@ -53,12 +53,14 @@ class LanguageFi extends Language {
# The general case cannot be handled without a dictionary, but there's at least one notable
# special case we should check for:
if ( preg_match( '/wiki$/i', $word ) )
if ( preg_match( '/wiki$/i', $word ) ) {
$aou = false;
}
# append i after final consonant
if ( preg_match( '/[bcdfghjklmnpqrstvwxz]$/i', $word ) )
if ( preg_match( '/[bcdfghjklmnpqrstvwxz]$/i', $word ) ) {
$word .= 'i';
}
switch ( $case ) {
case 'genitive':

View file

@ -46,19 +46,26 @@ class LanguageGa extends Language {
case 'ainmlae':
switch ( $word ) {
case 'an Domhnach':
$word = 'Dé Domhnaigh'; break;
$word = 'Dé Domhnaigh';
break;
case 'an Luan':
$word = 'Dé Luain'; break;
$word = 'Dé Luain';
break;
case 'an Mháirt':
$word = 'Dé Mháirt'; break;
$word = 'Dé Mháirt';
break;
case 'an Chéadaoin':
$word = 'Dé Chéadaoin'; break;
$word = 'Dé Chéadaoin';
break;
case 'an Déardaoin':
$word = 'Déardaoin'; break;
$word = 'Déardaoin';
break;
case 'an Aoine':
$word = 'Dé hAoine'; break;
$word = 'Dé hAoine';
break;
case 'an Satharn':
$word = 'Dé Sathairn'; break;
$word = 'Dé Sathairn';
break;
}
}
return $word;

View file

@ -50,7 +50,7 @@ class GanConverter extends LanguageConverter {
$flags,
$manualLevel );
$names = array(
'gan' => '原文',
'gan' => '原文',
'gan-hans' => '简体',
'gan-hant' => '繁體',
);
@ -62,7 +62,7 @@ class GanConverter extends LanguageConverter {
$this->mTables = array(
'gan-hans' => new ReplacementArray( $zh2Hans ),
'gan-hant' => new ReplacementArray( $zh2Hant ),
'gan' => new ReplacementArray
'gan' => new ReplacementArray
);
}
@ -89,12 +89,12 @@ class LanguageGan extends LanguageZh {
$variants = array( 'gan', 'gan-hans', 'gan-hant' );
$variantfallbacks = array(
'gan' => array( 'gan-hans', 'gan-hant' ),
'gan' => array( 'gan-hans', 'gan-hant' ),
'gan-hans' => array( 'gan' ),
'gan-hant' => array( 'gan' ),
);
$ml = array(
'gan' => 'disable',
'gan' => 'disable',
);
$this->mConverter = new GanConverter( $this, 'gan',

View file

@ -35,7 +35,9 @@ class LanguageGv extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
$forms = $this->preConvertPlural( $forms, 4 );

View file

@ -36,7 +36,9 @@ class LanguageHi extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
$forms = $this->preConvertPlural( $forms, 2 );
return ( $count <= 1 ) ? $forms[0] : $forms[1];

View file

@ -34,7 +34,9 @@ class LanguageHr extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
// @todo FIXME: CLDR defines 4 plural forms instead of 3. Plural for for decimals is missing.
// http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
$forms = $this->preConvertPlural( $forms, 3 );
@ -43,10 +45,10 @@ class LanguageHr extends Language {
return $forms[2];
} else {
switch ( $count % 10 ) {
case 1: return $forms[0];
case 1: return $forms[0];
case 2:
case 3:
case 4: return $forms[1];
case 4: return $forms[1];
default: return $forms[2];
}
}

View file

@ -49,17 +49,18 @@ class LanguageHy extends Language {
# join and array_slice instead mb_substr
$ar = array();
preg_match_all( '/./us', $word, $ar );
if ( !preg_match( "/[a-zA-Z_]/us", $word ) )
if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) {
switch ( $case ) {
case 'genitive': # սեռական հոլով
if ( join( '', array_slice( $ar[0], -1 ) ) == 'ա' )
if ( join( '', array_slice( $ar[0], -1 ) ) == 'ա' ) {
$word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'այի';
elseif ( join( '', array_slice( $ar[0], -1 ) ) == 'ո' )
} elseif ( join( '', array_slice( $ar[0], -1 ) ) == 'ո' ) {
$word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'ոյի';
elseif ( join( '', array_slice( $ar[0], -4 ) ) == 'գիրք' )
} elseif ( join( '', array_slice( $ar[0], -4 ) ) == 'գիրք' ) {
$word = join( '', array_slice( $ar[0], 0, -4 ) ) . 'գրքի';
else
} else {
$word .= 'ի';
}
break;
case 'dative': # Տրական հոլով
# stub
@ -74,6 +75,7 @@ class LanguageHy extends Language {
# stub
break;
}
}
return $word;
}

View file

@ -92,7 +92,7 @@ class IuConverter extends LanguageConverter {
'lowercase' => new ReplacementArray( $this->mUpperToLowerCaseLatin ),
'ike-cans' => new ReplacementArray( $this->mToSyllabics ),
'ike-latn' => new ReplacementArray( $this->mToLatin ),
'iu' => new ReplacementArray()
'iu' => new ReplacementArray()
);
}
@ -144,17 +144,19 @@ class IuConverter extends LanguageConverter {
* @param $ignoreOtherCond bool
*/
function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
// check for user namespace
// check for user namespace
if ( is_object( $nt ) ) {
$ns = $nt->getNamespace();
if ( $ns == NS_USER || $ns == NS_USER_TALK )
if ( $ns == NS_USER || $ns == NS_USER_TALK ) {
return;
}
}
$oldlink = $link;
parent::findVariantLink( $link, $nt, $ignoreOtherCond );
if ( $this->getPreferredVariant() == $this->mMainLanguageCode )
if ( $this->getPreferredVariant() == $this->mMainLanguageCode ) {
$link = $oldlink;
}
}
/**
@ -170,7 +172,9 @@ class IuConverter extends LanguageConverter {
global $wgTitle;
if ( is_object( $wgTitle ) && $wgTitle->getNamespace() == NS_FILE ) {
$imagename = $wgTitle->getNsText();
if ( preg_match( "/^$imagename:/", $text ) ) return $text;
if ( preg_match( "/^$imagename:/", $text ) ) {
return $text;
}
}
return parent::autoConvert( $text, $toVariant );
}
@ -189,7 +193,7 @@ class IuConverter extends LanguageConverter {
if ( trim( $text ) ) {
$this->loadTables();
// To syllabics, first translate uppercase to lowercase Latin
if($toVariant == 'ike-cans') {
if ( $toVariant == 'ike-cans' ) {
$text = $this->mTables['lowercase']->replace( $text );
}
$text = $this->mTables[$toVariant]->replace( $text );

View file

@ -41,7 +41,7 @@ class LanguageKaa extends Language {
function convertGrammar( $word, $case ) {
global $wgGrammarForms;
if ( isset( $wgGrammarForms['kaa'][$case][$word] ) ) {
return $wgGrammarForms['kaa'][$case][$word];
return $wgGrammarForms['kaa'][$case][$word];
}
/* Full code of function convertGrammar() is in development. Updates coming soon. */
return $word;

View file

@ -68,18 +68,18 @@ class KkConverter extends LanguageConverter {
$kk2Cyrl = array();
$kk2Latn = array();
$kk2Arab = array();
$kk2KZ = array();
$kk2TR = array();
$kk2CN = array();
$kk2KZ = array();
$kk2TR = array();
$kk2CN = array();
$this->mTables = array(
'kk-cyrl' => new ReplacementArray( $kk2Cyrl ),
'kk-latn' => new ReplacementArray( $kk2Latn ),
'kk-arab' => new ReplacementArray( $kk2Arab ),
'kk-kz' => new ReplacementArray( array_merge( $kk2Cyrl, $kk2KZ ) ),
'kk-tr' => new ReplacementArray( array_merge( $kk2Latn, $kk2TR ) ),
'kk-cn' => new ReplacementArray( array_merge( $kk2Arab, $kk2CN ) ),
'kk' => new ReplacementArray()
'kk-kz' => new ReplacementArray( array_merge( $kk2Cyrl, $kk2KZ ) ),
'kk-tr' => new ReplacementArray( array_merge( $kk2Latn, $kk2TR ) ),
'kk-cn' => new ReplacementArray( array_merge( $kk2Arab, $kk2CN ) ),
'kk' => new ReplacementArray()
);
}
@ -173,9 +173,9 @@ class KkConverter extends LanguageConverter {
# # Punctuation -> Arabic
'/#|№|No\./u' => '؀', # &#x0600;
'/\,/' => '،', # &#x060C;
'/;/' => '؛', # &#x061B;
'/;/' => '؛', # &#x061B;
'/\?/' => '؟', # &#x061F;
'/%/' => '٪', # &#x066A;
'/%/' => '٪', # &#x066A;
'/\*/' => '٭', # &#x066D;
# # Digits -> Arabic
'/0/' => '۰', # &#x06F0;
@ -259,14 +259,16 @@ class KkConverter extends LanguageConverter {
// check for user namespace
if ( is_object( $nt ) ) {
$ns = $nt->getNamespace();
if ( $ns == NS_USER || $ns == NS_USER_TALK )
if ( $ns == NS_USER || $ns == NS_USER_TALK ) {
return;
}
}
$oldlink = $link;
parent::findVariantLink( $link, $nt, $ignoreOtherCond );
if ( $this->getPreferredVariant() == $this->mMainLanguageCode )
if ( $this->getPreferredVariant() == $this->mMainLanguageCode ) {
$link = $oldlink;
}
}
/**
@ -282,7 +284,9 @@ class KkConverter extends LanguageConverter {
global $wgTitle;
if ( is_object( $wgTitle ) && $wgTitle->getNamespace() == NS_FILE ) {
$imagename = $wgTitle->getNsText();
if ( preg_match( "/^$imagename:/", $text ) ) return $text;
if ( preg_match( "/^$imagename:/", $text ) ) {
return $text;
}
}
return parent::autoConvert( $text, $toVariant );
}
@ -414,13 +418,13 @@ class LanguageKk extends LanguageKk_cyrl {
$variants = array( 'kk', 'kk-cyrl', 'kk-latn', 'kk-arab', 'kk-kz', 'kk-tr', 'kk-cn' );
$variantfallbacks = array(
'kk' => 'kk-cyrl',
'kk' => 'kk-cyrl',
'kk-cyrl' => 'kk',
'kk-latn' => 'kk',
'kk-arab' => 'kk',
'kk-kz' => 'kk-cyrl',
'kk-tr' => 'kk-latn',
'kk-cn' => 'kk-arab'
'kk-kz' => 'kk-cyrl',
'kk-tr' => 'kk-latn',
'kk-cn' => 'kk-arab'
);
$this->mConverter = new KkConverter( $this, 'kk', $variants, $variantfallbacks );

View file

@ -115,14 +115,14 @@ class LanguageKk_cyrl extends Language {
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "а";
}
} elseif ( in_array( $wordEnding, $secondPerson ) ) {
} elseif ( in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "ге";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "ға";
}
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "не";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "на";
@ -153,13 +153,13 @@ class LanguageKk_cyrl extends Language {
break;
case "dc31":
case "possessive accusative": # täweldık + tabıs
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "ді";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "ды";
}
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
$word = $word . "н";
}
break;
@ -181,13 +181,13 @@ class LanguageKk_cyrl extends Language {
break;
case "dc41":
case "possessive locative": # täweldık + jatıs
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "де";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "да";
}
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "нде";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@ -209,7 +209,7 @@ class LanguageKk_cyrl extends Language {
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "дан";
}
} elseif ( in_array( $wordEnding, $Nasals ) ) {
} elseif ( in_array( $wordEnding, $Nasals ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "нен";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@ -219,13 +219,13 @@ class LanguageKk_cyrl extends Language {
break;
case "dc51":
case "possessive ablative": # täweldık + şığıs
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "нен";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "нан";
}
} elseif ( in_array( $wordEnding, $secondPerson ) ) {
} elseif ( in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "ден";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@ -340,14 +340,14 @@ class LanguageKk_cyrl extends Language {
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "a";
}
} elseif ( in_array( $wordEnding, $secondPerson ) ) {
} elseif ( in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "ge";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "ğa";
}
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "ne";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "na";
@ -378,13 +378,13 @@ class LanguageKk_cyrl extends Language {
break;
case "dc31":
case "possessive accusative": # täweldık + tabıs
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "di";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "dı";
}
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
$word = $word . "n";
}
break;
@ -406,13 +406,13 @@ class LanguageKk_cyrl extends Language {
break;
case "dc41":
case "possessive locative": # täweldık + jatıs
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "de";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "da";
}
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "nde";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@ -434,7 +434,7 @@ class LanguageKk_cyrl extends Language {
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "dan";
}
} elseif ( in_array( $wordEnding, $Nasals ) ) {
} elseif ( in_array( $wordEnding, $Nasals ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "nen";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@ -444,13 +444,13 @@ class LanguageKk_cyrl extends Language {
break;
case "dc51":
case "possessive ablative": # täweldık + şığıs
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "nen";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "nan";
}
} elseif ( in_array( $wordEnding, $secondPerson ) ) {
} elseif ( in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "den";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@ -499,7 +499,7 @@ class LanguageKk_cyrl extends Language {
// Set up some constants...
// Vowels in last syllable
$frontVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە" );
$backVowels = array( "ا", "و", "ۇ", "ى" );
$backVowels = array( "ا", "و", "ۇ", "ى" );
$allVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە", "ا", "و", "ۇ", "ى" );
// Preceding letters
$Nasals = array( "م", "ن", "ڭ" );
@ -565,14 +565,14 @@ class LanguageKk_cyrl extends Language {
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "ا";
}
} elseif ( in_array( $wordEnding, $secondPerson ) ) {
} elseif ( in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "گە";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "عا";
}
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "نە";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "نا";
@ -603,13 +603,13 @@ class LanguageKk_cyrl extends Language {
break;
case "dc31":
case "possessive accusative": # täweldık + tabıs
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "دٸ";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "دى";
}
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
$word = $word . "ن";
}
break;
@ -631,13 +631,13 @@ class LanguageKk_cyrl extends Language {
break;
case "dc41":
case "possessive locative": # täweldık + jatıs
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "دە";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "دا";
}
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
} elseif ( in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "ندە";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@ -659,7 +659,7 @@ class LanguageKk_cyrl extends Language {
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "دان";
}
} elseif ( in_array( $wordEnding, $Nasals ) ) {
} elseif ( in_array( $wordEnding, $Nasals ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "نەن";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
@ -669,13 +669,13 @@ class LanguageKk_cyrl extends Language {
break;
case "dc51":
case "possessive ablative": # täweldık + şığıs
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "نەن";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
$word = $word . "نان";
}
} elseif ( in_array( $wordEnding, $secondPerson ) ) {
} elseif ( in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word = $word . "دەن";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {

View file

@ -141,7 +141,7 @@ class LanguageKsh extends Language {
switch ( $gender ) {
case 'm':
$lord = 'dä';
break ;
break;
case 'f':
$lord = 'di';
break;
@ -189,7 +189,9 @@ class LanguageKsh extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
$forms = $this->preConvertPlural( $forms, 3 );
if ( $count == 1 ) {

View file

@ -41,23 +41,23 @@ class KuConverter extends LanguageConverter {
/* Doppel- und Halbvokale */
'ڵ' => 'll', # ll
'ڕ' => 'rr', # rr
'ا' => 'a',
'ڕ' => 'rr', # rr
'ا' => 'a',
# 'ئێ' => 'ê', # initial e
'ە' => 'e',
'ه' => 'e', # with one non-joiner
'ه' => 'e', # with two non-joiner
'ة' => 'e',
'ە' => 'e',
'ه' => 'e', # with one non-joiner
'ه' => 'e', # with two non-joiner
'ة' => 'e',
'ێ' => 'ê',
'ي' => 'î',
'ی' => 'î', # U+06CC db 8c ARABIC LETTER FARSI YEH
'ى' => 'î', # U+0649 d9 89 ARABIC LETTER ALEF MAKSURA
'ۆ' => 'o',
'و' => 'w',
'ئ' => '', # initial hemze should not be shown
'،' => ',',
'ع' => '\'', # ayn
'؟' => '?',
'ي' => 'î',
'ی' => 'î', # U+06CC db 8c ARABIC LETTER FARSI YEH
'ى' => 'î', # U+0649 d9 89 ARABIC LETTER ALEF MAKSURA
'ۆ' => 'o',
'و' => 'w',
'ئ' => '', # initial hemze should not be shown
'،' => ',',
'ع' => '\'', # ayn
'؟' => '?',
# digits
'٠' => '0', # &#x0660;
@ -113,13 +113,13 @@ class KuConverter extends LanguageConverter {
' o' => 'ئۆ ',
' u' => 'ئو ',
' û' => 'ئوو ',
'A' => 'ئا',
'E' => 'ئە',
'Ê' => 'ئێ',
'Î' => 'ئی',
'O' => 'ئۆ',
'U' => 'ئو',
'Û' => 'ئوو',
'A' => 'ئا',
'E' => 'ئە',
'Ê' => 'ئێ',
'Î' => 'ئی',
'O' => 'ئۆ',
'U' => 'ئو',
'Û' => 'ئوو',
' A' => 'ئا ',
' E' => 'ئە ',
' Ê' => 'ئێ ',
@ -149,7 +149,7 @@ class KuConverter extends LanguageConverter {
$this->mTables = array(
'ku-latn' => new ReplacementArray( $this->mArabicToLatin ),
'ku-arab' => new ReplacementArray( $this->mLatinToArabic ),
'ku' => new ReplacementArray()
'ku' => new ReplacementArray()
);
}
@ -167,14 +167,16 @@ class KuConverter extends LanguageConverter {
// check for user namespace
if ( is_object( $nt ) ) {
$ns = $nt->getNamespace();
if ( $ns == NS_USER || $ns == NS_USER_TALK )
if ( $ns == NS_USER || $ns == NS_USER_TALK ) {
return;
}
}
$oldlink = $link;
parent::findVariantLink( $link, $nt, $ignoreOtherCond );
if ( $this->getPreferredVariant() == $this->mMainLanguageCode )
if ( $this->getPreferredVariant() == $this->mMainLanguageCode ) {
$link = $oldlink;
}
}
/**
@ -190,7 +192,9 @@ class KuConverter extends LanguageConverter {
global $wgTitle;
if ( is_object( $wgTitle ) && $wgTitle->getNamespace() == NS_FILE ) {
$imagename = $wgTitle->getNsText();
if ( preg_match( "/^$imagename:/", $text ) ) return $text;
if ( preg_match( "/^$imagename:/", $text ) ) {
return $text;
}
}
return parent::autoConvert( $text, $toVariant );
}
@ -253,7 +257,7 @@ class LanguageKu extends LanguageKu_ku {
$variants = array( 'ku', 'ku-arab', 'ku-latn' );
$variantfallbacks = array(
'ku' => 'ku-latn',
'ku' => 'ku-latn',
'ku-arab' => 'ku-latn',
'ku-latn' => 'ku-arab',
);

View file

@ -49,54 +49,60 @@ class LanguageLa extends Language {
switch ( $case ) {
case 'genitive':
// only a few declensions, and even for those mostly the singular only
$in = array( '/u[ms]$/', # 2nd declension singular
'/ommunia$/', # 3rd declension neuter plural (partly)
'/a$/', # 1st declension singular
'/libri$/', '/nuntii$/', # 2nd declension plural (partly)
'/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly)
'/es$/' # 5th declension singular
);
$out = array( 'i',
'ommunium',
'ae',
'librorum', 'nuntiorum',
'tionis', 'ntis', 'atis',
'ei'
);
$in = array(
'/u[ms]$/', # 2nd declension singular
'/ommunia$/', # 3rd declension neuter plural (partly)
'/a$/', # 1st declension singular
'/libri$/', '/nuntii$/', # 2nd declension plural (partly)
'/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly)
'/es$/' # 5th declension singular
);
$out = array(
'i',
'ommunium',
'ae',
'librorum', 'nuntiorum',
'tionis', 'ntis', 'atis',
'ei'
);
return preg_replace( $in, $out, $word );
case 'accusative':
// only a few declensions, and even for those mostly the singular only
$in = array( '/u[ms]$/', # 2nd declension singular
'/a$/', # 1st declension singular
'/ommuniam$/', # 3rd declension neuter plural (partly)
'/libri$/', '/nuntii$/', # 2nd declension plural (partly)
'/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly)
'/es$/' # 5th declension singular
);
$out = array( 'um',
'am',
'ommunia',
'libros', 'nuntios',
'tionem', 'ntem', 'atem',
'em'
);
$in = array(
'/u[ms]$/', # 2nd declension singular
'/a$/', # 1st declension singular
'/ommuniam$/', # 3rd declension neuter plural (partly)
'/libri$/', '/nuntii$/', # 2nd declension plural (partly)
'/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly)
'/es$/' # 5th declension singular
);
$out = array(
'um',
'am',
'ommunia',
'libros', 'nuntios',
'tionem', 'ntem', 'atem',
'em'
);
return preg_replace( $in, $out, $word );
case 'ablative':
// only a few declensions, and even for those mostly the singular only
$in = array( '/u[ms]$/', # 2nd declension singular
'/ommunia$/', # 3rd declension neuter plural (partly)
'/a$/', # 1st declension singular
'/libri$/', '/nuntii$/', # 2nd declension plural (partly)
'/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly)
'/es$/' # 5th declension singular
);
$out = array( 'o',
'ommunibus',
'a',
'libris', 'nuntiis',
'tione', 'nte', 'ate',
'e'
);
$in = array(
'/u[ms]$/', # 2nd declension singular
'/ommunia$/', # 3rd declension neuter plural (partly)
'/a$/', # 1st declension singular
'/libri$/', '/nuntii$/', # 2nd declension plural (partly)
'/tio$/', '/ns$/', '/as$/', # 3rd declension singular (partly)
'/es$/' # 5th declension singular
);
$out = array(
'o',
'ommunibus',
'a',
'libris', 'nuntiis',
'tione', 'nte', 'ate',
'e'
);
return preg_replace( $in, $out, $word );
default:
return $word;

View file

@ -36,7 +36,9 @@ class LanguageMg extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
$forms = $this->preConvertPlural( $forms, 2 );
return ( $count <= 1 ) ? $forms[0] : $forms[1];

View file

@ -35,14 +35,21 @@ class LanguageMt extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
$forms = $this->preConvertPlural( $forms, 4 );
if ( $count == 1 ) $index = 0;
elseif ( $count == 0 || ( $count % 100 > 1 && $count % 100 < 11 ) ) $index = 1;
elseif ( $count % 100 > 10 && $count % 100 < 20 ) $index = 2;
else $index = 3;
if ( $count == 1 ) {
$index = 0;
} elseif ( $count == 0 || ( $count % 100 > 1 && $count % 100 < 11 ) ) {
$index = 1;
} elseif ( $count % 100 > 10 && $count % 100 < 20 ) {
$index = 2;
} else {
$index = 3;
}
return $forms[$index];
}
}

View file

@ -81,27 +81,41 @@ class LanguageOs extends Language {
# Checking if $word ends on 'у'. 'У' can be either consonant 'W' or vowel 'U' in cyrillic Ossetic.
# Examples: {{grammar:genitive|аунеу}} = аунеуы, {{grammar:genitive|лæппу}} = лæппуйы.
elseif ( preg_match( "/у$/u", $word ) ) {
if ( !preg_match( "/[аæеёиоыэюя]$/u", mb_substr( $word, -2, 1 ) ) )
if ( !preg_match( "/[аæеёиоыэюя]$/u", mb_substr( $word, -2, 1 ) ) ) {
$jot = 'й';
}
} elseif ( !preg_match( "/[бвгджзйклмнопрстфхцчшщьъ]$/u", $word ) ) {
$hyphen = '-';
}
switch ( $case ) {
case 'genitive': $ending = $hyphen . $jot . 'ы'; break;
case 'dative': $ending = $hyphen . $jot . 'æн'; break;
case 'allative': $ending = $hyphen . $end_allative; break;
case 'genitive':
$ending = $hyphen . $jot . 'ы';
break;
case 'dative':
$ending = $hyphen . $jot . 'æн';
break;
case 'allative':
$ending = $hyphen . $end_allative;
break;
case 'ablative':
if ( $jot == 'й' ) {
$ending = $hyphen . $jot . 'æ'; break;
$ending = $hyphen . $jot . 'æ';
} else {
$ending = $hyphen . $jot . 'æй';
}
else {
$ending = $hyphen . $jot . 'æй'; break;
}
case 'inessive': break;
case 'superessive': $ending = $hyphen . $jot . 'ыл'; break;
case 'equative': $ending = $hyphen . $jot . 'ау'; break;
case 'comitative': $ending = $hyphen . 'имæ'; break;
break;
case 'inessive':
break;
case 'superessive':
$ending = $hyphen . $jot . 'ыл';
break;
case 'equative':
$ending = $hyphen . $jot . 'ау';
break;
case 'comitative':
$ending = $hyphen . 'имæ';
break;
}
return $word . $ending;
}

View file

@ -34,7 +34,9 @@ class LanguagePl extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
$forms = $this->preConvertPlural( $forms, 3 );
$count = abs( $count );
if ( $count == 1 ) {

View file

@ -34,10 +34,14 @@ class LanguageSh extends Language {
* @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];
}
// @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#sh
@ -47,10 +51,10 @@ class LanguageSh extends Language {
return $forms[2];
} else {
switch ( $count % 10 ) {
case 1: return $forms[0];
case 1: return $forms[0];
case 2:
case 3:
case 4: return $forms[1];
case 4: return $forms[1];
default: return $forms[2];
}
}

View file

@ -42,25 +42,25 @@ class ShiConverter extends LanguageConverter {
public $mToLatin = array(
'ⴰ' => 'a', 'ⴱ' => 'b', 'ⴳ' => 'g', 'ⴷ' => 'd', '' => 'ḍ', 'ⴻ' => 'e',
'ⴼ' => 'f', 'ⴽ' => 'k', 'ⵀ' => 'h', 'ⵃ' => 'ḥ', 'ⵄ' => 'ε', 'ⵅ' => 'x',
'ⵇ' => 'q', 'ⵉ' => 'i', 'ⵊ' => 'j', 'ⵍ' => 'l', 'ⵎ' => 'm', '' => 'n',
'ⵇ' => 'q', 'ⵉ' => 'i', 'ⵊ' => 'j', 'ⵍ' => 'l', 'ⵎ' => 'm', '' => 'n',
'ⵓ' => 'u', '' => 'r', '' => 'ṛ', 'ⵖ' => 'γ', 'ⵙ' => 's', 'ⵚ' => 'ṣ',
'ⵛ' => 'š', 'ⵜ' => 't', 'ⵟ' => 'ṭ', 'ⵡ' => 'w', 'ⵢ' => 'y', 'ⵣ' => 'z',
'ⵥ' => 'ẓ', 'ⵯ' => 'ʷ', 'ⵖ' => 'ɣ', 'ⵠ' => 'v', 'ⵒ' => 'p',
);
public $mUpperToLowerCaseLatin = array(
'A' => 'a', 'B' => 'b', 'C' => 'c', 'D' => 'd', 'E' => 'e',
'F' => 'f', 'G' => 'g', 'H' => 'h', 'I' => 'i', 'J' => 'j',
'K' => 'k', 'L' => 'l', 'M' => 'm', 'N' => 'n', 'O' => 'o',
'P' => 'p', 'Q' => 'q', 'R' => 'r', 'S' => 's', 'T' => 't',
'U' => 'u', 'V' => 'v', 'W' => 'w', 'X' => 'x', 'Y' => 'y',
'A' => 'a', 'B' => 'b', 'C' => 'c', 'D' => 'd', 'E' => 'e',
'F' => 'f', 'G' => 'g', 'H' => 'h', 'I' => 'i', 'J' => 'j',
'K' => 'k', 'L' => 'l', 'M' => 'm', 'N' => 'n', 'O' => 'o',
'P' => 'p', 'Q' => 'q', 'R' => 'r', 'S' => 's', 'T' => 't',
'U' => 'u', 'V' => 'v', 'W' => 'w', 'X' => 'x', 'Y' => 'y',
'Z' => 'z', 'Ɣ' => 'ɣ',
);
public $mToTifinagh = array(
'a' => 'ⴰ', 'b' => 'ⴱ', 'g' => 'ⴳ', 'd' => 'ⴷ', 'ḍ' => '', 'e' => 'ⴻ',
'f' => 'ⴼ', 'k' => 'ⴽ', 'h' => 'ⵀ', 'ḥ' => 'ⵃ', 'ε' => 'ⵄ', 'x' => 'ⵅ',
'q' => 'ⵇ', 'i' => 'ⵉ', 'j' => 'ⵊ', 'l' => 'ⵍ', 'm' => 'ⵎ', 'n' => '',
'q' => 'ⵇ', 'i' => 'ⵉ', 'j' => 'ⵊ', 'l' => 'ⵍ', 'm' => 'ⵎ', 'n' => '',
'u' => 'ⵓ', 'r' => '', 'ṛ' => '', 'γ' => 'ⵖ', 's' => 'ⵙ', 'ṣ' => 'ⵚ',
'š' => 'ⵛ', 't' => 'ⵜ', 'ṭ' => 'ⵟ', 'w' => 'ⵡ', 'y' => 'ⵢ', 'z' => 'ⵣ',
'ẓ' => 'ⵥ', 'ʷ' => 'ⵯ', 'ɣ' => 'ⵖ', 'v' => 'ⵠ', 'p' => 'ⵒ',
@ -71,7 +71,7 @@ class ShiConverter extends LanguageConverter {
'lowercase' => new ReplacementArray( $this->mUpperToLowerCaseLatin ),
'shi-tfng' => new ReplacementArray( $this->mToTifinagh ),
'shi-latn' => new ReplacementArray( $this->mToLatin ),
'shi' => new ReplacementArray()
'shi' => new ReplacementArray()
);
}
@ -123,17 +123,19 @@ class ShiConverter extends LanguageConverter {
* @param $ignoreOtherCond bool
*/
function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
// check for user namespace
// check for user namespace
if ( is_object( $nt ) ) {
$ns = $nt->getNamespace();
if ( $ns == NS_USER || $ns == NS_USER_TALK )
if ( $ns == NS_USER || $ns == NS_USER_TALK ) {
return;
}
}
$oldlink = $link;
parent::findVariantLink( $link, $nt, $ignoreOtherCond );
if ( $this->getPreferredVariant() == $this->mMainLanguageCode )
if ( $this->getPreferredVariant() == $this->mMainLanguageCode ) {
$link = $oldlink;
}
}
/**
@ -149,7 +151,9 @@ class ShiConverter extends LanguageConverter {
global $wgTitle;
if ( is_object( $wgTitle ) && $wgTitle->getNamespace() == NS_FILE ) {
$imagename = $wgTitle->getNsText();
if ( preg_match( "/^$imagename:/", $text ) ) return $text;
if ( preg_match( "/^$imagename:/", $text ) ) {
return $text;
}
}
return parent::autoConvert( $text, $toVariant );
}
@ -168,7 +172,7 @@ class ShiConverter extends LanguageConverter {
if ( trim( $text ) ) {
$this->loadTables();
// To Tifinagh, first translate uppercase to lowercase Latin
if( $toVariant == 'shi-tfng' ) {
if ( $toVariant == 'shi-tfng' ) {
$text = $this->mTables['lowercase']->replace( $text );
}
$text = $this->mTables[$toVariant]->replace( $text );
@ -190,7 +194,7 @@ class LanguageShi extends Language {
$variants = array( 'shi', 'shi-tfng', 'shi-latn' );
$variantfallbacks = array(
'shi' => 'shi-tfng',
'shi' => 'shi-tfng',
'shi-tfng' => 'shi',
'shi-latn' => 'shi',
);

View file

@ -34,7 +34,9 @@ class LanguageSk extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
$forms = $this->preConvertPlural( $forms, 3 );
if ( $count == 1 ) {

View file

@ -45,9 +45,11 @@ class LanguageSl extends Language {
switch ( $case ) {
case 'mestnik': # locative
$word = 'o ' . $word; break;
$word = 'o ' . $word;
break;
case 'orodnik': # instrumental
$word = 'z ' . $word;
break;
}
return $word; # this will return the original value for 'imenovalnik' (nominativ) and all undefined case values

View file

@ -75,7 +75,7 @@ class SrConverter extends LanguageConverter {
$this->mTables = array(
'sr-ec' => new ReplacementArray( $this->mToCyrillics ),
'sr-el' => new ReplacementArray( $this->mToLatin ),
'sr' => new ReplacementArray()
'sr' => new ReplacementArray()
);
}
@ -118,14 +118,16 @@ class SrConverter extends LanguageConverter {
// check for user namespace
if ( is_object( $nt ) ) {
$ns = $nt->getNamespace();
if ( $ns == NS_USER || $ns == NS_USER_TALK )
if ( $ns == NS_USER || $ns == NS_USER_TALK ) {
return;
}
}
$oldlink = $link;
parent::findVariantLink( $link, $nt, $ignoreOtherCond );
if ( $this->getPreferredVariant() == $this->mMainLanguageCode )
if ( $this->getPreferredVariant() == $this->mMainLanguageCode ) {
$link = $oldlink;
}
}
/**
@ -141,7 +143,9 @@ class SrConverter extends LanguageConverter {
global $wgTitle;
if ( is_object( $wgTitle ) && $wgTitle->getNamespace() == NS_FILE ) {
$imagename = $wgTitle->getNsText();
if ( preg_match( "/^$imagename:/", $text ) ) return $text;
if ( preg_match( "/^$imagename:/", $text ) ) {
return $text;
}
}
return parent::autoConvert( $text, $toVariant );
}
@ -194,13 +198,13 @@ class SrConverter extends LanguageConverter {
* @since 1.19
*/
public function guessVariant( $text, $variant ) {
$numCyrillic = preg_match_all("/[шђчћжШЂЧЋЖ]/u", $text, $dummy);
$numLatin = preg_match_all("/[šđč枊ĐČĆŽ]/u", $text, $dummy);
$numCyrillic = preg_match_all( "/[шђчћжШЂЧЋЖ]/u", $text, $dummy );
$numLatin = preg_match_all( "/[šđč枊ĐČĆŽ]/u", $text, $dummy );
if( $variant == 'sr-ec' ) {
return (boolean) ($numCyrillic > $numLatin);
} elseif( $variant == 'sr-el' ) {
return (boolean) ($numLatin > $numCyrillic);
if ( $variant == 'sr-ec' ) {
return (boolean) ( $numCyrillic > $numLatin );
} elseif ( $variant == 'sr-el' ) {
return (boolean) ( $numLatin > $numCyrillic );
} else {
return false;
}
@ -222,14 +226,14 @@ class LanguageSr extends LanguageSr_ec {
$variants = array( 'sr', 'sr-ec', 'sr-el' );
$variantfallbacks = array(
'sr' => 'sr-ec',
'sr' => 'sr-ec',
'sr-ec' => 'sr',
'sr-el' => 'sr',
);
$flags = array(
'S' => 'S', 'писмо' => 'S', 'pismo' => 'S',
'W' => 'W', 'реч' => 'W', 'reč' => 'W', 'ријеч' => 'W', 'riječ' => 'W'
'W' => 'W', 'реч' => 'W', 'reč' => 'W', 'ријеч' => 'W', 'riječ' => 'W'
);
$this->mConverter = new SrConverter( $this, 'sr', $variants, $variantfallbacks, $flags );
$wgHooks['PageContentSaveComplete'][] = $this->mConverter;
@ -262,10 +266,10 @@ class LanguageSr extends LanguageSr_ec {
return $forms[2];
} else {
switch ( $count % 10 ) {
case 1: return $forms[0];
case 1: return $forms[0];
case 2:
case 3:
case 4: return $forms[1];
case 4: return $forms[1];
default: return $forms[2];
}
}

View file

@ -34,17 +34,19 @@ class LanguageSr_ec extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
$forms = $this->preConvertPlural( $forms, 3 );
if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
return $forms[2];
} else {
switch ( $count % 10 ) {
case 1: return $forms[0];
case 1: return $forms[0];
case 2:
case 3:
case 4: return $forms[1];
case 4: return $forms[1];
default: return $forms[2];
}
}

View file

@ -34,17 +34,19 @@ class LanguageSr_el extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
$forms = $this->preConvertPlural( $forms, 3 );
if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
return $forms[2];
} else {
switch ( $count % 10 ) {
case 1: return $forms[0];
case 1: return $forms[0];
case 2:
case 3:
case 4: return $forms[1];
case 4: return $forms[1];
default: return $forms[2];
}
}

View file

@ -108,7 +108,7 @@ class TgConverter extends LanguageConverter {
function loadDefaultTables() {
$this->mTables = array(
'tg-latn' => new ReplacementArray( $this->table ),
'tg' => new ReplacementArray()
'tg' => new ReplacementArray()
);
}

View file

@ -36,7 +36,9 @@ class LanguageTi extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
$forms = $this->preConvertPlural( $forms, 2 );
return ( $count <= 1 ) ? $forms[0] : $forms[1];

View file

@ -36,7 +36,9 @@ class LanguageTl extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
$forms = $this->preConvertPlural( $forms, 2 );
return ( $count <= 1 ) ? $forms[0] : $forms[1];

View file

@ -48,32 +48,32 @@ class LanguageUk extends Language {
# join and array_slice instead mb_substr
$ar = array();
preg_match_all( '/./us', $word, $ar );
if ( !preg_match( "/[a-zA-Z_]/us", $word ) )
if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) {
switch ( $case ) {
case 'genitive': # родовий відмінок
if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вікі' ) || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вікі' ) )
{ }
elseif ( join( '', array_slice( $ar[0], -1 ) ) == 'ь' )
if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вікі' ) || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вікі' ) ) {
} elseif ( join( '', array_slice( $ar[0], -1 ) ) == 'ь' ) {
$word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'я';
elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ія' )
} elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ія' ) {
$word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'ії';
elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ка' )
} elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ка' ) {
$word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'ки';
elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ти' )
} elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ти' ) {
$word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'тей';
elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ди' )
} elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ди' ) {
$word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'дів';
elseif ( join( '', array_slice( $ar[0], -3 ) ) == 'ник' )
} elseif ( join( '', array_slice( $ar[0], -3 ) ) == 'ник' ) {
$word = join( '', array_slice( $ar[0], 0, -3 ) ) . 'ника';
}
break;
case 'dative': # давальний відмінок
# stub
break;
case 'accusative': # знахідний відмінок
if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вікі' ) || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вікі' ) )
{ }
elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ія' )
if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вікі' ) || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вікі' ) ) {
} elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ія' ) {
$word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'ію';
}
break;
case 'instrumental': # орудний відмінок
# stub
@ -82,6 +82,7 @@ class LanguageUk extends Language {
# stub
break;
}
}
return $word;
}
@ -91,13 +92,17 @@ class LanguageUk extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
// If the actual number is not mentioned in the expression, then just two forms are enough:
// singular for $count == 1
// plural for $count != 1
// For example, "This user belongs to {{PLURAL:$1|one group|several groups}}."
if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
if ( count( $forms ) === 2 ) {
return $count == 1 ? $forms[0] : $forms[1];
}
// @todo FIXME: CLDR defines 4 plural forms. Form for decimals is missing/
// See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#uk
@ -107,10 +112,10 @@ class LanguageUk extends Language {
return $forms[2];
} else {
switch ( $count % 10 ) {
case 1: return $forms[0];
case 1: return $forms[0];
case 2:
case 3:
case 4: return $forms[1];
case 4: return $forms[1];
default: return $forms[2];
}
}

View file

@ -75,9 +75,9 @@ class UzConverter extends LanguageConverter {
'f' => 'ф', 'F' => 'Ф',
'g' => 'г', 'G' => 'Г',
'g' => 'ғ', 'G' => 'Ғ', 'gʻ' => 'ғ', 'Gʻ' => 'Ғ',
'h' => 'ҳ', 'H' => 'Ҳ',
'h' => 'ҳ', 'H' => 'Ҳ',
'i' => 'и', 'I' => 'И',
'k' => 'к', 'K' => 'К',
'k' => 'к', 'K' => 'К',
'l' => 'л', 'L' => 'Л',
'm' => 'м', 'M' => 'М',
'n' => 'н', 'N' => 'Н',
@ -108,7 +108,7 @@ class UzConverter extends LanguageConverter {
$this->mTables = array(
'uz-cyrl' => new ReplacementArray( $this->toCyrillic ),
'uz-latn' => new ReplacementArray( $this->toLatin ),
'uz' => new ReplacementArray()
'uz' => new ReplacementArray()
);
}
@ -126,7 +126,7 @@ class LanguageUz extends Language {
$variants = array( 'uz', 'uz-latn', 'uz-cyrl' );
$variantfallbacks = array(
'uz' => 'uz-latn',
'uz' => 'uz-latn',
'uz-cyrl' => 'uz',
'uz-latn' => 'uz',
);

View file

@ -39,7 +39,9 @@ class LanguageWa extends Language {
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
if ( !count( $forms ) ) {
return '';
}
$forms = $this->preConvertPlural( $forms, 2 );
return ( $count <= 1 ) ? $forms[0] : $forms[1];
@ -67,14 +69,14 @@ class LanguageWa extends Language {
#
# we also output this format for YMD (eg: 2001 January 15)
if ( $datePreference == 'ISO 8601' ) {
$d = substr( $ts, 0, 4 ) . '-' . substr( $ts, 4, 2 ) . '-' . substr( $ts, 6, 2 );
return $d;
$d = substr( $ts, 0, 4 ) . '-' . substr( $ts, 4, 2 ) . '-' . substr( $ts, 6, 2 );
return $d;
}
# dd/mm/YYYY format
if ( $datePreference == 'walloon short' ) {
$d = substr( $ts, 6, 2 ) . '/' . substr( $ts, 4, 2 ) . '/' . substr( $ts, 0, 4 );
return $d;
$d = substr( $ts, 6, 2 ) . '/' . substr( $ts, 4, 2 ) . '/' . substr( $ts, 0, 4 );
return $d;
}
# Walloon format
@ -83,17 +85,17 @@ class LanguageWa extends Language {
$m = substr( $ts, 4, 2 );
$n = substr( $ts, 6, 2 );
if ( $n == 1 ) {
$d = "1î d' " . $this->getMonthName( $m ) .
" " . substr( $ts, 0, 4 );
$d = "1î d' " . $this->getMonthName( $m ) .
" " . substr( $ts, 0, 4 );
} elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
$d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
" " . substr( $ts, 0, 4 );
$d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
" " . substr( $ts, 0, 4 );
} elseif ( $m == 4 || $m == 8 || $m == 10 ) {
$d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
" " . substr( $ts, 0, 4 );
$d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
" " . substr( $ts, 0, 4 );
} else {
$d = ( 0 + $n ) . " di " . $this->getMonthName( $m ) .
" " . substr( $ts, 0, 4 );
$d = ( 0 + $n ) . " di " . $this->getMonthName( $m ) .
" " . substr( $ts, 0, 4 );
}
return $d;
}
@ -106,7 +108,9 @@ class LanguageWa extends Language {
* @return string
*/
function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
if ( $adj ) {
$ts = $this->userAdjust( $ts, $tc );
}
$datePreference = $this->dateFormat( $format );
if ( $datePreference == 'ISO 8601' ) {
return parent::timeanddate( $ts, $adj, $format, $tc );

View file

@ -50,15 +50,15 @@ class ZhConverter extends LanguageConverter {
$flags,
$manualLevel );
$names = array(
'zh' => '原文',
'zh' => '原文',
'zh-hans' => '简体',
'zh-hant' => '繁體',
'zh-cn' => '大陆',
'zh-tw' => '台灣',
'zh-hk' => '香港',
'zh-mo' => '澳門',
'zh-sg' => '新加坡',
'zh-my' => '大马',
'zh-cn' => '大陆',
'zh-tw' => '台灣',
'zh-hk' => '香港',
'zh-mo' => '澳門',
'zh-sg' => '新加坡',
'zh-my' => '大马',
);
$this->mVariantNames = array_merge( $this->mVariantNames, $names );
}
@ -68,13 +68,13 @@ class ZhConverter extends LanguageConverter {
$this->mTables = array(
'zh-hans' => new ReplacementArray( $zh2Hans ),
'zh-hant' => new ReplacementArray( $zh2Hant ),
'zh-cn' => new ReplacementArray( array_merge( $zh2Hans, $zh2CN ) ),
'zh-hk' => new ReplacementArray( array_merge( $zh2Hant, $zh2HK ) ),
'zh-mo' => new ReplacementArray( array_merge( $zh2Hant, $zh2HK ) ),
'zh-my' => new ReplacementArray( array_merge( $zh2Hans, $zh2SG ) ),
'zh-sg' => new ReplacementArray( array_merge( $zh2Hans, $zh2SG ) ),
'zh-tw' => new ReplacementArray( array_merge( $zh2Hant, $zh2TW ) ),
'zh' => new ReplacementArray
'zh-cn' => new ReplacementArray( array_merge( $zh2Hans, $zh2CN ) ),
'zh-hk' => new ReplacementArray( array_merge( $zh2Hant, $zh2HK ) ),
'zh-mo' => new ReplacementArray( array_merge( $zh2Hant, $zh2HK ) ),
'zh-my' => new ReplacementArray( array_merge( $zh2Hans, $zh2SG ) ),
'zh-sg' => new ReplacementArray( array_merge( $zh2Hans, $zh2SG ) ),
'zh-tw' => new ReplacementArray( array_merge( $zh2Hant, $zh2TW ) ),
'zh' => new ReplacementArray
);
}
@ -111,18 +111,18 @@ class LanguageZh extends LanguageZh_hans {
$variants = array( 'zh', 'zh-hans', 'zh-hant', 'zh-cn', 'zh-hk', 'zh-mo', 'zh-my', 'zh-sg', 'zh-tw' );
$variantfallbacks = array(
'zh' => array( 'zh-hans', 'zh-hant', 'zh-cn', 'zh-tw', 'zh-hk', 'zh-sg', 'zh-mo', 'zh-my' ),
'zh' => array( 'zh-hans', 'zh-hant', 'zh-cn', 'zh-tw', 'zh-hk', 'zh-sg', 'zh-mo', 'zh-my' ),
'zh-hans' => array( 'zh-cn', 'zh-sg', 'zh-my' ),
'zh-hant' => array( 'zh-tw', 'zh-hk', 'zh-mo' ),
'zh-cn' => array( 'zh-hans', 'zh-sg', 'zh-my' ),
'zh-sg' => array( 'zh-hans', 'zh-cn', 'zh-my' ),
'zh-my' => array( 'zh-hans', 'zh-sg', 'zh-cn' ),
'zh-tw' => array( 'zh-hant', 'zh-hk', 'zh-mo' ),
'zh-hk' => array( 'zh-hant', 'zh-mo', 'zh-tw' ),
'zh-mo' => array( 'zh-hant', 'zh-hk', 'zh-tw' ),
'zh-cn' => array( 'zh-hans', 'zh-sg', 'zh-my' ),
'zh-sg' => array( 'zh-hans', 'zh-cn', 'zh-my' ),
'zh-my' => array( 'zh-hans', 'zh-sg', 'zh-cn' ),
'zh-tw' => array( 'zh-hant', 'zh-hk', 'zh-mo' ),
'zh-hk' => array( 'zh-hant', 'zh-mo', 'zh-tw' ),
'zh-mo' => array( 'zh-hant', 'zh-hk', 'zh-tw' ),
);
$ml = array(
'zh' => 'disable',
'zh' => 'disable',
'zh-hans' => 'unidirectional',
'zh-hant' => 'unidirectional',
);

View file

@ -305,7 +305,7 @@ class CLDRPluralRuleConverter {
continue;
} else {
// Operator
if ( !$expectOperator ) {
if ( !$expectOperator ) {
$token->error( 'unexpected operator' );
}
// Resolve higher precedence levels
@ -381,7 +381,7 @@ class CLDRPluralRuleConverter {
// Word
if ( !preg_match( self::WORD_REGEX, $this->rule, $m, 0, $this->pos ) ) {
$this->error( 'unexpected character "' . $this->rule[$this->pos] . '"' );
$this->error( 'unexpected character "' . $this->rule[$this->pos] . '"' );
}
$word1 = strtolower( $m[0] );
$word2 = '';