$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 ? '[-_]' : '-';
$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':
}
if ( strlen( $s ) == 2 ) {
$str = $s . "'";
- } else {
+ } else {
$str = substr( $s, 0, strlen( $s ) - 2 ) . '"';
$str .= substr( $s, strlen( $s ) - 2, 2 );
}
# 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();
* @since 1.20
*/
function getDirMarkEntity( $opposite = false ) {
- if ( $opposite ) { return $this->isRTL() ? '‎' : '‏'; }
+ if ( $opposite ) {
+ return $this->isRTL() ? '‎' : '‏';
+ }
return $this->isRTL() ? '‏' : '‎';
}
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;
}
$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
# 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];
}
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];
function getGrammarForms() {
global $wgGrammarForms;
if ( isset( $wgGrammarForms[$this->getCode()] ) && is_array( $wgGrammarForms[$this->getCode()] ) ) {
- return $wgGrammarForms[$this->getCode()];
+ return $wgGrammarForms[$this->getCode()];
}
return array();
}
}
}
- if( $this->guessVariant( $text, $toVariant ) ) {
+ if ( $this->guessVariant( $text, $toVariant ) ) {
wfProfileOut( __METHOD__ );
return $text;
}
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;
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;
$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;
// 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] ) ) {
*/
/**
- * 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
'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
'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)
'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
* @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
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];
}
}
# 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;
}
* @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];
}
}
*/
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 );
}
*/
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 );
}
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;
}
# 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':
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;
$flags,
$manualLevel );
$names = array(
- 'gan' => '原文',
+ 'gan' => '原文',
'gan-hans' => '简体',
'gan-hant' => '繁體',
);
$this->mTables = array(
'gan-hans' => new ReplacementArray( $zh2Hans ),
'gan-hant' => new ReplacementArray( $zh2Hant ),
- 'gan' => new ReplacementArray
+ 'gan' => new ReplacementArray
);
}
$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',
* @return string
*/
function convertPlural( $count, $forms ) {
- if ( !count( $forms ) ) { return ''; }
+ if ( !count( $forms ) ) {
+ return '';
+ }
$forms = $this->preConvertPlural( $forms, 4 );
* @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];
* @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 );
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];
}
}
# 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
# stub
break;
}
+ }
return $word;
}
'lowercase' => new ReplacementArray( $this->mUpperToLowerCaseLatin ),
'ike-cans' => new ReplacementArray( $this->mToSyllabics ),
'ike-latn' => new ReplacementArray( $this->mToLatin ),
- 'iu' => new ReplacementArray()
+ 'iu' => new ReplacementArray()
);
}
* @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;
+ }
}
/**
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 );
}
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 );
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;
$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()
);
}
# # Punctuation -> Arabic
'/#|№|No\./u' => '', # ؀
'/\,/' => '،', # ،
- '/;/' => '؛', # ؛
+ '/;/' => '؛', # ؛
'/\?/' => '؟', # ؟
- '/%/' => '٪', # ٪
+ '/%/' => '٪', # ٪
'/\*/' => '٭', # ٭
# # Digits -> Arabic
'/0/' => '۰', # ۰
// 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;
+ }
}
/**
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 );
}
$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 );
} 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 . "на";
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;
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 ) ) {
} 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 ) ) {
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 ) ) {
} 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";
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;
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 ) ) {
} 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 ) ) {
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 ) ) {
// Set up some constants...
// Vowels in last syllable
$frontVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە" );
- $backVowels = array( "ا", "و", "ۇ", "ى" );
+ $backVowels = array( "ا", "و", "ۇ", "ى" );
$allVowels = array( "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە", "ا", "و", "ۇ", "ى" );
// Preceding letters
$Nasals = array( "م", "ن", "ڭ" );
} 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 . "نا";
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;
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 ) ) {
} 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 ) ) {
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 ) ) {
switch ( $gender ) {
case 'm':
$lord = 'dä';
- break ;
+ break;
case 'f':
$lord = 'di';
break;
* @return string
*/
function convertPlural( $count, $forms ) {
- if ( !count( $forms ) ) { return ''; }
+ if ( !count( $forms ) ) {
+ return '';
+ }
$forms = $this->preConvertPlural( $forms, 3 );
if ( $count == 1 ) {
/* 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', # ٠
' o' => 'ئۆ ',
' u' => 'ئو ',
' û' => 'ئوو ',
- 'A' => 'ئا',
- 'E' => 'ئە',
- 'Ê' => 'ئێ',
- 'Î' => 'ئی',
- 'O' => 'ئۆ',
- 'U' => 'ئو',
- 'Û' => 'ئوو',
+ 'A' => 'ئا',
+ 'E' => 'ئە',
+ 'Ê' => 'ئێ',
+ 'Î' => 'ئی',
+ 'O' => 'ئۆ',
+ 'U' => 'ئو',
+ 'Û' => 'ئوو',
' A' => 'ئا ',
' E' => 'ئە ',
' Ê' => 'ئێ ',
$this->mTables = array(
'ku-latn' => new ReplacementArray( $this->mArabicToLatin ),
'ku-arab' => new ReplacementArray( $this->mLatinToArabic ),
- 'ku' => new ReplacementArray()
+ 'ku' => new ReplacementArray()
);
}
// 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;
+ }
}
/**
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 );
}
$variants = array( 'ku', 'ku-arab', 'ku-latn' );
$variantfallbacks = array(
- 'ku' => 'ku-latn',
+ 'ku' => 'ku-latn',
'ku-arab' => 'ku-latn',
'ku-latn' => 'ku-arab',
);
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;
* @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];
* @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];
}
}
# 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;
}
* @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 ) {
* @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
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];
}
}
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' => 'ⵒ',
'lowercase' => new ReplacementArray( $this->mUpperToLowerCaseLatin ),
'shi-tfng' => new ReplacementArray( $this->mToTifinagh ),
'shi-latn' => new ReplacementArray( $this->mToLatin ),
- 'shi' => new ReplacementArray()
+ 'shi' => new ReplacementArray()
);
}
* @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;
+ }
}
/**
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 );
}
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 );
$variants = array( 'shi', 'shi-tfng', 'shi-latn' );
$variantfallbacks = array(
- 'shi' => 'shi-tfng',
+ 'shi' => 'shi-tfng',
'shi-tfng' => 'shi',
'shi-latn' => 'shi',
);
* @return string
*/
function convertPlural( $count, $forms ) {
- if ( !count( $forms ) ) { return ''; }
+ if ( !count( $forms ) ) {
+ return '';
+ }
$forms = $this->preConvertPlural( $forms, 3 );
if ( $count == 1 ) {
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
$this->mTables = array(
'sr-ec' => new ReplacementArray( $this->mToCyrillics ),
'sr-el' => new ReplacementArray( $this->mToLatin ),
- 'sr' => new ReplacementArray()
+ 'sr' => new ReplacementArray()
);
}
// 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;
+ }
}
/**
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 );
}
* @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;
}
$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;
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];
}
}
* @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];
}
}
* @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];
}
}
function loadDefaultTables() {
$this->mTables = array(
'tg-latn' => new ReplacementArray( $this->table ),
- 'tg' => new ReplacementArray()
+ 'tg' => new ReplacementArray()
);
}
* @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];
* @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];
# 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
# stub
break;
}
+ }
return $word;
}
* @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
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];
}
}
'f' => 'ф', 'F' => 'Ф',
'g' => 'г', 'G' => 'Г',
'g‘' => 'ғ', 'G‘' => 'Ғ', 'gʻ' => 'ғ', 'Gʻ' => 'Ғ',
- 'h' => 'ҳ', 'H' => 'Ҳ',
+ 'h' => 'ҳ', 'H' => 'Ҳ',
'i' => 'и', 'I' => 'И',
- 'k' => 'к', 'K' => 'К',
+ 'k' => 'к', 'K' => 'К',
'l' => 'л', 'L' => 'Л',
'm' => 'м', 'M' => 'М',
'n' => 'н', 'N' => 'Н',
$this->mTables = array(
'uz-cyrl' => new ReplacementArray( $this->toCyrillic ),
'uz-latn' => new ReplacementArray( $this->toLatin ),
- 'uz' => new ReplacementArray()
+ 'uz' => new ReplacementArray()
);
}
$variants = array( 'uz', 'uz-latn', 'uz-cyrl' );
$variantfallbacks = array(
- 'uz' => 'uz-latn',
+ 'uz' => 'uz-latn',
'uz-cyrl' => 'uz',
'uz-latn' => 'uz',
);
* @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];
#
# 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
$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;
}
* @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 );
$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 );
}
$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
);
}
$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',
);
continue;
} else {
// Operator
- if ( !$expectOperator ) {
+ if ( !$expectOperator ) {
$token->error( 'unexpected operator' );
}
// Resolve higher precedence levels
// 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 = '';