summaryrefslogtreecommitdiff
path: root/languages/classes
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2008-12-15 18:02:47 +0100
committerPierre Schmitz <pierre@archlinux.de>2008-12-15 18:02:47 +0100
commit396b28f3d881f5debd888ba9bb9b47c2d478a76f (patch)
tree10d6e1a721ee4ef69def34a57f02d7eb3fc9e31e /languages/classes
parent0be4d3ccf6c4fe98a72704f9463ecdea2ee5e615 (diff)
update to Mediawiki 1.13.3; some cleanups
Diffstat (limited to 'languages/classes')
-rw-r--r--languages/classes/LanguageBe_x_old.php88
-rw-r--r--languages/classes/LanguageKk_kz.php268
-rw-r--r--languages/classes/LanguageKo.php57
-rw-r--r--languages/classes/LanguageVi.php74
-rw-r--r--languages/classes/LanguageZh_cn.php26
-rw-r--r--languages/classes/LanguageZh_yue.php26
6 files changed, 0 insertions, 539 deletions
diff --git a/languages/classes/LanguageBe_x_old.php b/languages/classes/LanguageBe_x_old.php
deleted file mode 100644
index 66e45599..00000000
--- a/languages/classes/LanguageBe_x_old.php
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-/** Belarusian alternative (Беларуская мова)
- *
- * @addtogroup Language
- *
- * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- * @bug 1638, 2135
- * @link http://be.wikipedia.org/wiki/Talk:LanguageBe.php
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
- * @license http://www.gnu.org/copyleft/fdl.html GNU Free Documentation License
- */
-
-class LanguageBe_x_old extends Language {
- function convertPlural( $count, $wordform1, $wordform2, $wordform3, $w4, $w5) {
- $count = str_replace ('.', '', $count);
- if ($count > 10 && floor(($count % 100) / 10) == 1) {
- return $wordform3;
- } else {
- switch ($count % 10) {
- case 1: return $wordform1;
- case 2:
- case 3:
- case 4: return $wordform2;
- default: return $wordform3;
- }
- }
- }
-
- # Convert from the nominative form of a noun to some other case
- # Invoked with {{GRAMMAR:case|word}}
- /**
- * Cases: родны, вінавальны, месны
- */
- function convertGrammar( $word, $case ) {
- switch ( $case ) {
- case 'родны': # genitive
- if ( $word == 'Вікіпэдыя' ) {
- $word = 'Вікіпэдыі';
- } elseif ( $word == 'ВікіСлоўнік' ) {
- $word = 'ВікіСлоўніка';
- } elseif ( $word == 'ВікіКнігі' ) {
- $word = 'ВікіКніг';
- } elseif ( $word == 'ВікіКрыніца' ) {
- $word = 'ВікіКрыніцы';
- } elseif ( $word == 'ВікіНавіны' ) {
- $word = 'ВікіНавін';
- } elseif ( $word == 'ВікіВіды' ) {
- $word = 'ВікіВідаў';
- }
- break;
- case 'вінавальны': # akusative
- if ( $word == 'Вікіпэдыя' ) {
- $word = 'Вікіпэдыю';
- } elseif ( $word == 'ВікіСлоўнік' ) {
- $word = 'ВікіСлоўнік';
- } elseif ( $word == 'ВікіКнігі' ) {
- $word = 'ВікіКнігі';
- } elseif ( $word == 'ВікіКрыніца' ) {
- $word = 'ВікіКрыніцу';
- } elseif ( $word == 'ВікіНавіны' ) {
- $word = 'ВікіНавіны';
- } elseif ( $word == 'ВікіВіды' ) {
- $word = 'ВікіВіды';
- }
- break;
- case 'месны': # prepositional
- if ( $word == 'Вікіпэдыя' ) {
- $word = 'Вікіпэдыі';
- } elseif ( $word == 'ВікіСлоўнік' ) {
- $word = 'ВікіСлоўніку';
- } elseif ( $word == 'ВікіКнігі' ) {
- $word = 'ВікіКнігах';
- } elseif ( $word == 'ВікіКрыніца' ) {
- $word = 'ВікіКрыніцы';
- } elseif ( $word == 'ВікіНавіны' ) {
- $word = 'ВікіНавінах';
- } elseif ( $word == 'ВікіВіды' ) {
- $word = 'ВікіВідах';
- }
- break;
- }
-
- return $word; # this will return the original value for 'назоўны' (nominative) and all undefined case values
- }
-
-}
-
-?>
diff --git a/languages/classes/LanguageKk_kz.php b/languages/classes/LanguageKk_kz.php
deleted file mode 100644
index 8783ea6f..00000000
--- a/languages/classes/LanguageKk_kz.php
+++ /dev/null
@@ -1,268 +0,0 @@
-<?php
-/** Kazakh (Қазақша)
- *
- *
- * @addtogroup Language
- */
-
-
-class LanguageKk_kz extends Language {
-
- # Convert from the nominative form of a noun to some other case
- # Invoked with {{GRAMMAR:case|word}}
- /**
- * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms
- */
- function convertGrammar( $word, $case ) {
- global $wgGrammarForms;
- if ( isset( $wgGrammarForms['kk'][$case][$word] ) ) {
- return $wgGrammarForms['kk'][$case][$word];
- }
- // Set up some constants...
- // Vowels in last syllable
- $frontVowels = array( "е", "ө", "ү", "і", "ә", "э" );
- $backVowels = array( "а", "о", "ұ", "ы", "я", "ё" );
- $allVowels = array( "е", "ө", "ү", "і", "ә", "э", "а", "о", "ұ", "ы", "я", "ё" );
- // Preceding letters
- $preVowels = $allVowels;
- $preNasals = array( "м", "н", "ң" );
- $preSonants = array( "и", "й", "л", "р", "у", "ю");
- # $preVoiceds = array( "б", "в", "г", "ғ", "д", "ж", "з", "һ" );
- # $preVoicelesses = array( "п", "ф", "к", "қ", "т", "ш", "с", "х", "ц", "ч", "щ" );
- $preConsonants = array( "п", "ф", "к", "қ", "т", "ш", "с", "х", "ц", "ч", "щ", "б", "в", "г", "д" );
- $preEzhZet = array( "ж", "з" );
- $preSonorants = array( "и", "й", "л", "р", "у", "ю", "м", "н", "ң", "ж", "з");
-
- // Possessives
- $firsts = array( "м", "ң" ); // 1st singular, 2nd unformal
- $seconds = array( "з" ); // 1st plural, 2nd formal
- $thirds = array( "ы", "і" ); // 3rd
-
- // Put the word in a form we can play with since we're using UTF-8
- $ar = array();
- $ar = preg_split('//u', $word, -1, PREG_SPLIT_NO_EMPTY);
- $wordEnding = $ar[count( $ar ) - 1]; //Here's the last letter in the word
- $wordReversed = array_reverse( $ar ); //Here's an array with the order of the letters in the word reversed so we can find a match quicker *shrug*
-
- // Find the last vowel in the word
- $wordLastVowel = NULL;
- foreach ( $wordReversed as $xvalue ) {
- foreach ( $allVowels as $yvalue ) {
- if ( strcmp( $xvalue, $yvalue ) == 0 ) {
- $wordLastVowel = $xvalue;
- break;
- } else {
- continue;
- }
- }
- if ( $wordLastVowel !== NULL ) {
- break;
- } else {
- continue;
- }
- }
-
- // Now convert the word
- switch ( $case ) {
- case "dc1":
- case "genitive": #ilik
- if ( in_array( $wordEnding, $preConsonants ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "тің";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "тың";
- }
- } elseif ( in_array( $wordEnding, $preVowels ) || in_array( $wordEnding, $preNasals ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "нің";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "ның";
- }
- } elseif ( in_array( $wordEnding, $preSonants ) || in_array( $wordEnding, $preEzhZet )) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "дің";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "дың";
- }
- }
- break;
- case "dc2":
- case "dative": #barıs
- if ( in_array( $wordEnding, $preConsonants ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "ке";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "қа";
- }
- } elseif ( in_array( $wordEnding, $preVowels ) || in_array( $wordEnding, $preSonorants ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "ге";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "ға";
- }
- }
- break;
- case "dc21":
- case "possessive dative": #täweldık + barıs
- if ( in_array( $wordEnding, $firsts ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "е";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "а";
- }
- } elseif ( in_array( $wordEnding, $seconds ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "ге";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "ға";
- }
- } elseif ( in_array( $wordEnding, $thirds ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "не";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "на";
- }
- }
- break;
- case "dc3":
- case "accusative": #tabıs
- if ( in_array( $wordEnding, $preConsonants ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "ті";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "ты";
- }
- } elseif ( in_array( $wordEnding, $preVowels ) ) {
- if ( in_array($wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "ні";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "ны";
- }
- } elseif ( in_array( $wordEnding, $preSonorants) ) {
- if ( in_array( $wordLastVowel, $frontVowels) ) {
- $word = implode( "", $ar ) . "ді";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "ды";
- }
- }
- break;
- case "dc31":
- case "possessive accusative": #täweldık + tabıs
- if ( in_array( $wordEnding, $firsts ) || in_array( $wordEnding, $seconds ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "ді";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "ды";
- }
- } elseif ( in_array( $wordEnding, $thirds ) ) {
- $word = implode( "", $ar ) . "н";
- }
- break;
- case "dc4":
- case "locative": #jatıs
- if ( in_array( $wordEnding, $preConsonants ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "те";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "та";
- }
- } elseif ( in_array( $wordEnding, $preVowels ) || in_array( $wordEnding, $preSonorants ) ) {
- if ( in_array( $wordLastVowel, $frontVowels) ) {
- $word = implode( "", $ar ) . "де";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "",$ar ) . "да";
- }
- }
- break;
- case "dc41":
- case "possessive locative": #täweldık + jatıs
- if ( in_array( $wordEnding, $firsts ) || in_array( $wordEnding, $seconds ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "де";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "да";
- }
- } elseif ( in_array( $wordEnding, $thirds ) ) {
- if ( in_array( $wordLastVowel, $frontVowels) ) {
- $word = implode( "", $ar ) . "нде";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "",$ar ) . "нда";
- }
- }
- break;
- case "dc5":
- case "ablative": #şığıs
- if ( in_array( $wordEnding, $preConsonants ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "тен";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "тан";
- }
- } elseif ( in_array($wordEnding, $preVowels ) || in_array($wordEnding, $preSonants ) || in_array($wordEnding, $preEzhZet ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "ден";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "дан";
- }
- } elseif ( in_array($wordEnding, $preNasals ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "нен";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "нан";
- }
- }
- break;
- case "dc51":
- case "possessive ablative": #täweldık + şığıs
- if ( in_array( $wordEnding, $firsts ) || in_array( $wordEnding, $thirds ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "нен";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "нан";
- }
- } elseif ( in_array($wordEnding, $seconds ) ) {
- if ( in_array( $wordLastVowel, $frontVowels ) ) {
- $word = implode( "", $ar ) . "ден";
- } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- $word = implode( "", $ar ) . "дан";
- }
- }
- break;
- case "dc6":
- case "comitative": #kömektes
- if ( in_array( $wordEnding, $preConsonants ) ) {
- $word = implode( "", $ar ) . "пен";
- } elseif ( in_array( $wordEnding, $preVowels ) || in_array( $wordEnding, $preNasals ) || in_array( $wordEnding, $preSonants ) ) {
- $word = implode( "", $ar ) . "мен";
- } elseif ( in_array( $wordEnding, $preEzhZet ) ) {
- $word = implode( "", $ar ) . "бен";
- }
- break;
- case "dc61":
- case "possessive comitative": #täweldık + kömektes
- if ( in_array( $wordEnding, $preConsonants ) ) {
- $word = implode( "", $ar ) . "пенен";
- } elseif ( in_array( $wordEnding, $preVowels ) || in_array( $wordEnding, $preNasals ) || in_array( $wordEnding, $preSonants ) ) {
- $word = implode( "", $ar ) . "менен";
- } elseif ( in_array( $wordEnding, $preEzhZet ) ) {
- $word = implode( "", $ar ) . "бенен";
- }
- break;
- default: #dc0 #nominative #ataw
- }
- return $word;
- }
-
- /**
- * Avoid grouping whole numbers between 0 to 9999
- */
- function commafy( $_ ) {
- if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
- return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev($_) ) );
- } else {
- return $_;
- }
- }
-}
-
-
diff --git a/languages/classes/LanguageKo.php b/languages/classes/LanguageKo.php
deleted file mode 100644
index 1ed80dfe..00000000
--- a/languages/classes/LanguageKo.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-/** Korean (한국어)
- *
- * @addtogroup Language
- */
-
-class LanguageKo extends Language {
- function firstChar( $s ) {
- $matches = array();
- preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
- '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})/', $s, $matches);
-
- if ( isset( $matches[1] ) ) {
- if ( strlen( $matches[1] ) != 3 ) {
- return $matches[1];
- }
- $code = (ord($matches[1]{0}) & 0x0f) << 12;
- $code |= (ord($matches[1]{1}) & 0x3f) << 6;
- $code |= (ord($matches[1]{2}) & 0x3f);
- if ( $code < 0xac00 || 0xd7a4 <= $code) {
- return $matches[1];
- } elseif ( $code < 0xb098 ) {
- return "\xe3\x84\xb1";
- } elseif ( $code < 0xb2e4 ) {
- return "\xe3\x84\xb4";
- } elseif ( $code < 0xb77c ) {
- return "\xe3\x84\xb7";
- } elseif ( $code < 0xb9c8 ) {
- return "\xe3\x84\xb9";
- } elseif ( $code < 0xbc14 ) {
- return "\xe3\x85\x81";
- } elseif ( $code < 0xc0ac ) {
- return "\xe3\x85\x82";
- } elseif ( $code < 0xc544 ) {
- return "\xe3\x85\x85";
- } elseif ( $code < 0xc790 ) {
- return "\xe3\x85\x87";
- } elseif ( $code < 0xcc28 ) {
- return "\xe3\x85\x88";
- } elseif ( $code < 0xce74 ) {
- return "\xe3\x85\x8a";
- } elseif ( $code < 0xd0c0 ) {
- return "\xe3\x85\x8b";
- } elseif ( $code < 0xd30c ) {
- return "\xe3\x85\x8c";
- } elseif ( $code < 0xd558 ) {
- return "\xe3\x85\x8d";
- } else {
- return "\xe3\x85\x8e";
- }
- } else {
- return "";
- }
- }
-}
-
-
diff --git a/languages/classes/LanguageVi.php b/languages/classes/LanguageVi.php
deleted file mode 100644
index 4f9c4da3..00000000
--- a/languages/classes/LanguageVi.php
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-/**
- * Based on Language.php 1.645
- * @package MediaWiki
- * @subpackage Language
- * Compatible to MediaWiki 1.5
- * Initial translation by Trần Thế Trung and Nguyễn Thanh Quang
- * Last update 28 August 2005 (UTC)
- */
-
-class LanguageVi extends Language {
- function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
- if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
-
- $datePreference = $this->dateFormat( $format );
-
- $month = $this->formatMonth( substr( $ts, 4, 2 ), $datePreference );
- $day = $this->formatDay( substr( $ts, 6, 2 ), $datePreference );
- $year = $this->formatNum( substr( $ts, 0, 4 ), true );
-
- switch( $datePreference ) {
- case 3:
- case 4: return "$day/$month/$year";
- case MW_DATE_ISO: return substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
- default: return "$day $month năm $year";
- }
- }
-
- function timeSeparator( $format ) {
- $datePreference = $this->dateFormat($format);
- switch ( $datePreference ) {
- case '4': return 'h';
- default: return ':';
- }
- }
-
- function timeDateSeparator( $format ) {
- $datePreference = $this->dateFormat($format);
- switch ( $datePreference ) {
- case '0':
- case '1':
- case '2': return ', ';
- default: return ' ';
- }
- }
-
- function formatMonth( $month, $format ) {
- $datePreference = $this->dateFormat($format);
- switch ( $datePreference ) {
- case '0':
- case '1': return 'tháng ' . ( 0 + $month );
- case '2': return 'tháng ' . $this->getSpecialMonthName( $month );
- default: return 0 + $month;
- }
- }
-
- function formatDay( $day, $format ) {
- $datePreference = $this->dateFormat($format);
- switch ( $datePreference ) {
- case '0':
- case '1':
- case '2': return 'ngày ' . (0 + $day);
- default: return 0 + $day;
- }
- }
-
- function getSpecialMonthName( $key ) {
- $names = 'Một, Hai, Ba, Tư, Năm, Sáu, Bảy, Tám, Chín, Mười, Mười một, Mười hai';
- $names = explode(', ', $names);
- return $names[$key-1];
- }
-}
-
-?>
diff --git a/languages/classes/LanguageZh_cn.php b/languages/classes/LanguageZh_cn.php
deleted file mode 100644
index 8f54648a..00000000
--- a/languages/classes/LanguageZh_cn.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * @addtogroup Language
- */
-class LanguageZh_cn extends Language {
- function stripForSearch( $string ) {
- # MySQL fulltext index doesn't grok utf-8, so we
- # need to fold cases and convert to hex
- # we also separate characters as "words"
- if( function_exists( 'mb_strtolower' ) ) {
- return preg_replace(
- "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
- "' U8' . bin2hex( \"$1\" )",
- mb_strtolower( $string ) );
- } else {
- list( , $wikiLowerChars ) = Language::getCaseMaps();
- return preg_replace(
- "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
- "' U8' . bin2hex( strtr( \"\$1\", \$wikiLowerChars ) )",
- $string );
- }
- }
-}
-
-
-
diff --git a/languages/classes/LanguageZh_yue.php b/languages/classes/LanguageZh_yue.php
deleted file mode 100644
index d300ea1e..00000000
--- a/languages/classes/LanguageZh_yue.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * @addtogroup Language
- */
-class LanguageZh_yue extends Language {
- function stripForSearch( $string ) {
- # MySQL fulltext index doesn't grok utf-8, so we
- # need to fold cases and convert to hex
- # we also separate characters as "words"
- if( function_exists( 'mb_strtolower' ) ) {
- return preg_replace(
- "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
- "' U8' . bin2hex( \"$1\" )",
- mb_strtolower( $string ) );
- } else {
- list( , $wikiLowerChars ) = Language::getCaseMaps();
- return preg_replace(
- "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
- "' U8' . bin2hex( strtr( \"\$1\", \$wikiLowerChars ) )",
- $string );
- }
- }
-}
-
-
-