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.php52
1 files changed, 28 insertions, 24 deletions
diff --git a/languages/classes/LanguageKk.php b/languages/classes/LanguageKk.php
index 6dd6959f..f96b0d92 100644
--- a/languages/classes/LanguageKk.php
+++ b/languages/classes/LanguageKk.php
@@ -21,8 +21,8 @@
* @ingroup Language
*/
-require_once( __DIR__ . '/../LanguageConverter.php' );
-require_once( __DIR__ . '/LanguageKk_cyrl.php' );
+require_once __DIR__ . '/../LanguageConverter.php';
+require_once __DIR__ . '/LanguageKk_cyrl.php';
define( 'KK_C_UC', 'АӘБВГҒДЕЁЖЗИЙКҚЛМНҢОӨПРСТУҰҮФХҺЦЧШЩЪЫІЬЭЮЯ' ); # Kazakh Cyrillic uppercase
define( 'KK_C_LC', 'аәбвгғдеёжзийкқлмнңоөпрстуұүфхһцчшщъыіьэюя' ); # Kazakh Cyrillic lowercase
@@ -62,24 +62,24 @@ class KkConverter extends LanguageConverter {
}
function loadDefaultTables() {
- // require( __DIR__."/../../includes/KkConversion.php" );
+ // require __DIR__."/../../includes/KkConversion.php";
// Placeholder for future implementing. Remove variables declarations
// after generating KkConversion.php
$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' => '؀', # ؀
'/\,/' => '،', # ،
- '/;/' => '؛', # ؛
+ '/;/' => '؛', # ؛
'/\?/' => '؟', # ؟
- '/%/' => '٪', # ٪
+ '/%/' => '٪', # ٪
'/\*/' => '٭', # ٭
# # Digits -> Arabic
'/0/' => '۰', # ۰
@@ -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;
+ }
}
/**
@@ -280,9 +282,11 @@ class KkConverter extends LanguageConverter {
*/
function autoConvert( $text, $toVariant = false ) {
global $wgTitle;
- if ( is_object( $wgTitle ) && $wgTitle->getNameSpace() == NS_FILE ) {
+ 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 );
}
@@ -299,7 +303,7 @@ class KkConverter extends LanguageConverter {
global $wgLanguageCode;
$text = parent::translate( $text, $toVariant );
- switch( $toVariant ) {
+ switch ( $toVariant ) {
case 'kk-cyrl':
case 'kk-kz':
$letters = KK_L_UC . KK_L_LC . 'ʺʹ#0123456789';
@@ -343,7 +347,7 @@ class KkConverter extends LanguageConverter {
return $text;
}
- switch( $toVariant ) {
+ switch ( $toVariant ) {
case 'kk-arab':
case 'kk-cn':
$letters = KK_C_LC . KK_C_UC/*.KK_L_LC.KK_L_UC*/;
@@ -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 );
@@ -435,7 +439,7 @@ class LanguageKk extends LanguageKk_cyrl {
*
* @return string
*/
- function ucfirst ( $string ) {
+ function ucfirst( $string ) {
$variant = $this->getPreferredVariant();
if ( ( $variant == 'kk-latn' || $variant == 'kk-tr' ) && $string[0] == 'i' ) {
$string = 'İ' . substr( $string, 1 );
@@ -452,7 +456,7 @@ class LanguageKk extends LanguageKk_cyrl {
*
* @return string
*/
- function lcfirst ( $string ) {
+ function lcfirst( $string ) {
$variant = $this->getPreferredVariant();
if ( ( $variant == 'kk-latn' || $variant == 'kk-tr' ) && $string[0] == 'I' ) {
$string = 'ı' . substr( $string, 1 );