2005-06-20 20:41:05 +00:00
|
|
|
|
<?php
|
2012-06-10 17:40:03 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* Turkish (Türkçe) 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-06-28 19:52:31 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* Turkish (Türkçe)
|
|
|
|
|
|
*
|
2019-07-23 06:50:52 +00:00
|
|
|
|
* The Turkish language, like other Turkic languages, distinguishes
|
|
|
|
|
|
* a dotted letter 'i' from a dotless letter 'ı' (U+0131 LATIN SMALL LETTER DOTLESS I).
|
|
|
|
|
|
* In these languages, each has an equivalent uppercase mapping:
|
|
|
|
|
|
* ı (U+0131 LATIN SMALL LETTER DOTLESS I) -> I (U+0049 LATIN CAPITAL LETTER I),
|
|
|
|
|
|
* i (U+0069 LATIN SMALL LETTER I) -> İ (U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE).
|
|
|
|
|
|
*
|
|
|
|
|
|
* Unicode CaseFolding.txt defines this case as type 'T', a special case for Turkic languages:
|
|
|
|
|
|
* tr and az. PHP 7.3 parser ignores this special cases. so we have to override the
|
2011-03-14 22:14:39 +00:00
|
|
|
|
* ucfirst and lcfirst methods.
|
2019-07-23 06:50:52 +00:00
|
|
|
|
*
|
2017-02-20 22:46:45 +00:00
|
|
|
|
* See https://en.wikipedia.org/wiki/Dotted_and_dotless_I and T30040
|
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
|
|
|
|
* @ingroup Language
|
2006-06-28 19:52:31 +00:00
|
|
|
|
*/
|
2006-07-26 07:15:39 +00:00
|
|
|
|
class LanguageTr extends Language {
|
2011-03-14 22:14:39 +00:00
|
|
|
|
|
2019-07-23 06:50:52 +00:00
|
|
|
|
private $uc = [ 'I', 'İ' ];
|
|
|
|
|
|
private $lc = [ 'ı', 'i' ];
|
|
|
|
|
|
|
2011-05-29 15:59:47 +00:00
|
|
|
|
/**
|
2014-04-17 13:31:28 +00:00
|
|
|
|
* @param string $string
|
2011-05-29 15:59:47 +00:00
|
|
|
|
* @return string
|
|
|
|
|
|
*/
|
2016-03-26 12:54:48 +00:00
|
|
|
|
public function ucfirst( $string ) {
|
2019-07-23 06:50:52 +00:00
|
|
|
|
$first = mb_substr( $string, 0, 1 );
|
|
|
|
|
|
if ( in_array( $first, $this->lc ) ) {
|
|
|
|
|
|
$first = str_replace( $this->lc, $this->uc, $first );
|
|
|
|
|
|
return $first . mb_substr( $string, 1 );
|
2006-06-28 19:52:31 +00:00
|
|
|
|
}
|
2015-11-10 00:33:07 +00:00
|
|
|
|
return parent::ucfirst( $string );
|
2006-06-28 19:52:31 +00:00
|
|
|
|
}
|
2011-03-14 22:14:39 +00:00
|
|
|
|
|
2011-05-29 15:59:47 +00:00
|
|
|
|
/**
|
2014-04-17 13:31:28 +00:00
|
|
|
|
* @param string $string
|
2011-05-29 15:59:47 +00:00
|
|
|
|
* @return mixed|string
|
|
|
|
|
|
*/
|
2019-10-11 18:44:16 +00:00
|
|
|
|
public function lcfirst( $string ) {
|
2019-07-23 06:50:52 +00:00
|
|
|
|
$first = mb_substr( $string, 0, 1 );
|
|
|
|
|
|
if ( in_array( $first, $this->uc ) ) {
|
|
|
|
|
|
$first = str_replace( $this->uc, $this->lc, $first );
|
|
|
|
|
|
return $first . mb_substr( $string, 1 );
|
2011-03-14 22:14:39 +00:00
|
|
|
|
}
|
2015-11-10 00:33:07 +00:00
|
|
|
|
return parent::lcfirst( $string );
|
2011-03-14 22:14:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2006-04-29 20:07:14 +00:00
|
|
|
|
}
|