summaryrefslogtreecommitdiff
path: root/languages/classes/LanguageKk.php
diff options
context:
space:
mode:
Diffstat (limited to 'languages/classes/LanguageKk.php')
-rw-r--r--languages/classes/LanguageKk.php75
1 files changed, 65 insertions, 10 deletions
diff --git a/languages/classes/LanguageKk.php b/languages/classes/LanguageKk.php
index e3caacc8..953a3f97 100644
--- a/languages/classes/LanguageKk.php
+++ b/languages/classes/LanguageKk.php
@@ -18,6 +18,15 @@ define( 'H_HAMZA', 'ٴ' ); # U+0674 ARABIC LETTER HIGH HAMZA
*/
class KkConverter extends LanguageConverter {
+ 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(),
@@ -190,16 +199,23 @@ class KkConverter extends LanguageConverter {
);
}
- /* rules should be defined as -{ekavian | iyekavian-} -or-
- -{code:text | code:text | ...}-
- update: delete all rule parsing because it's not used
- currently, and just produces a couple of bugs
- */
+ /**
+ * rules should be defined as -{ekavian | iyekavian-} -or-
+ * -{code:text | code:text | ...}-
+ *
+ * update: delete all rule parsing because it's not used
+ * currently, and just produces a couple of bugs
+ *
+ * @param $rule string
+ * @param $flags array
+ * @return array
+ */
function parseManualRule( $rule, $flags = array() ) {
if ( in_array( 'T', $flags ) ) {
return parent::parseManualRule( $rule, $flags );
}
+ $carray = array();
// otherwise ignore all formatting
foreach ( $this->mVariants as $v ) {
$carray[$v] = $rule;
@@ -208,11 +224,15 @@ class KkConverter extends LanguageConverter {
return $carray;
}
- /*
+ /**
* A function wrapper:
* - if there is no selected variant, leave the link
* names as they were
* - do not try to find variants for usernames
+ *
+ * @param $link string
+ * @param $nt Title
+ * @param bool $ignoreOtherCond
*/
function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
// check for user namespace
@@ -228,9 +248,14 @@ class KkConverter extends LanguageConverter {
$link = $oldlink;
}
- /*
+ /**
* An ugly function wrapper for parsing Image titles
* (to prevent image name conversion)
+ *
+ * @param $text string
+ * @param $toVariant bool
+ *
+ * @return string
*/
function autoConvert( $text, $toVariant = false ) {
global $wgTitle;
@@ -243,6 +268,11 @@ class KkConverter extends LanguageConverter {
/**
* It translates text into variant
+ *
+ * @param $text string
+ * @param $toVariant string
+ *
+ * @return string
*/
function translate( $text, $toVariant ) {
global $wgLanguageCode;
@@ -282,6 +312,11 @@ class KkConverter extends LanguageConverter {
return $ret;
}
+ /**
+ * @param $text string
+ * @param $toVariant string
+ * @return mixed|string
+ */
function regsConverter( $text, $toVariant ) {
if ( $text == '' ) {
return $text;
@@ -334,9 +369,14 @@ class KkConverter extends LanguageConverter {
}
}
- /*
+ /**
* 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 ) {
if ( $noParse || preg_match( "/^https?:\/\/|ftp:\/\/|irc:\/\//", $text ) )
@@ -344,6 +384,10 @@ class KkConverter extends LanguageConverter {
return $text;
}
+ /**
+ * @param $key string
+ * @return String
+ */
function convertCategoryKey( $key ) {
return $this->autoConvert( $key, 'kk' );
}
@@ -392,9 +436,12 @@ class LanguageKk extends LanguageKk_cyrl {
}
}
- /*
+ /**
* It fixes issue with ucfirst for transforming 'i' to 'İ'
*
+ * @param $string string
+ *
+ * @return string
*/
function ucfirst ( $string ) {
$variant = $this->getPreferredVariant();
@@ -406,9 +453,12 @@ class LanguageKk extends LanguageKk_cyrl {
return $string;
}
- /*
+ /**
* It fixes issue with lcfirst for transforming 'I' to 'ı'
*
+ * @param $string string
+ *
+ * @return string
*/
function lcfirst ( $string ) {
$variant = $this->getPreferredVariant();
@@ -420,6 +470,11 @@ class LanguageKk extends LanguageKk_cyrl {
return $string;
}
+ /**
+ * @param $word string
+ * @param $case string
+ * @return string
+ */
function convertGrammar( $word, $case ) {
wfProfileIn( __METHOD__ );