* @ingroup Language
*/
class LanguageCu extends Language {
- # Convert from the nominative form of a noun to some other case
- # Invoked with {{grammar:case|word}}
+
+ /**
+ * Convert from the nominative form of a noun to some other case
+ * Invoked with {{grammar:case|word}}
+ *
+ * @param $word string
+ * @param $case string
+ * @return string
+ */
function convertGrammar( $word, $case ) {
global $wgGrammarForms;
if ( isset( $wgGrammarForms['сu'][$case][$word] ) ) {
*/
class LanguageDsb extends Language {
- # Convert from the nominative form of a noun to some other case
- # Invoked with {{GRAMMAR:case|word}}
-
+ /**
+ * Convert from the nominative form of a noun to some other case
+ * Invoked with {{grammar:case|word}}
+ *
+ * @param $word string
+ * @param $case string
+ * @return string
+ */
function convertGrammar( $word, $case ) {
global $wgGrammarForms;
if ( isset( $wgGrammarForms['dsb'][$case][$word] ) ) {
return parent::iconv( $in, $out, $string );
}
+ /**
+ * @param $matches array
+ * @return string
+ */
function strrtuxCallback( $matches ) {
static $ux = array (
'x' => 'xx' , 'X' => 'Xx' ,
return strtr( $matches[1], $ux );
}
+ /**
+ * @param $matches array
+ * @return string
+ */
function strrtxuCallback( $matches ) {
static $xu = array (
'xx' => 'x' , 'xX' => 'x' ,
return strtr( $matches[1], $xu ) . strtr( $matches[2], $xu );
}
+ /**
+ * @param $s string
+ * @return string
+ */
function checkTitleEncoding( $s ) {
# Check for X-system backwards-compatibility URLs
$ishigh = preg_match( '/[\x80-\xff]/', $s );
*/
class LanguageFi extends Language {
- # Convert from the nominative form of a noun to some other case
- # Invoked with {{GRAMMAR:case|word}}
+ /**
+ * Convert from the nominative form of a noun to some other case
+ * Invoked with {{grammar:case|word}}
+ *
+ * @param $word string
+ * @param $case string
+ * @return string
+ */
function convertGrammar( $word, $case ) {
global $wgGrammarForms;
if ( isset( $wgGrammarForms['fi'][$case][$word] ) ) {
return $word;
}
+ /**
+ * @param $str string
+ * @param $forContent bool
+ * @return string
+ */
function translateBlockExpiry( $str, $forContent = false ) {
/*
'ago', 'now', 'today', 'this', 'next',
* @ingroup Language
*/
class LanguageGa extends Language {
- # Convert day names
- # Invoked with {{GRAMMAR:transformation|word}}
+
+ /**
+ * Convert day names
+ * Invoked with {{GRAMMAR:transformation|word}}
+ *
+ * @param $word string
+ * @param $case string
+ * @return string
+ */
function convertGrammar( $word, $case ) {
global $wgGrammarForms;
if ( isset( $wgGrammarForms['ga'][$case][$word] ) ) {
*/
class GanConverter extends LanguageConverter {
+ /**
+ * @param $langobj Language
+ * @param $maincode string
+ * @param $variants array
+ * @param $variantfallbacks array
+ * @param $flags array
+ * @param $manualLevel array
+ */
function __construct( $langobj, $maincode,
$variants = array(),
$variantfallbacks = array(),
);
}
- /* there shouldn't be any latin text in Chinese conversion, so no need
- to mark anything.
- $noParse is there for compatibility with LanguageConvert::markNoConversion
+ /**
+ * there shouldn't be any latin text in Chinese conversion, so no need
+ * to mark anything.
+ * $noParse is there for compatibility with LanguageConvert::markNoConversion
+ *
+ * @param $text string
+ * @param $noParse bool
+ *
+ * @return string
*/
function markNoConversion( $text, $noParse = false ) {
return $text;
}
+ /**
+ * @param $key string
+ * @return String
+ */
function convertCategoryKey( $key ) {
return $this->autoConvert( $key, 'gan' );
}
$wgHooks['ArticleSaveComplete'][] = $this->mConverter;
}
- # this should give much better diff info
+ /**
+ * this should give much better diff info
+ *
+ * @param $text string
+ * @return string
+ */
function segmentForDiff( $text ) {
return preg_replace(
"/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
"' ' .\"$1\"", $text );
}
+ /**
+ * @param $text string
+ * @return string
+ */
function unsegmentForDiff( $text ) {
return preg_replace(
"/ ([\\xc0-\\xff][\\x80-\\xbf]*)/e",
"\"$1\"", $text );
}
- // word segmentation
+ /**
+ * word segmentation
+ *
+ * @param $string string
+ * @param $autoVariant string
+ * @return String
+ */
function normalizeForSearch( $string, $autoVariant = 'gan-hans' ) {
// LanguageZh::normalizeForSearch
return parent::normalizeForSearch( $string, $autoVariant );
}
+ /**
+ * @param $termsArray array
+ * @return array
+ */
function convertForSearchResult( $termsArray ) {
$terms = implode( '|', $termsArray );
$terms = self::convertDoubleWidth( $terms );
class LanguageHsb extends Language {
- # Convert from the nominative form of a noun to some other case
- # Invoked with {{GRAMMAR:case|word}}
-
+ /**
+ * Convert from the nominative form of a noun to some other case
+ * Invoked with {{grammar:case|word}}
+ *
+ * @param $word string
+ * @param $case string
+ * @return string
+ */
function convertGrammar( $word, $case ) {
global $wgGrammarForms;
if ( isset( $wgGrammarForms['hsb'][$case][$word] ) ) {
* @author Ruben Vardanyan (Me@RubenVardanyan.com)
*/
class LanguageHy extends Language {
- # Convert from the nominative form of a noun to some other case
- # Invoked with {{grammar:case|word}}
+
+ /**
+ * Convert from the nominative form of a noun to some other case
+ * Invoked with {{grammar:case|word}}
+ *
+ * @param $word string
+ * @param $case string
+ * @return string
+ */
function convertGrammar( $word, $case ) {
global $wgGrammarForms;
if ( isset( $wgGrammarForms['hy'][$case][$word] ) ) {
*/
require_once( dirname( __FILE__ ) . '/../LanguageConverter.php' );
+/**
+ *
+ */
class IuConverter extends LanguageConverter {
var $mToLatin = array(
'ᐦ' => 'h', 'ᐃ' => 'i', 'ᐄ' => 'ii', 'ᐅ' => 'u', 'ᐆ' => 'uu', 'ᐊ' => 'a', 'ᐋ' => 'aa',
);
}
- /* rules should be defined as -{Syllabic | Latin-} -or-
- -{code:text | code:text | ...}-
- update: delete all rule parsing because it's not used
- currently, and just produces a couple of bugs
- */
+ /**
+ * rules should be defined as -{Syllabic | Latin-} -or-
+ * -{code:text | code:text | ...}-
+ * update: delete all rule parsing because it's not used
+ * currently, and just produces a couple of bugs
+ *
+ * @param $rule string
+ * @param $flags array
+ * @return array
+ */
function parseManualRule( $rule, $flags = array() ) {
if ( in_array( 'T', $flags ) ) {
return parent::parseManualRule( $rule, $flags );
return $carray;
}
- // Do not convert content on talk pages
+ /**
+ * Do not convert content on talk pages
+ *
+ * @param $text string
+ * @param $parser Parser
+ * @return string
+ */
function parserConvert( $text, &$parser ) {
if ( is_object( $parser->getTitle() ) && $parser->getTitle()->isTalkPage() )
$this->mDoContentConvert = false;
* - if there is no selected variant, leave the link
* names as they were
* - do not try to find variants for usernames
+ *
+ * @param $link string
+ * @param $nt Title
+ * @param $ignoreOtherCond bool
*/
function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
// check for user namespace
* We want our external link captions to be converted in variants,
* so we return the original text instead -{$text}-, except for URLs
*
+ * @param $text string
+ * @param $noParse bool
+ *
* @return string
*/
function markNoConversion( $text, $noParse = false ) {
* An ugly function wrapper for parsing Image titles
* (to prevent image name conversion)
*
+ * @param $text string
+ * @param $toVariant bool
+ *
* @return string
*/
function autoConvert( $text, $toVariant = false ) {
/**
* It translates text into variant
*
+ * @param $text string
+ * @param $toVariant bool
+ *
* @return string
*/
function translate( $text, $toVariant ) {
/**
* Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms
*
+ * @param $word string
+ * @param $case string
+ *
* @return string
*/
function convertGrammar( $word, $case ) {
/**
* It fixes issue with ucfirst for transforming 'i' to 'İ'
*
+ * @param $string string
+ *
* @return string
*/
function ucfirst ( $string ) {
protected $mCyrl2Latn, $mLatn2Cyrl, $mCyLa2Arab;
+ /**
+ * @param $langobj Language
+ * @param $maincode string
+ * @param $variants array
+ * @param $variantfallbacks array
+ * @param $flags array
+ */
function __construct( $langobj, $maincode,
$variants = array(),
$variantfallbacks = array(),
);
}
- /* rules should be defined as -{ekavian | iyekavian-} -or-
- -{code:text | code:text | ...}-
- update: delete all rule parsing because it's not used
- currently, and just produces a couple of bugs
- */
+ /**
+ * rules should be defined as -{ekavian | iyekavian-} -or-
+ * -{code:text | code:text | ...}-
+ *
+ * update: delete all rule parsing because it's not used
+ * currently, and just produces a couple of bugs
+ *
+ * @param $rule string
+ * @param $flags array
+ * @return array
+ */
function parseManualRule( $rule, $flags = array() ) {
if ( in_array( 'T', $flags ) ) {
return parent::parseManualRule( $rule, $flags );
* - if there is no selected variant, leave the link
* names as they were
* - do not try to find variants for usernames
+ *
+ * @param $link string
+ * @param $nt Title
+ * @param bool $ignoreOtherCond
*/
function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
// check for user namespace
* An ugly function wrapper for parsing Image titles
* (to prevent image name conversion)
*
+ * @param $text string
+ * @param $toVariant bool
+ *
* @return string
*/
function autoConvert( $text, $toVariant = false ) {
/**
* It translates text into variant
*
+ * @param $text string
+ * @param $toVariant string
+ *
* @return string
*/
function translate( $text, $toVariant ) {
return $ret;
}
+ /**
+ * @param $text string
+ * @param $toVariant string
+ * @return mixed|string
+ */
function regsConverter( $text, $toVariant ) {
if ( $text == '' ) {
return $text;
* We want our external link captions to be converted in variants,
* so we return the original text instead -{$text}-, except for URLs
*
+ * @param $text string
+ * @param $noParse string|bool
+ *
* @return string
*/
function markNoConversion( $text, $noParse = false ) {
return $word;
}
+ /**
+ * @param $word string
+ * @param $case string
+ * @return string
+ */
function convertGrammarKk_latn( $word, $case ) {
global $wgGrammarForms;
if ( isset( $wgGrammarForms['kk-tr'][$case][$word] ) ) {
return $word;
}
+ /**
+ * @param $word string
+ * @param $case string
+ * @return string
+ */
function convertGrammarKk_arab( $word, $case ) {
global $wgGrammarForms;
if ( isset( $wgGrammarForms['kk-cn'][$case][$word] ) ) {
return $word;
}
+ /**
+ * @param $word string
+ * @param $allVowels array
+ * @return array
+ */
function lastLetter( $word, $allVowels ) {
$lastLetter = array();
* - if there is no selected variant, leave the link
* names as they were
* - do not try to find variants for usernames
+ *
+ * @param $link string
+ * @param $nt Title
+ * @param $ignoreOtherCond bool
*/
function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
// check for user namespace
* We want our external link captions to be converted in variants,
* so we return the original text instead -{$text}-, except for URLs
*
+ * @param $text string
+ * @param $noParse bool
+ *
* @return string
*/
function markNoConversion( $text, $noParse = false ) {
* An ugly function wrapper for parsing Image titles
* (to prevent image name conversion)
*
+ * @param $text string
+ * @param $toVariant bool
+ *
* @return string
*/
function autoConvert( $text, $toVariant = false ) {
* It translates text into variant, specials:
* - ommiting roman numbers
*
+ * @param $text string
+ * @param $toVariant bool
+ *
* @return string
*/
function translate( $text, $toVariant ) {
* @ingroup Language
*/
class LanguageRu extends Language {
- # Convert from the nominative form of a noun to some other case
- # Invoked with {{grammar:case|word}}
+
+ /**
+ * Convert from the nominative form of a noun to some other case
+ * Invoked with {{grammar:case|word}}
+ *
+ * @param $word string
+ * @param $case string
+ * @return string
+ */
function convertGrammar( $word, $case ) {
global $wgGrammarForms;
if ( isset( $wgGrammarForms['ru'][$case][$word] ) ) {
);
}
- /* rules should be defined as -{ekavian | iyekavian-} -or-
- -{code:text | code:text | ...}-
- update: delete all rule parsing because it's not used
- currently, and just produces a couple of bugs
- */
+ /**
+ * rules should be defined as -{ekavian | iyekavian-} -or-
+ * -{code:text | code:text | ...}-
+ *
+ * update: delete all rule parsing because it's not used
+ * currently, and just produces a couple of bugs
+ *
+ * @param $rule string
+ * @param $flags array
+ * @return array
+ */
function parseManualRule( $rule, $flags = array() ) {
if ( in_array( 'T', $flags ) ) {
return parent::parseManualRule( $rule, $flags );
* - if there is no selected variant, leave the link
* names as they were
* - do not try to find variants for usernames
+ *
+ * @param $link string
+ * @param $nt Title
+ * @param $ignoreOtherCond bool
*/
function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
// check for user namespace
* We want our external link captions to be converted in variants,
* so we return the original text instead -{$text}-, except for URLs
*
+ * @param $text string
+ * @param $noParse bool
+ *
* @return string
*/
function markNoConversion( $text, $noParse = false ) {
* An ugly function wrapper for parsing Image titles
* (to prevent image name conversion)
*
+ * @param $text string
+ * @param $toVariant bool
+ *
* @return string
*/
function autoConvert( $text, $toVariant = false ) {
* It translates text into variant, specials:
* - ommiting roman numbers
*
+ * @param $text string
+ * @param $toVariant string
+ *
* @return string
*/
function translate( $text, $toVariant ) {
* @author Nikola Smolenski <smolensk@eunet.rs>
* @since 1.18
*
+ * @param $text string
+ * @param $variant string
+ *
* @return bool
*/
public function guessVariant( $text, $variant ) {
* @see bug 28040
*
* @param $string string
- * @param $first string
+ * @param $first string|bool
*
* @return string
*/
* @see bug 28040
*
* @param $string string
- * @param $first string
+ * @param $first string|bool
*
* @return string
*/
* @ingroup Language
*/
class LanguageUk extends Language {
- # Convert from the nominative form of a noun to some other case
- # Invoked with {{grammar:case|word}}
+
+ /**
+ * Convert from the nominative form of a noun to some other case
+ * Invoked with {{grammar:case|word}}
+ *
+ * @param $word string
+ * @param $case string
+ * @return string
+ */
function convertGrammar( $word, $case ) {
global $wgGrammarForms;
if ( isset( $wgGrammarForms['uk'][$case][$word] ) ) {
return ( $count <= 1 ) ? $forms[0] : $forms[1];
}
- ## #
- ## # Dates in Walloon are "1î d' <monthname>" for 1st of the month,
- ## # "<day> di <monthname>" for months starting by a consoun, and
- ## # "<day> d' <monthname>" for months starting with a vowel
- ## #
+ /**
+ * Dates in Walloon are "1î d' <monthname>" for 1st of the month,
+ * "<day> di <monthname>" for months starting by a consoun, and
+ * "<day> d' <monthname>" for months starting with a vowel
+ *
+ * @param $ts string
+ * @param $adj bool
+ * @param $format bool
+ * @param $tc bool
+ * @return string
+ */
function date( $ts, $adj = false, $format = true, $tc = false ) {
$ts = wfTimestamp( TS_MW, $ts );
if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
return $d;
}
+ /**
+ * @param $ts string
+ * @param $adj bool
+ * @param $format bool
+ * @param $tc bool
+ * @return string
+ */
function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
$datePreference = $this->dateFormat( $format );
*/
class ZhConverter extends LanguageConverter {
+ /**
+ * @param $langobj Language
+ * @param $maincode string
+ * @param $variants array
+ * @param $variantfallbacks array
+ * @param $flags array
+ * @param $manualLevel array
+ */
function __construct( $langobj, $maincode,
$variants = array(),
$variantfallbacks = array(),
$this->mTables['zh-tw']->merge( $this->mTables['zh-hant'] );
}
- /* there shouldn't be any latin text in Chinese conversion, so no need
- to mark anything.
- $noParse is there for compatibility with LanguageConvert::markNoConversion
+ /**
+ * there shouldn't be any latin text in Chinese conversion, so no need
+ * to mark anything.
+ * $noParse is there for compatibility with LanguageConvert::markNoConversion
+ *
+ * @param $text string
+ * @param $noParse bool
+ *
+ * @return string
*/
function markNoConversion( $text, $noParse = false ) {
return $text;
}
+ /**
+ * @param $key string
+ * @return String
+ */
function convertCategoryKey( $key ) {
return $this->autoConvert( $key, 'zh' );
}
$wgHooks['ArticleSaveComplete'][] = $this->mConverter;
}
- # this should give much better diff info
+ /**
+ * this should give much better diff info
+ *
+ * @param $text string
+ * @return string
+ */
function segmentForDiff( $text ) {
return preg_replace(
"/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
"' ' .\"$1\"", $text );
}
+ /**
+ * @param $text string
+ * @return string
+ */
function unsegmentForDiff( $text ) {
return preg_replace(
"/ ([\\xc0-\\xff][\\x80-\\xbf]*)/e",
}
+ /**
+ * @param $termsArray array
+ * @return array
+ */
function convertForSearchResult( $termsArray ) {
$terms = implode( '|', $termsArray );
$terms = self::convertDoubleWidth( $terms );