2007-05-01 15:02:44 +00:00
|
|
|
|
<?php
|
2012-06-07 11:06:19 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* Kazakh (Қазақша) specific code.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
*
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
|
*
|
|
|
|
|
|
* @file
|
|
|
|
|
|
* @ingroup Language
|
|
|
|
|
|
*/
|
2006-11-06 17:46:58 +00:00
|
|
|
|
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* class that handles Cyrillic, Latin and Arabic scripts for Kazakh
|
|
|
|
|
|
* right now it only distinguish kk_cyrl, kk_latn, kk_arab and kk_kz, kk_tr, kk_cn.
|
|
|
|
|
|
*
|
|
|
|
|
|
* @ingroup Language
|
|
|
|
|
|
*/
|
2007-12-09 16:24:35 +00:00
|
|
|
|
class LanguageKk extends LanguageKk_cyrl {
|
2011-05-22 22:05:18 +00:00
|
|
|
|
/**
|
2007-12-17 15:31:32 +00:00
|
|
|
|
* It fixes issue with ucfirst for transforming 'i' to 'İ'
|
2011-05-29 15:53:18 +00:00
|
|
|
|
*
|
2014-04-17 13:31:28 +00:00
|
|
|
|
* @param string $string
|
2011-05-29 15:53:18 +00:00
|
|
|
|
*
|
|
|
|
|
|
* @return string
|
2007-12-02 10:48:34 +00:00
|
|
|
|
*/
|
2016-03-26 12:54:48 +00:00
|
|
|
|
public function ucfirst( $string ) {
|
2017-03-22 12:16:19 +00:00
|
|
|
|
if ( substr( $string, 0, 1 ) === 'i' ) {
|
2015-11-10 00:33:07 +00:00
|
|
|
|
$variant = $this->getPreferredVariant();
|
|
|
|
|
|
if ( $variant == 'kk-latn' || $variant == 'kk-tr' ) {
|
|
|
|
|
|
return 'İ' . substr( $string, 1 );
|
|
|
|
|
|
}
|
2007-12-02 10:48:34 +00:00
|
|
|
|
}
|
2015-11-10 00:33:07 +00:00
|
|
|
|
return parent::ucfirst( $string );
|
2007-12-02 10:48:34 +00:00
|
|
|
|
}
|
2006-11-06 17:46:58 +00:00
|
|
|
|
|
2011-05-22 22:05:18 +00:00
|
|
|
|
/**
|
2007-12-17 15:31:32 +00:00
|
|
|
|
* It fixes issue with lcfirst for transforming 'I' to 'ı'
|
2011-05-29 15:53:18 +00:00
|
|
|
|
*
|
2014-04-17 13:31:28 +00:00
|
|
|
|
* @param string $string
|
2011-05-29 15:53:18 +00:00
|
|
|
|
*
|
|
|
|
|
|
* @return string
|
2007-12-02 10:48:34 +00:00
|
|
|
|
*/
|
2019-10-11 18:44:16 +00:00
|
|
|
|
public function lcfirst( $string ) {
|
2017-03-24 14:19:36 +00:00
|
|
|
|
if ( substr( $string, 0, 1 ) === 'I' ) {
|
2015-11-10 00:33:07 +00:00
|
|
|
|
$variant = $this->getPreferredVariant();
|
|
|
|
|
|
if ( $variant == 'kk-latn' || $variant == 'kk-tr' ) {
|
|
|
|
|
|
return 'ı' . substr( $string, 1 );
|
|
|
|
|
|
}
|
2007-12-02 10:48:34 +00:00
|
|
|
|
}
|
2015-11-10 00:33:07 +00:00
|
|
|
|
return parent::lcfirst( $string );
|
2007-12-02 10:48:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2011-05-29 15:53:18 +00:00
|
|
|
|
/**
|
2014-04-17 13:31:28 +00:00
|
|
|
|
* @param string $word
|
|
|
|
|
|
* @param string $case
|
2011-05-29 15:53:18 +00:00
|
|
|
|
* @return string
|
|
|
|
|
|
*/
|
2019-10-11 18:44:16 +00:00
|
|
|
|
public function convertGrammar( $word, $case ) {
|
2021-03-18 10:59:00 +00:00
|
|
|
|
// T277689: If there's no word, then there's nothing to convert.
|
|
|
|
|
|
if ( $word === '' ) {
|
|
|
|
|
|
return '';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2007-12-17 15:31:32 +00:00
|
|
|
|
$variant = $this->getPreferredVariant();
|
|
|
|
|
|
switch ( $variant ) {
|
|
|
|
|
|
case 'kk-arab':
|
|
|
|
|
|
case 'kk-cn':
|
2008-01-14 14:22:32 +00:00
|
|
|
|
$word = parent::convertGrammarKk_arab( $word, $case );
|
2007-12-17 15:31:32 +00:00
|
|
|
|
break;
|
|
|
|
|
|
case 'kk-latn':
|
|
|
|
|
|
case 'kk-tr':
|
2008-01-14 14:22:32 +00:00
|
|
|
|
$word = parent::convertGrammarKk_latn( $word, $case );
|
2007-12-17 15:31:32 +00:00
|
|
|
|
break;
|
|
|
|
|
|
case 'kk-cyrl':
|
|
|
|
|
|
case 'kk-kz':
|
|
|
|
|
|
case 'kk':
|
|
|
|
|
|
default:
|
2008-01-14 14:22:32 +00:00
|
|
|
|
$word = parent::convertGrammarKk_cyrl( $word, $case );
|
2007-12-17 15:31:32 +00:00
|
|
|
|
}
|
2007-06-29 01:19:14 +00:00
|
|
|
|
|
2007-12-17 15:31:32 +00:00
|
|
|
|
return $word;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|