summaryrefslogtreecommitdiff
path: root/languages/classes
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2007-09-14 13:18:58 +0200
committerPierre Schmitz <pierre@archlinux.de>2007-09-14 13:18:58 +0200
commit8f416baead93a48e5799e44b8bd2e2c4859f4e04 (patch)
treecd47ac55eb80a39e3225e8b4f3161b88ea16c2cf /languages/classes
parentd7d08bd1a17618c7d77a6b9b2989e9f7293d6ed6 (diff)
auf Version 1.11 aktualisiert; Login-Bug behoben
Diffstat (limited to 'languages/classes')
-rw-r--r--languages/classes/LanguageAr.php1
-rw-r--r--languages/classes/LanguageAz.php2
-rw-r--r--languages/classes/LanguageBe.php2
-rw-r--r--languages/classes/LanguageBe_tarask.php88
-rw-r--r--languages/classes/LanguageBg.php2
-rw-r--r--languages/classes/LanguageBs.php2
-rw-r--r--languages/classes/LanguageCs.php2
-rw-r--r--languages/classes/LanguageCu.php2
-rw-r--r--languages/classes/LanguageEo.php2
-rw-r--r--languages/classes/LanguageEt.php2
-rw-r--r--languages/classes/LanguageFi.php13
-rw-r--r--languages/classes/LanguageFr.php2
-rw-r--r--languages/classes/LanguageGa.php2
-rw-r--r--languages/classes/LanguageGsw.php2
-rw-r--r--languages/classes/LanguageHe.php2
-rw-r--r--languages/classes/LanguageHr.php2
-rw-r--r--languages/classes/LanguageHu.php2
-rw-r--r--languages/classes/LanguageHy.php2
-rw-r--r--languages/classes/LanguageJa.php2
-rw-r--r--languages/classes/LanguageKk.deps.php2
-rw-r--r--languages/classes/LanguageKk.php25
-rw-r--r--languages/classes/LanguageKk_kz.php2
-rw-r--r--languages/classes/LanguageKo.php2
-rw-r--r--languages/classes/LanguageKsh.php2
-rw-r--r--languages/classes/LanguageKu.deps.php12
-rw-r--r--languages/classes/LanguageKu.php240
-rw-r--r--languages/classes/LanguageKu_ku.php35
-rw-r--r--languages/classes/LanguageLa.php2
-rw-r--r--languages/classes/LanguageLt.php2
-rw-r--r--languages/classes/LanguageLv.php2
-rw-r--r--languages/classes/LanguagePt_br.php2
-rw-r--r--languages/classes/LanguageRmy.php2
-rw-r--r--languages/classes/LanguageRu.php2
-rw-r--r--languages/classes/LanguageSk.php2
-rw-r--r--languages/classes/LanguageSl.php2
-rw-r--r--languages/classes/LanguageSr.deps.php2
-rw-r--r--languages/classes/LanguageSr.php2
-rw-r--r--languages/classes/LanguageSr_ec.php2
-rw-r--r--languages/classes/LanguageSr_el.deps.php2
-rw-r--r--languages/classes/LanguageSr_el.php2
-rw-r--r--languages/classes/LanguageTr.php2
-rw-r--r--languages/classes/LanguageTyv.php2
-rw-r--r--languages/classes/LanguageUk.php2
-rw-r--r--languages/classes/LanguageWa.php2
-rw-r--r--languages/classes/LanguageZh.deps.php2
-rw-r--r--languages/classes/LanguageZh.php4
-rw-r--r--languages/classes/LanguageZh_cn.php2
-rw-r--r--languages/classes/LanguageZh_yue.php2
48 files changed, 447 insertions, 51 deletions
diff --git a/languages/classes/LanguageAr.php b/languages/classes/LanguageAr.php
index c8824814..514ff028 100644
--- a/languages/classes/LanguageAr.php
+++ b/languages/classes/LanguageAr.php
@@ -25,4 +25,3 @@ class LanguageAr extends Language {
}
-?> \ No newline at end of file
diff --git a/languages/classes/LanguageAz.php b/languages/classes/LanguageAz.php
index 399014c8..84f0c7dd 100644
--- a/languages/classes/LanguageAz.php
+++ b/languages/classes/LanguageAz.php
@@ -13,4 +13,4 @@ class LanguageAz extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageBe.php b/languages/classes/LanguageBe.php
index d27e2835..e0665e68 100644
--- a/languages/classes/LanguageBe.php
+++ b/languages/classes/LanguageBe.php
@@ -88,4 +88,4 @@ class LanguageBe extends Language {
}
-?>
+
diff --git a/languages/classes/LanguageBe_tarask.php b/languages/classes/LanguageBe_tarask.php
new file mode 100644
index 00000000..5e168b7e
--- /dev/null
+++ b/languages/classes/LanguageBe_tarask.php
@@ -0,0 +1,88 @@
+<?php
+/** Belarusian in Taraskievica orthography (Беларуская тарашкевіца)
+ *
+ * @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_tarask 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/LanguageBg.php b/languages/classes/LanguageBg.php
index 576c9385..bf3ad5c8 100644
--- a/languages/classes/LanguageBg.php
+++ b/languages/classes/LanguageBg.php
@@ -20,4 +20,4 @@ class LanguageBg extends Language {
}
}
}
-?>
+
diff --git a/languages/classes/LanguageBs.php b/languages/classes/LanguageBs.php
index 6dbcbfa1..119280e6 100644
--- a/languages/classes/LanguageBs.php
+++ b/languages/classes/LanguageBs.php
@@ -133,4 +133,4 @@ class LanguageBs extends Language {
}
-?>
+
diff --git a/languages/classes/LanguageCs.php b/languages/classes/LanguageCs.php
index eff04a00..ac80f296 100644
--- a/languages/classes/LanguageCs.php
+++ b/languages/classes/LanguageCs.php
@@ -83,4 +83,4 @@ class LanguageCs extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageCu.php b/languages/classes/LanguageCu.php
index 1da7c699..61128f24 100644
--- a/languages/classes/LanguageCu.php
+++ b/languages/classes/LanguageCu.php
@@ -46,4 +46,4 @@ class LanguageCu extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageEo.php b/languages/classes/LanguageEo.php
index 11b0e987..f5a09897 100644
--- a/languages/classes/LanguageEo.php
+++ b/languages/classes/LanguageEo.php
@@ -70,4 +70,4 @@ class LanguageEo extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageEt.php b/languages/classes/LanguageEt.php
index 1fc44fc0..8ed494f8 100644
--- a/languages/classes/LanguageEt.php
+++ b/languages/classes/LanguageEt.php
@@ -17,4 +17,4 @@ class LanguageEt extends Language {
}
}
}
-?>
+
diff --git a/languages/classes/LanguageFi.php b/languages/classes/LanguageFi.php
index d7363969..0d02dfe7 100644
--- a/languages/classes/LanguageFi.php
+++ b/languages/classes/LanguageFi.php
@@ -10,7 +10,7 @@ class LanguageFi extends Language {
* Avoid grouping whole numbers between 0 to 9999
*/
function commafy($_) {
- if (!preg_match('/^\d{1,4}$/',$_)) {
+ if (!preg_match('/^-?\d{1,4}$/',$_)) {
return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
} else {
return $_;
@@ -64,7 +64,7 @@ class LanguageFi extends Language {
return $word;
}
- function translateBlockExpiry( $str ) {
+ function translateBlockExpiry( $str, $forContent = false ) {
/*
'ago', 'now', 'today', 'this', 'next',
'first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelfth',
@@ -138,9 +138,14 @@ class LanguageFi extends Language {
$final .= ' ' . $item;
}
- return '<span class="blockexpiry" title="' . htmlspecialchars($str). '">”' . trim( $final ) . '”</span>';
+
+ if ( $forContent ) {
+ return htmlspecialchars( trim( $final ) );
+ } else {
+ return '<span class="blockexpiry" title="' . htmlspecialchars($str). '">”' . trim( $final ) . '”</span>';
+ }
}
}
-?>
+
diff --git a/languages/classes/LanguageFr.php b/languages/classes/LanguageFr.php
index ecc15317..87d28b22 100644
--- a/languages/classes/LanguageFr.php
+++ b/languages/classes/LanguageFr.php
@@ -13,4 +13,4 @@ class LanguageFr extends Language {
return $count <= '1' ? $w1 : $w2;
}
}
-?>
+
diff --git a/languages/classes/LanguageGa.php b/languages/classes/LanguageGa.php
index b0a5978e..71b56e72 100644
--- a/languages/classes/LanguageGa.php
+++ b/languages/classes/LanguageGa.php
@@ -48,4 +48,4 @@ class LanguageGa extends Language {
}
-?>
+
diff --git a/languages/classes/LanguageGsw.php b/languages/classes/LanguageGsw.php
index f8ec0c80..0ee043dc 100644
--- a/languages/classes/LanguageGsw.php
+++ b/languages/classes/LanguageGsw.php
@@ -65,4 +65,4 @@ class LanguageGsw extends Language {
}
-?>
+
diff --git a/languages/classes/LanguageHe.php b/languages/classes/LanguageHe.php
index 8e503fa6..ca760c1a 100644
--- a/languages/classes/LanguageHe.php
+++ b/languages/classes/LanguageHe.php
@@ -68,4 +68,4 @@ class LanguageHe extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageHr.php b/languages/classes/LanguageHr.php
index 48908735..5a875a71 100644
--- a/languages/classes/LanguageHr.php
+++ b/languages/classes/LanguageHr.php
@@ -22,4 +22,4 @@ class LanguageHr extends Language {
}
-?>
+
diff --git a/languages/classes/LanguageHu.php b/languages/classes/LanguageHu.php
index 0dc4ac4c..e4407f5b 100644
--- a/languages/classes/LanguageHu.php
+++ b/languages/classes/LanguageHu.php
@@ -49,4 +49,4 @@ class LanguageHu extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageHy.php b/languages/classes/LanguageHy.php
index b3a46b0f..34fb6c74 100644
--- a/languages/classes/LanguageHy.php
+++ b/languages/classes/LanguageHy.php
@@ -70,4 +70,4 @@ class LanguageHy extends Language {
}
}
}
-?>
+
diff --git a/languages/classes/LanguageJa.php b/languages/classes/LanguageJa.php
index 7f681639..c56e6a9e 100644
--- a/languages/classes/LanguageJa.php
+++ b/languages/classes/LanguageJa.php
@@ -38,4 +38,4 @@ class LanguageJa extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageKk.deps.php b/languages/classes/LanguageKk.deps.php
index 22ad7ad5..336692a2 100644
--- a/languages/classes/LanguageKk.deps.php
+++ b/languages/classes/LanguageKk.deps.php
@@ -9,4 +9,4 @@
require_once( dirname(__FILE__).'/../LanguageConverter.php' );
require_once( dirname(__FILE__).'/LanguageKk_kz.php' );
-?>
+
diff --git a/languages/classes/LanguageKk.php b/languages/classes/LanguageKk.php
index 3591d11a..68775b3a 100644
--- a/languages/classes/LanguageKk.php
+++ b/languages/classes/LanguageKk.php
@@ -101,6 +101,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
+ */
+ function parseManualRule($rule, $flags=array()) {
+ if(in_array('T',$flags)){
+ return parent::parseManualRule($rule, $flags);
+ }
+
+ // otherwise ignore all formatting
+ foreach($this->mVariants as $v) {
+ $carray[$v] = $rule;
+ }
+
+ return $carray;
+ }
// Do not convert content on talk pages
function parserConvert( $text, &$parser ){
@@ -195,9 +212,9 @@ class LanguageKk extends LanguageKk_kz {
$variants = array( 'kk', 'kk-kz', 'kk-tr', 'kk-cn' );
$variantfallbacks = array(
'kk' => 'kk-kz',
- 'kk-kz' => 'kk-kz',
- 'kk-tr' => 'kk-tr',
- 'kk-cn' => 'kk-cn'
+ 'kk-kz' => 'kk',
+ 'kk-tr' => 'kk',
+ 'kk-cn' => 'kk'
);
$this->mConverter = new KkConverter( $this, 'kk', $variants, $variantfallbacks );
@@ -223,4 +240,4 @@ class LanguageKk extends LanguageKk_kz {
}
-?>
+
diff --git a/languages/classes/LanguageKk_kz.php b/languages/classes/LanguageKk_kz.php
index d1f4bfd2..8783ea6f 100644
--- a/languages/classes/LanguageKk_kz.php
+++ b/languages/classes/LanguageKk_kz.php
@@ -265,4 +265,4 @@ class LanguageKk_kz extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageKo.php b/languages/classes/LanguageKo.php
index ae09d111..1ed80dfe 100644
--- a/languages/classes/LanguageKo.php
+++ b/languages/classes/LanguageKo.php
@@ -54,4 +54,4 @@ class LanguageKo extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageKsh.php b/languages/classes/LanguageKsh.php
index b15f97e3..c53667cf 100644
--- a/languages/classes/LanguageKsh.php
+++ b/languages/classes/LanguageKsh.php
@@ -32,4 +32,4 @@ class LanguageKsh extends Language {
}
}
}
-?>
+
diff --git a/languages/classes/LanguageKu.deps.php b/languages/classes/LanguageKu.deps.php
new file mode 100644
index 00000000..7aeba604
--- /dev/null
+++ b/languages/classes/LanguageKu.deps.php
@@ -0,0 +1,12 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageKu.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+// see http://mail.wikipedia.org/pipermail/wikitech-l/2006-January/033660.html
+
+
+require_once( dirname(__FILE__).'/../LanguageConverter.php' );
+require_once( dirname(__FILE__).'/LanguageKu_ku.php' );
+
+
diff --git a/languages/classes/LanguageKu.php b/languages/classes/LanguageKu.php
new file mode 100644
index 00000000..a08d3d73
--- /dev/null
+++ b/languages/classes/LanguageKu.php
@@ -0,0 +1,240 @@
+<?php
+/** Kurdish
+ * converter routines
+ *
+ * @addtogroup Language
+ */
+
+require_once( dirname(__FILE__).'/../LanguageConverter.php' );
+require_once( dirname(__FILE__).'/LanguageKu_ku.php' );
+
+class KuConverter extends LanguageConverter {
+ var $mArabicToLatin = array(
+ 'ب' => 'b', 'ج' => 'c', 'چ' => 'ç', 'د' => 'd', 'ف' => 'f', 'گ' => 'g', 'ھ' => 'h',
+ 'ہ' => 'h', 'ه' => 'h', 'ح' => 'h', 'ژ' => 'j', 'ك' => 'k', 'ک' => 'k', 'ل' => 'l',
+ 'م' => 'm', 'ن' => 'n', 'پ' => 'p', 'ق' => 'q', 'ر' => 'r', 'س' => 's', 'ش' => 'ş',
+ 'ت' => 't', 'ڤ' => 'v', 'خ' => 'x', 'غ' => 'x', 'ز' => 'z',
+
+ /* Doppel- und Halbvokale */
+ 'ڵ' => 'll', #ll
+ 'ڕ' => 'rr', #rr
+ 'ا' => 'a',
+ # 'ئێ' => 'ê', # initial e
+ 'ە' => 'e',
+ 'ه‌' => 'e', # with one non-joiner
+ 'ه‌‌' => 'e', # with two non-joiner
+ 'ة' => 'e',
+ 'ێ' => 'ê',
+ 'ي' => 'î',
+ 'ی' => 'î', # U+06CC db 8c ARABIC LETTER FARSI YEH
+ 'ى' => 'î', # U+0649 d9 89 ARABIC LETTER ALEF MAKSURA
+ 'ۆ' => 'o',
+ 'و' => 'w',
+ 'ئ' => '', # initial hemze should not be shown
+ '،' => ',',
+ 'ع' => '\'', # ayn
+ '؟' => '?',
+ );
+
+ var $mLatinToArabic = array(
+ 'b' => 'ب', 'c' => 'ج', 'ç' => 'چ', 'd' => 'د', 'f' => 'ف', 'g' => 'گ',
+ 'h' => 'ه', 'j' => 'ژ', 'k' => 'ک', 'l' => 'ل',
+ 'm' => 'م', 'n' => 'ن', 'p' => 'پ', 'q' => 'ق', 'r' => 'ر', 's' => 'س', 'ş' => 'ش',
+ 't' => 'ت', 'v' => 'ڤ',
+ 'x' => 'خ', 'y' => 'ی', 'z' => 'ز',
+
+
+ 'B' => 'ب', 'C' => 'ج', 'Ç' => 'چ', 'D' => 'د', 'F' => 'ف', 'G' => 'گ', 'H' => 'ھ',
+ 'H' => 'ہ', 'H' => 'ه', 'H' => 'ح', 'J' => 'ژ', 'K' => 'ك', 'K' => 'ک', 'L' => 'ل',
+ 'M' => 'م', 'N' => 'ن', 'P' => 'پ', 'Q' => 'ق', 'R' => 'ر', 'S' => 'س', 'Ş' => 'ش',
+ 'T' => 'ت', 'V' => 'ڤ', 'W' => 'و', 'X' => 'خ',
+ 'Y' => 'ی', 'Z' => 'ز',
+
+ /* Doppelkonsonanten */
+ # 'll' => 'ڵ', # wenn es geht, doppel-l und l getrennt zu behandeln
+ # 'rr' => 'ڕ', # selbiges für doppel-r
+
+ /* Einzelne Großbuchstaben */
+ //' C' => 'ج',
+
+ /* Vowels */
+ 'a' => 'ا',
+ 'e' => 'ە',
+ 'ê' => 'ێ',
+ 'i' => '',
+ 'î' => 'ی',
+ 'o' => 'ۆ',
+ 'u' => 'و',
+ 'û' => 'وو',
+ 'w' => 'و',
+ ',' => '،',
+ '?' => '؟',
+
+ # Try to replace the leading vowel
+ ' a' => 'ئا ',
+ ' e' => 'ئە ',
+ ' ê' => 'ئێ ',
+ ' î' => 'ئی ',
+ ' o' => 'ئۆ ',
+ ' u' => 'ئو ',
+ ' û' => 'ئوو ',
+ 'A' => 'ئا',
+ 'E' => 'ئە',
+ 'Ê' => 'ئێ',
+ 'Î' => 'ئی',
+ 'O' => 'ئۆ',
+ 'U' => 'ئو',
+ 'Û' => 'ئوو',
+ ' A' => 'ئا ',
+ ' E' => 'ئە ',
+ ' Ê' => 'ئێ ',
+ ' Î' => 'ئی ',
+ ' O' => 'ئۆ ',
+ ' U' => 'ئو ',
+ ' Û' => 'ئوو ',
+ # eyn erstmal deaktivieren, einfache Anführungsstriche sind einfach zu häufig, um sie als eyn zu interpretieren
+ # '\'' => 'ع',
+
+ );
+
+ function loadDefaultTables() {
+ $this->mTables = array(
+ 'ku-latn' => new ReplacementArray( $this->mArabicToLatin ),
+ 'ku-arab' => new ReplacementArray( $this->mLatinToArabic ),
+ 'ku' => new ReplacementArray()
+ );
+ }
+
+
+ // Do not convert content on talk pages
+ function parserConvert( $text, &$parser ){
+ if(is_object($parser->getTitle() ) && $parser->getTitle()->isTalkPage())
+ $this->mDoContentConvert=false;
+ else
+ $this->mDoContentConvert=true;
+
+ return parent::parserConvert($text, $parser );
+ }
+
+ /*
+ * A function wrapper:
+ * - if there is no selected variant, leave the link
+ * names as they were
+ * - do not try to find variants for usernames
+ */
+ function findVariantLink( &$link, &$nt ) {
+ // check for user namespace
+ if(is_object($nt)){
+ $ns = $nt->getNamespace();
+ if($ns==NS_USER || $ns==NS_USER_TALK)
+ return;
+ }
+
+ $oldlink=$link;
+ parent::findVariantLink($link,$nt);
+ if($this->getPreferredVariant()==$this->mMainLanguageCode)
+ $link=$oldlink;
+ }
+
+ /*
+ * We want our external link captions to be converted in variants,
+ * so we return the original text instead -{$text}-, except for URLs
+ */
+ function markNoConversion($text, $noParse=false) {
+ if($noParse || preg_match("/^https?:\/\/|ftp:\/\/|irc:\/\//",$text))
+ return parent::markNoConversion($text);
+ return $text;
+ }
+
+ /*
+ * An ugly function wrapper for parsing Image titles
+ * (to prevent image name conversion)
+ */
+ function autoConvert($text, $toVariant=false) {
+ global $wgTitle;
+ if(is_object($wgTitle) && $wgTitle->getNameSpace()==NS_IMAGE){
+ $imagename = $wgTitle->getNsText();
+ if(preg_match("/^$imagename:/",$text)) return $text;
+ }
+ return parent::autoConvert($text,$toVariant);
+ }
+
+ /**
+ * It translates text into variant, specials:
+ * - ommiting roman numbers
+ */
+ function translate($text, $toVariant){
+ $breaks = '[^\w\x80-\xff]';
+
+ /* From Kazakh interface, maybe we need it later
+ *
+ // regexp for roman numbers
+ $roman = 'M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})';
+ $roman = '';
+
+ $reg = '/^'.$roman.'$|^'.$roman.$breaks.'|'.$breaks.$roman.'$|'.$breaks.$roman.$breaks.'/';
+
+ $matches = preg_split($reg, $text, -1, PREG_SPLIT_OFFSET_CAPTURE);
+
+ $m = array_shift($matches);
+ if( !isset( $this->mTables[$toVariant] ) ) {
+ throw new MWException( "Broken variant table: " . implode( ',', array_keys( $this->mTables ) ) );
+ }
+ $ret = $this->mTables[$toVariant]->replace( $m[0] );
+ $mstart = $m[1]+strlen($m[0]);
+ foreach($matches as $m) {
+ $ret .= substr($text, $mstart, $m[1]-$mstart);
+ $ret .= parent::translate($m[0], $toVariant);
+ $mstart = $m[1] + strlen($m[0]);
+ }
+
+ return $ret;
+ */
+
+ if( !isset( $this->mTables[$toVariant] ) ) {
+ throw new MWException( "Broken variant table: " . implode( ',', array_keys( $this->mTables ) ) );
+ }
+
+ return parent::translate( $text, $toVariant );
+ }
+}
+
+class LanguageKu extends LanguageKu_ku {
+
+ function __construct() {
+ global $wgHooks;
+ parent::__construct();
+
+ $variants = array( 'ku', 'ku-arab', 'ku-latn' );
+ $variantfallbacks = array(
+ 'ku' => 'ku-latn',
+ 'ku-arab' => 'ku-latn',
+ 'ku-latn' => 'ku-arab',
+ );
+
+ $this->mConverter = new KuConverter( $this, 'ku', $variants, $variantfallbacks );
+ $wgHooks['ArticleSaveComplete'][] = $this->mConverter;
+ }
+
+/* From Kazakh interface, not needed for the moment
+
+ function convertGrammar( $word, $case ) {
+ $fname="LanguageKu::convertGrammar";
+ wfProfileIn( $fname );
+
+ //always convert to ku-latn before convertGrammar
+ $w1 = $word;
+ $word = $this->mConverter->autoConvert( $word, 'ku-latn' );
+ $w2 = $word;
+ $word = parent::convertGrammar( $word, $case );
+ //restore encoding
+ if( $w1 != $w2 ) {
+ $word = $this->mConverter->translate( $word, 'ku-latn' );
+ }
+ wfProfileOut( $fname );
+ return $word;
+ }
+*/
+}
+
+
diff --git a/languages/classes/LanguageKu_ku.php b/languages/classes/LanguageKu_ku.php
new file mode 100644
index 00000000..d8be6d9b
--- /dev/null
+++ b/languages/classes/LanguageKu_ku.php
@@ -0,0 +1,35 @@
+<?php
+/** Kurdish
+ *
+ *
+ * @addtogroup Language
+ */
+
+
+class LanguageKu_ku extends Language {
+
+/** # Convert from the nominative form of a noun to some other case
+ # Invoked with {{GRAMMAR:case|word}}
+ /**
+ * Cases:
+ *
+ * From Kazakh interface, not needed at the moment, maybe later
+ */
+ function convertGrammar( $word, $case ) {
+ 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/LanguageLa.php b/languages/classes/LanguageLa.php
index 0e34b5c5..339eae15 100644
--- a/languages/classes/LanguageLa.php
+++ b/languages/classes/LanguageLa.php
@@ -79,4 +79,4 @@ class LanguageLa extends Language {
}
-?>
+
diff --git a/languages/classes/LanguageLt.php b/languages/classes/LanguageLt.php
index b09520c5..f2b29cad 100644
--- a/languages/classes/LanguageLt.php
+++ b/languages/classes/LanguageLt.php
@@ -18,4 +18,4 @@ class LanguageLt extends Language {
return empty($wordform3)?$wordform2:$wordform3;
}
}
-?>
+
diff --git a/languages/classes/LanguageLv.php b/languages/classes/LanguageLv.php
index ef1f6237..8a46bb9d 100644
--- a/languages/classes/LanguageLv.php
+++ b/languages/classes/LanguageLv.php
@@ -53,4 +53,4 @@ class LanguageLv extends Language {
}
-?>
+
diff --git a/languages/classes/LanguagePt_br.php b/languages/classes/LanguagePt_br.php
index 813c9ad6..31574ed8 100644
--- a/languages/classes/LanguagePt_br.php
+++ b/languages/classes/LanguagePt_br.php
@@ -13,4 +13,4 @@ class LanguagePt_br extends Language {
return $count <= '1' ? $w1 : $w2;
}
}
-?>
+
diff --git a/languages/classes/LanguageRmy.php b/languages/classes/LanguageRmy.php
index bbf22d52..e6096348 100644
--- a/languages/classes/LanguageRmy.php
+++ b/languages/classes/LanguageRmy.php
@@ -69,4 +69,4 @@ class LanguageRmy extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageRu.php b/languages/classes/LanguageRu.php
index 3ca5fd65..7d088053 100644
--- a/languages/classes/LanguageRu.php
+++ b/languages/classes/LanguageRu.php
@@ -83,4 +83,4 @@ class LanguageRu extends Language {
}
}
}
-?>
+
diff --git a/languages/classes/LanguageSk.php b/languages/classes/LanguageSk.php
index 06f44a33..1b9832cc 100644
--- a/languages/classes/LanguageSk.php
+++ b/languages/classes/LanguageSk.php
@@ -90,4 +90,4 @@ class LanguageSk extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageSl.php b/languages/classes/LanguageSl.php
index e8f94567..2513d6bd 100644
--- a/languages/classes/LanguageSl.php
+++ b/languages/classes/LanguageSl.php
@@ -90,4 +90,4 @@ class LanguageSl extends Language {
}
-?>
+
diff --git a/languages/classes/LanguageSr.deps.php b/languages/classes/LanguageSr.deps.php
index 8fe354e0..018a83c2 100644
--- a/languages/classes/LanguageSr.deps.php
+++ b/languages/classes/LanguageSr.deps.php
@@ -7,4 +7,4 @@
require_once( dirname(__FILE__).'/LanguageSr_ec.php' );
require_once( dirname(__FILE__).'/../LanguageConverter.php' );
-?>
+
diff --git a/languages/classes/LanguageSr.php b/languages/classes/LanguageSr.php
index 07982658..7fe67941 100644
--- a/languages/classes/LanguageSr.php
+++ b/languages/classes/LanguageSr.php
@@ -188,4 +188,4 @@ class LanguageSr extends LanguageSr_ec {
$wgHooks['ArticleSaveComplete'][] = $this->mConverter;
}
}
-?>
+
diff --git a/languages/classes/LanguageSr_ec.php b/languages/classes/LanguageSr_ec.php
index 914080da..42647ae6 100644
--- a/languages/classes/LanguageSr_ec.php
+++ b/languages/classes/LanguageSr_ec.php
@@ -24,4 +24,4 @@ class LanguageSr_ec extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageSr_el.deps.php b/languages/classes/LanguageSr_el.deps.php
index f39da2f2..d73638f4 100644
--- a/languages/classes/LanguageSr_el.deps.php
+++ b/languages/classes/LanguageSr_el.deps.php
@@ -6,4 +6,4 @@
// see http://mail.wikipedia.org/pipermail/wikitech-l/2006-January/033660.html
require_once( dirname(__FILE__).'/LanguageSr_ec.php' );
-?>
+
diff --git a/languages/classes/LanguageSr_el.php b/languages/classes/LanguageSr_el.php
index 57c78b84..66118cc9 100644
--- a/languages/classes/LanguageSr_el.php
+++ b/languages/classes/LanguageSr_el.php
@@ -24,4 +24,4 @@ class LanguageSr_el extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageTr.php b/languages/classes/LanguageTr.php
index 45c7f022..9a051a5c 100644
--- a/languages/classes/LanguageTr.php
+++ b/languages/classes/LanguageTr.php
@@ -14,4 +14,4 @@ class LanguageTr extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageTyv.php b/languages/classes/LanguageTyv.php
index e912fe80..fd0a18c6 100644
--- a/languages/classes/LanguageTyv.php
+++ b/languages/classes/LanguageTyv.php
@@ -229,4 +229,4 @@ class LanguageTyv extends Language {
return $word;
}
}
-?>
+
diff --git a/languages/classes/LanguageUk.php b/languages/classes/LanguageUk.php
index a16576ec..d87b7f58 100644
--- a/languages/classes/LanguageUk.php
+++ b/languages/classes/LanguageUk.php
@@ -85,4 +85,4 @@ class LanguageUk extends Language {
}
}
}
-?>
+
diff --git a/languages/classes/LanguageWa.php b/languages/classes/LanguageWa.php
index aef063db..194c7720 100644
--- a/languages/classes/LanguageWa.php
+++ b/languages/classes/LanguageWa.php
@@ -67,4 +67,4 @@ class LanguageWa extends Language {
}
}
-?>
+
diff --git a/languages/classes/LanguageZh.deps.php b/languages/classes/LanguageZh.deps.php
index 1d736340..9a9dacb1 100644
--- a/languages/classes/LanguageZh.deps.php
+++ b/languages/classes/LanguageZh.deps.php
@@ -7,4 +7,4 @@
require_once( dirname(__FILE__).'/LanguageZh_cn.php' );
require_once( dirname(__FILE__).'/../LanguageConverter.php' );
-?>
+
diff --git a/languages/classes/LanguageZh.php b/languages/classes/LanguageZh.php
index 9fa04985..bcdf7dd8 100644
--- a/languages/classes/LanguageZh.php
+++ b/languages/classes/LanguageZh.php
@@ -7,7 +7,7 @@ require_once( dirname(__FILE__).'/LanguageZh_cn.php' );
class ZhConverter extends LanguageConverter {
function loadDefaultTables() {
- require( "includes/ZhConversion.php" );
+ require( dirname(__FILE__)."/../../includes/ZhConversion.php" );
$this->mTables = array(
'zh-cn' => new ReplacementArray( $zh2CN ),
'zh-tw' => new ReplacementArray( $zh2TW ),
@@ -99,4 +99,4 @@ class LanguageZh extends LanguageZh_cn {
}
}
-?>
+
diff --git a/languages/classes/LanguageZh_cn.php b/languages/classes/LanguageZh_cn.php
index 1f40388c..8f54648a 100644
--- a/languages/classes/LanguageZh_cn.php
+++ b/languages/classes/LanguageZh_cn.php
@@ -23,4 +23,4 @@ class LanguageZh_cn extends Language {
}
-?>
+
diff --git a/languages/classes/LanguageZh_yue.php b/languages/classes/LanguageZh_yue.php
index dd2d30a5..d300ea1e 100644
--- a/languages/classes/LanguageZh_yue.php
+++ b/languages/classes/LanguageZh_yue.php
@@ -23,4 +23,4 @@ class LanguageZh_yue extends Language {
}
-?>
+