diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2008-08-15 01:29:47 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2008-08-15 01:29:47 +0200 |
commit | 370e83bb0dfd0c70de268c93bf07ad5ee0897192 (patch) | |
tree | 491674f4c242e4d6ba0d04eafa305174c35a3391 /languages/classes | |
parent | f4debf0f12d0524d2b2427c55ea3f16b680fad97 (diff) |
Update auf 1.13.0
Diffstat (limited to 'languages/classes')
56 files changed, 486 insertions, 349 deletions
diff --git a/languages/classes/LanguageAr.php b/languages/classes/LanguageAr.php index 1b9ae7bf..01c921a0 100644 --- a/languages/classes/LanguageAr.php +++ b/languages/classes/LanguageAr.php @@ -1,7 +1,7 @@ <?php /** Arabic (العربية) * - * @addtogroup Language + * @ingroup Language * * @author Niklas Laxström */ @@ -24,6 +24,4 @@ class LanguageAr extends Language { } return $forms[$index]; } - } - diff --git a/languages/classes/LanguageAz.php b/languages/classes/LanguageAz.php index 84f0c7dd..13c50547 100644 --- a/languages/classes/LanguageAz.php +++ b/languages/classes/LanguageAz.php @@ -1,7 +1,7 @@ <?php /** Azerbaijani (Azərbaycan) * - * @addtogroup Language + * @ingroup Language */ class LanguageAz extends Language { function ucfirst ( $string ) { @@ -11,6 +11,4 @@ class LanguageAz extends Language { return parent::ucfirst( $string ); } } - } - diff --git a/languages/classes/LanguageBat_smg.php b/languages/classes/LanguageBat_smg.php index fc830cf5..8d3450ac 100644 --- a/languages/classes/LanguageBat_smg.php +++ b/languages/classes/LanguageBat_smg.php @@ -1,7 +1,7 @@ <?php /** Samogitian (Žemaitėška) * - * @addtogroup Language + * @ingroup Language * * @author Niklas Laxström */ @@ -22,5 +22,4 @@ class LanguageBat_smg extends Language { return $forms[3]; } } - -}
\ No newline at end of file +} diff --git a/languages/classes/LanguageBe.php b/languages/classes/LanguageBe.php index cc3e4e37..7633f031 100644 --- a/languages/classes/LanguageBe.php +++ b/languages/classes/LanguageBe.php @@ -4,7 +4,7 @@ * This is still the version from Be-x-old, only duplicated for consistency of * plural and grammar functions. If there are errors please send a patch. * - * @addtogroup Language + * @ingroup Language * * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com> * @bug 1638, 2135 @@ -88,7 +88,4 @@ class LanguageBe extends Language { return $word; # this will return the original value for 'назоўны' (nominative) and all undefined case values } - } - - diff --git a/languages/classes/LanguageBe_tarask.php b/languages/classes/LanguageBe_tarask.php index d2dd4825..312735da 100644 --- a/languages/classes/LanguageBe_tarask.php +++ b/languages/classes/LanguageBe_tarask.php @@ -1,7 +1,7 @@ <?php /** Belarusian in Taraškievica orthography (Беларуская тарашкевіца) * - * @addtogroup Language + * @ingroup Language * * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com> * @bug 1638, 2135 @@ -12,21 +12,20 @@ class LanguageBe_tarask extends Language { /** - * Plural form transformations - * - * $wordform1 - singular form (for 1, 21, 31, 41...) - * $wordform2 - plural form (for 2, 3, 4, 22, 23, 24, 32, 33, 34...) - * $wordform3 - plural form (for 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26...) - * $wordform4 - plural form for messages without number - */ + * Plural form transformations + * + * $wordform1 - singular form (for 1, 21, 31, 41...) + * $wordform2 - plural form (for 2, 3, 4, 22, 23, 24, 32, 33, 34...) + * $wordform3 - plural form (for 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26...) + */ function convertPlural( $count, $forms ) { if ( !count($forms) ) { return ''; } - $forms = $this->preConvertPlural( $forms, 3 ); - $count = abs( $count ); - if ( isset($forms[3]) && $count != 1 ) - return $forms[3]; + //if no number with word, then use $form[0] for singular and $form[1] for plural or zero + if( count($forms) === 2 ) return $count == 1 ? $forms[0] : $forms[1]; + + $forms = $this->preConvertPlural( $forms, 3 ); if ($count > 10 && floor(($count % 100) / 10) == 1) { return $forms[2]; @@ -97,7 +96,4 @@ class LanguageBe_tarask extends Language { 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 bf3ad5c8..bb10675a 100644 --- a/languages/classes/LanguageBg.php +++ b/languages/classes/LanguageBg.php @@ -1,11 +1,8 @@ <?php + /** Bulgarian (Български) * - * @addtogroup Language - */ - -/** - * @addtogroup Language + * @ingroup Language */ class LanguageBg extends Language { /** @@ -20,4 +17,3 @@ class LanguageBg extends Language { } } } - diff --git a/languages/classes/LanguageBs.php b/languages/classes/LanguageBs.php index 410c3d62..ee2eb6a6 100644 --- a/languages/classes/LanguageBs.php +++ b/languages/classes/LanguageBs.php @@ -1,9 +1,9 @@ <?php -/** Bosnian (bosanski) - * - * @addtogroup Language - */ +/** Bosnian (bosanski) + * + * @ingroup Language + */ class LanguageBs extends Language { function convertPlural( $count, $forms ) { @@ -132,7 +132,4 @@ class LanguageBs extends Language { return $word; # this will return the original value for 'nominativ' (nominative) and all undefined case values } - } - - diff --git a/languages/classes/LanguageCs.php b/languages/classes/LanguageCs.php index 4a52368e..9c523d98 100644 --- a/languages/classes/LanguageCs.php +++ b/languages/classes/LanguageCs.php @@ -1,13 +1,9 @@ <?php + /** Czech (česky) * - * @addtogroup Language + * @ingroup Language */ - -#-------------------------------------------------------------------------- -# Internationalisation code -#-------------------------------------------------------------------------- - class LanguageCs extends Language { # Grammatical transformations, needed for inflected languages # Invoked by putting {{grammar:case|word}} in a message @@ -26,7 +22,7 @@ class LanguageCs extends Language { return 'Wikiknih'; case '3sg': return 'Wikiknihám'; - case '6sg'; + case '6sg': return 'Wikiknihách'; case '7sg': return 'Wikiknihami'; @@ -45,22 +41,20 @@ class LanguageCs extends Language { default: return 'Wikipedie'; } - case 'Wiktionary': case 'Wikcionář': case 'Wikislovník': switch ( $case ) { case '2sg': case '3sg': - case '5sg'; - case '6sg'; + case '5sg': + case '6sg': return 'Wikislovníku'; case '7sg': return 'Wikislovníkem'; default: return 'Wikislovník'; } - case 'Wikiquote': case 'Wikicitáty': switch ( $case ) { @@ -68,11 +62,54 @@ class LanguageCs extends Language { return 'Wikicitátů'; case '3sg': return 'Wikicitátům'; - case '6sg'; + case '6sg': return 'Wikicitátech'; default: return 'Wikicitáty'; } + case 'Wikinews': + case 'Wikizprávy': + switch ( $case ) { + case '2sg': + return 'Wikizpráv'; + case '3sg': + return 'Wikizprávám'; + case '6sg': + return 'Wikizprávách'; + case '7sg': + return 'Wikizprávami'; + default: + return 'Wikizprávy'; + } + case 'Wikiversity': + case 'Wikiverzita': + switch ( $case ) { + case '2sg': + return 'Wikiverzity'; + case '3sg': + case '6sg': + return 'Wikiverzitě'; + case '4sg': + return 'Wikiverzitu'; + case '5sg': + return 'Wikiverzito'; + case '7sg': + return 'Wikiverzitou'; + default: + return 'Wikiverzita'; + } + case 'Wikispecies': + case 'Wikidruhy': + switch ( $case ) { + case '2sg': + return 'Wikidruhů'; + case '3sg': + return 'Wikidruhům'; + case '6sg': + return 'Wikidruzích'; + default: + return 'Wikidruhy'; + } } # unknown return $word; @@ -83,12 +120,14 @@ class LanguageCs extends Language { $forms = $this->preConvertPlural( $forms, 3 ); switch ( $count ) { - case 1: return $forms[0]; + case 1: + return $forms[0]; case 2: case 3: - case 4: return $forms[1]; - default: return $forms[2]; + case 4: + return $forms[1]; + default: + return $forms[2]; } } - } diff --git a/languages/classes/LanguageCu.php b/languages/classes/LanguageCu.php index fba895ec..e4ef7b02 100644 --- a/languages/classes/LanguageCu.php +++ b/languages/classes/LanguageCu.php @@ -1,10 +1,9 @@ <?php -/** Old Church Slavonic (Ѩзыкъ словѣньскъ) - * - * @addtogroup Language - */ -/* Please, see Language.php for general function comments */ +/** Old Church Slavonic (Ѩзыкъ словѣньскъ) + * + * @ingroup Language + */ class LanguageCu extends Language { # Convert from the nominative form of a noun to some other case # Invoked with {{grammar:case|word}} @@ -47,6 +46,4 @@ class LanguageCu extends Language { default: return $forms[3]; } } - } - diff --git a/languages/classes/LanguageCy.php b/languages/classes/LanguageCy.php index aea24019..486f7a7c 100644 --- a/languages/classes/LanguageCy.php +++ b/languages/classes/LanguageCy.php @@ -1,7 +1,7 @@ <?php /** Welsh (Cymraeg) * - * @addtogroup Language + * @ingroup Language * * @author Niklas Laxström */ diff --git a/languages/classes/LanguageDsb.php b/languages/classes/LanguageDsb.php index 7408217e..88887998 100644 --- a/languages/classes/LanguageDsb.php +++ b/languages/classes/LanguageDsb.php @@ -1,9 +1,9 @@ <?php + /** Lower Sorbian (Dolnoserbski) * - * @addtogroup Language + * @ingroup Language */ - class LanguageDsb extends Language { # Convert from the nominative form of a noun to some other case @@ -96,7 +96,7 @@ class LanguageDsb extends Language { } break; } - + return $word; # this will return the original value for 'nominatiw' (nominativ) and all undefined case values } diff --git a/languages/classes/LanguageEo.php b/languages/classes/LanguageEo.php index f5a09897..c58d424f 100644 --- a/languages/classes/LanguageEo.php +++ b/languages/classes/LanguageEo.php @@ -1,8 +1,9 @@ <?php -/** Esperanto (Esperanto) - * @addtogroup Language - */ +/** Esperanto (Esperanto) + * + * @ingroup Language + */ class LanguageEo extends Language { function iconv( $in, $out, $string ) { # For most languages, this is a wrapper for iconv @@ -69,5 +70,3 @@ class LanguageEo extends Language { $wgEditEncoding = 'x'; } } - - diff --git a/languages/classes/LanguageEt.php b/languages/classes/LanguageEt.php index 8ed494f8..c6729d99 100644 --- a/languages/classes/LanguageEt.php +++ b/languages/classes/LanguageEt.php @@ -1,10 +1,10 @@ <?php + /** Estonian (Eesti) * - * @addtogroup Language + * @ingroup Language * */ - class LanguageEt extends Language { /** * Avoid grouping whole numbers between 0 to 9999 @@ -17,4 +17,3 @@ class LanguageEt extends Language { } } } - diff --git a/languages/classes/LanguageFi.php b/languages/classes/LanguageFi.php index 7c1778cc..d1348f03 100644 --- a/languages/classes/LanguageFi.php +++ b/languages/classes/LanguageFi.php @@ -1,21 +1,12 @@ <?php + /** Finnish (Suomi) * - * @addtogroup Language + * @ingroup Language * * @author Niklas Laxström */ class LanguageFi extends Language { - /** - * 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 $_; - } - } # Convert from the nominative form of a noun to some other case # Invoked with {{GRAMMAR:case|word}} @@ -141,7 +132,4 @@ class LanguageFi extends Language { return htmlspecialchars( trim( $final ) ); } - } - - diff --git a/languages/classes/LanguageFr.php b/languages/classes/LanguageFr.php index dfd8af4b..7341bb86 100644 --- a/languages/classes/LanguageFr.php +++ b/languages/classes/LanguageFr.php @@ -1,10 +1,9 @@ <?php + /** French (Français) * - * @addtogroup Language - * + * @ingroup Language */ - class LanguageFr extends Language { /** * Use singular form for zero (see bug 7309) @@ -15,6 +14,4 @@ class LanguageFr extends Language { return ($count <= 1) ? $forms[0] : $forms[1]; } - } - diff --git a/languages/classes/LanguageGa.php b/languages/classes/LanguageGa.php index 71b56e72..fc1546a8 100644 --- a/languages/classes/LanguageGa.php +++ b/languages/classes/LanguageGa.php @@ -1,9 +1,9 @@ <?php + /** Irish (Gaeilge) * - * @addtogroup Language + * @ingroup Language */ - class LanguageGa extends Language { # Convert day names # Invoked with {{GRAMMAR:transformation|word}} @@ -45,7 +45,4 @@ class LanguageGa extends Language { } return $word; } - } - - diff --git a/languages/classes/LanguageGsw.php b/languages/classes/LanguageGsw.php index 0ee043dc..3a1b4139 100644 --- a/languages/classes/LanguageGsw.php +++ b/languages/classes/LanguageGsw.php @@ -1,9 +1,9 @@ <?php + /** Alemannic (Alemannisch) * - * @addtogroup Language + * @ingroup Language */ - class LanguageGsw extends Language { # Convert from the nominative form of a noun to some other case # Invoked with result @@ -59,10 +59,7 @@ class LanguageGsw extends Language { $word = 'd Wikiquälle'; } break; - } + } return $word; } - } - - diff --git a/languages/classes/LanguageHe.php b/languages/classes/LanguageHe.php index 59b76333..d8256cb8 100644 --- a/languages/classes/LanguageHe.php +++ b/languages/classes/LanguageHe.php @@ -1,12 +1,12 @@ <?php + /** * Hebrew (עברית) * - * @addtogroup Language + * @ingroup Language * * @author Rotem Liss */ - class LanguageHe extends Language { /** * Convert grammar forms of words. @@ -70,5 +70,3 @@ class LanguageHe extends Language { } } } - - diff --git a/languages/classes/LanguageHr.php b/languages/classes/LanguageHr.php index 4a64f879..5fe6b3a7 100644 --- a/languages/classes/LanguageHr.php +++ b/languages/classes/LanguageHr.php @@ -1,7 +1,7 @@ <?php /** Croatian (hrvatski) * - * @addtogroup Language + * @ingroup Language */ class LanguageHr extends Language { @@ -22,7 +22,4 @@ class LanguageHr extends Language { } } } - } - - diff --git a/languages/classes/LanguageHsb.php b/languages/classes/LanguageHsb.php index 68df96be..efbaab39 100644 --- a/languages/classes/LanguageHsb.php +++ b/languages/classes/LanguageHsb.php @@ -1,7 +1,7 @@ <?php /** Upper Sorbian (Hornjoserbsce) * - * @addtogroup Language + * @ingroup Language */ class LanguageHsb extends Language { @@ -96,7 +96,7 @@ class LanguageHsb extends Language { } break; } - + return $word; # this will return the original value for 'nominatiw' (nominativ) and all undefined case values } diff --git a/languages/classes/LanguageHu.php b/languages/classes/LanguageHu.php index e4407f5b..d247b498 100644 --- a/languages/classes/LanguageHu.php +++ b/languages/classes/LanguageHu.php @@ -1,11 +1,9 @@ <?php -/** - * @addtogroup Language - */ -# -# Hungarian localisation for MediaWiki -# +/** Hungarian localisation for MediaWiki + * + * @ingroup Language + */ class LanguageHu extends Language { function convertGrammar( $word, $case ) { global $wgGrammarForms; diff --git a/languages/classes/LanguageHy.php b/languages/classes/LanguageHy.php index cc3492be..73777def 100644 --- a/languages/classes/LanguageHy.php +++ b/languages/classes/LanguageHy.php @@ -1,11 +1,10 @@ <?php -/** Armenian (Հայերեն) - * - * @addtogroup Language - * @author Ruben Vardanyan (Me@RubenVardanyan.com) - */ -/* Please, see Language.php for general function comments */ +/** Armenian (Հայերեն) + * + * @ingroup Language + * @author Ruben Vardanyan (Me@RubenVardanyan.com) + */ class LanguageHy extends Language { # Convert from the nominative form of a noun to some other case # Invoked with {{grammar:case|word}} @@ -68,4 +67,3 @@ class LanguageHy extends Language { } } } - diff --git a/languages/classes/LanguageJa.php b/languages/classes/LanguageJa.php index c56e6a9e..72c06e19 100644 --- a/languages/classes/LanguageJa.php +++ b/languages/classes/LanguageJa.php @@ -1,8 +1,9 @@ <?php + /** * Japanese (日本語) * - * @addtogroup Language + * @ingroup Language */ class LanguageJa extends Language { function stripForSearch( $string ) { @@ -37,5 +38,3 @@ class LanguageJa extends Language { return $text; } } - - diff --git a/languages/classes/LanguageKaa.php b/languages/classes/LanguageKaa.php index 4a451dcc..f9f61dbd 100644 --- a/languages/classes/LanguageKaa.php +++ b/languages/classes/LanguageKaa.php @@ -1,10 +1,9 @@ <?php + /** Karakalpak (Qaraqalpaqsha) * - * - * @addtogroup Language + * @ingroup Language */ - class LanguageKaa extends Language { # Convert from the nominative form of a noun to some other case @@ -20,13 +19,31 @@ class LanguageKaa extends Language { /* Full code of function convertGrammar() is in development. Updates coming soon. */ return $word; } - + /* + * It fixes issue with ucfirst for transforming 'i' to 'İ' + * + */ function ucfirst ( $string ) { if ( $string[0] == 'i' ) { - return 'İ' . substr( $string, 1 ); + $string = 'İ' . substr( $string, 1 ); + } else { + $string = parent::ucfirst( $string ); + } + return $string; + + } + + /* + * It fixes issue with lcfirst for transforming 'I' to 'ı' + * + */ + function lcfirst ( $string ) { + if ( $string[0] == 'I' ) { + $string = 'ı' . substr( $string, 1 ); } else { - return parent::ucfirst( $string ); + $string = parent::lcfirst( $string ); } + return $string; } /** @@ -40,4 +57,4 @@ class LanguageKaa extends Language { } } -}
\ No newline at end of file +} diff --git a/languages/classes/LanguageKk.deps.php b/languages/classes/LanguageKk.deps.php index 2b96de96..aa7361bb 100644 --- a/languages/classes/LanguageKk.deps.php +++ b/languages/classes/LanguageKk.deps.php @@ -3,9 +3,7 @@ // LanguageKk.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 - +// see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html require_once( dirname(__FILE__).'/../LanguageConverter.php' ); require_once( dirname(__FILE__).'/LanguageKk_cyrl.php' ); - diff --git a/languages/classes/LanguageKk.php b/languages/classes/LanguageKk.php index cf90e96e..34c5c39a 100644 --- a/languages/classes/LanguageKk.php +++ b/languages/classes/LanguageKk.php @@ -1,9 +1,4 @@ <?php -/** Kazakh (Қазақша) - * converter routines - * - * @addtogroup Language - */ require_once( dirname(__FILE__).'/../LanguageConverter.php' ); require_once( dirname(__FILE__).'/LanguageKk_cyrl.php' ); @@ -16,8 +11,13 @@ define( 'KK_L_LC', 'aäbcçdeéfgğhıiïjklmnñoöpqrsştuüvwxyýz' ); # Kazak define( 'H_HAMZA', 'ٴ' ); # U+0674 ARABIC LETTER HIGH HAMZA //define( 'ZWNJ', '' ); # U+200C ZERO WIDTH NON-JOINER +/** Kazakh (Қазақша) + * converter routines + * + * @ingroup Language + */ class KkConverter extends LanguageConverter { - + function __construct($langobj, $maincode, $variants=array(), $variantfallbacks=array(), @@ -25,7 +25,7 @@ class KkConverter extends LanguageConverter { $flags = array()) { parent::__construct( $langobj, $maincode, $variants, $variantfallbacks, $markup, $flags ); - + // No point delaying this since they're in code. // Waiting until loadDefaultTables() means they never get loaded // when the tables themselves are loaded from cache. @@ -60,7 +60,7 @@ class KkConverter extends LanguageConverter { $this->mTables['kk-cn']->merge( $this->mTables['kk-arab'] ); } - function loadRegs() { + function loadRegs() { $this->mCyrl2Latn = array( ## Punctuation @@ -73,8 +73,8 @@ class KkConverter extends LanguageConverter { '/^Ю(['.KK_C_UC.']|$)/u' => 'YU$1', '/^Ю(['.KK_C_LC.']|$)/u' => 'Yu$1', '/^Я(['.KK_C_UC.']|$)/u' => 'YA$1', '/^Я(['.KK_C_LC.']|$)/u' => 'Ya$1', '/^Щ(['.KK_C_UC.']|$)/u' => 'ŞÇ$1', '/^Щ(['.KK_C_LC.']|$)/u' => 'Şç$1', - ## other ЁЮЯ - '/Ё/u' => 'YO', '/ё/u' => 'yo', + ## other ЁЮЯ + '/Ё/u' => 'YO', '/ё/u' => 'yo', '/Ю/u' => 'YU', '/ю/u' => 'yu', '/Я/u' => 'YA', '/я/u' => 'ya', '/Щ/u' => 'ŞÇ', '/щ/u' => 'şç', @@ -163,7 +163,7 @@ class KkConverter extends LanguageConverter { '/Аллаһ/ui' => 'ﷲ', '/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' => '$1يە', '/[еэ]/ui' => 'ە', '/[ъь]/ui' => '', - '/[аә]/ui' => 'ا', '/[оө]/ui' => 'و', '/[ұү]/ui' => 'ۇ', '/[ыі]/ui' => 'ى', + '/[аә]/ui' => 'ا', '/[оө]/ui' => 'و', '/[ұү]/ui' => 'ۇ', '/[ыі]/ui' => 'ى', '/[и]/ui' => 'ىي', '/ё/ui' => 'يو', '/ю/ui' => 'يۋ', '/я/ui' => 'يا', '/[й]/ui' => 'ي', '/ц/ui' => 'تس', '/щ/ui' => 'شش', '/һ/ui' => 'ح', '/ч/ui' => 'تش', @@ -179,7 +179,7 @@ class KkConverter extends LanguageConverter { '/[eé]/ui' => 'ە', '/[yý]/ui' => 'ي', '/[ʺʹ]/ui' => '', '/[aä]/ui' => 'ا', '/[oö]/ui' => 'و', '/[uü]/ui' => 'ۇ', '/[ï]/ui' => 'ىي', '/[ıIiİ]/u' => 'ى', - '/c/ui' => 'تس', + '/c/ui' => 'تس', '/ç/ui' => 'تش', '/h/ui' => 'ح', #'/ç/ui' => 'چ', '/h/ui' => 'ھ', '/b/ui' => 'ب','/d/ui' => 'د', @@ -189,7 +189,6 @@ class KkConverter extends LanguageConverter { '/r/ui' => 'ر', '/s/ui' => 'س', '/ş/ui' => 'ش', '/t/ui' => 'ت', '/v/ui' => 'ۆ', '/w/ui' => 'ۋ', '/x/ui' => 'ح', '/z/ui' => 'ز',*/ ); - } /* rules should be defined as -{ekavian | iyekavian-} -or- @@ -206,7 +205,7 @@ class KkConverter extends LanguageConverter { foreach($this->mVariants as $v) { $carray[$v] = $rule; } - + return $carray; } @@ -214,7 +213,7 @@ class KkConverter extends LanguageConverter { function parserConvert( $text, &$parser ){ if(is_object($parser->getTitle() ) && $parser->getTitle()->isTalkPage()) $this->mDoContentConvert=false; - else + else $this->mDoContentConvert=true; return parent::parserConvert($text, $parser ); @@ -222,7 +221,7 @@ class KkConverter extends LanguageConverter { /* * A function wrapper: - * - if there is no selected variant, leave the link + * - if there is no selected variant, leave the link * names as they were * - do not try to find variants for usernames */ @@ -246,7 +245,7 @@ class KkConverter extends LanguageConverter { */ function autoConvert($text, $toVariant=false) { global $wgTitle; - if(is_object($wgTitle) && $wgTitle->getNameSpace()==NS_IMAGE){ + if(is_object($wgTitle) && $wgTitle->getNameSpace()==NS_IMAGE){ $imagename = $wgTitle->getNsText(); if(preg_match("/^$imagename:/",$text)) return $text; } @@ -363,9 +362,12 @@ class KkConverter extends LanguageConverter { } -/* 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. -*/ +/** + * 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 + */ class LanguageKk extends LanguageKk_cyrl { function __construct() { @@ -374,7 +376,7 @@ class LanguageKk extends LanguageKk_cyrl { $variants = array( 'kk', 'kk-cyrl', 'kk-latn', 'kk-arab', 'kk-kz', 'kk-tr', 'kk-cn' ); $variantfallbacks = array( - 'kk' => 'kk-kz', + 'kk' => 'kk-cyrl', 'kk-cyrl' => 'kk', 'kk-latn' => 'kk', 'kk-arab' => 'kk', @@ -393,7 +395,7 @@ class LanguageKk extends LanguageKk_cyrl { * * @return bool */ - function isRTL() { + function isRTL() { $variant = $this->getPreferredVariant(); if ( $variant == 'kk-arab' || $variant == 'kk-cn' ) { return true; @@ -404,7 +406,7 @@ class LanguageKk extends LanguageKk_cyrl { /* * It fixes issue with ucfirst for transforming 'i' to 'İ' - * + * */ function ucfirst ( $string ) { $variant = $this->getPreferredVariant(); @@ -418,7 +420,7 @@ class LanguageKk extends LanguageKk_cyrl { /* * It fixes issue with lcfirst for transforming 'I' to 'ı' - * + * */ function lcfirst ( $string ) { $variant = $this->getPreferredVariant(); @@ -453,5 +455,4 @@ class LanguageKk extends LanguageKk_cyrl { wfProfileOut( __METHOD__ ); return $word; } - } diff --git a/languages/classes/LanguageKk_cyrl.php b/languages/classes/LanguageKk_cyrl.php index a7f07573..e0a1b125 100644 --- a/languages/classes/LanguageKk_cyrl.php +++ b/languages/classes/LanguageKk_cyrl.php @@ -1,10 +1,8 @@ <?php /** Kazakh (Қазақша) - * - * - * @addtogroup Language - */ - + * + * @ingroup Language + */ class LanguageKk_cyrl extends Language { @@ -153,7 +151,7 @@ class LanguageKk_cyrl extends Language { } elseif ( in_array( $wordLastVowel, $backVowels ) ) { $word = $word . "да"; } - } + } break; case "dc41": case "possessive locative": #täweldık + jatıs @@ -169,7 +167,7 @@ class LanguageKk_cyrl extends Language { } elseif ( in_array( $wordLastVowel, $backVowels ) ) { $word = $word . "нда"; } - } + } break; case "dc5": case "ablative": #şığıs @@ -373,7 +371,7 @@ class LanguageKk_cyrl extends Language { } elseif ( in_array( $wordLastVowel, $backVowels ) ) { $word = $word . "da"; } - } + } break; case "dc41": case "possessive locative": #täweldık + jatıs @@ -389,7 +387,7 @@ class LanguageKk_cyrl extends Language { } elseif ( in_array( $wordLastVowel, $backVowels ) ) { $word = $word . "nda"; } - } + } break; case "dc5": case "ablative": #şığıs @@ -593,7 +591,7 @@ class LanguageKk_cyrl extends Language { } elseif ( in_array( $wordLastVowel, $backVowels ) ) { $word = $word . "دا"; } - } + } break; case "dc41": case "possessive locative": #täweldık + jatıs @@ -609,7 +607,7 @@ class LanguageKk_cyrl extends Language { } elseif ( in_array( $wordLastVowel, $backVowels ) ) { $word = $word . "ندا"; } - } + } break; case "dc5": case "ablative": #şığıs @@ -681,7 +679,7 @@ class LanguageKk_cyrl extends Language { // Put the word in a form we can play with since we're using UTF-8 $ar = preg_split('//u', parent::lc($word), -1, PREG_SPLIT_NO_EMPTY); - // Here's an array with the order of the letters in the word reversed + // Here's an array with the order of the letters in the word reversed // so we can find a match quicker *shrug* $wordReversed = array_reverse( $ar ); diff --git a/languages/classes/LanguageKm.php b/languages/classes/LanguageKm.php new file mode 100644 index 00000000..831feb9c --- /dev/null +++ b/languages/classes/LanguageKm.php @@ -0,0 +1,17 @@ +<?php +/** Khmer (ភាសាខ្មែរ) + * + * @ingroup Language + * + * @author Niklas Laxström + */ +class LanguageKm extends Language { + function commafy($_) { + /* NO-op for Khmer. Cannot use + * $separatorTransformTable = array( ',' => '' ) + * That would break when parsing and doing strstr '' => 'foo'; + */ + return $_; + } + +} diff --git a/languages/classes/LanguageKsh.php b/languages/classes/LanguageKsh.php index f72046e7..b21cc4d7 100644 --- a/languages/classes/LanguageKsh.php +++ b/languages/classes/LanguageKsh.php @@ -1,11 +1,11 @@ <?php + /** Ripuarian (Ripoarėsh) * - * @addtogroup Language + * @ingroup Language * * @author Purodha Blissenbach */ - class LanguageKsh extends Language { /** * Avoid grouping whole numbers between 0 to 9999 @@ -34,4 +34,3 @@ class LanguageKsh extends Language { } } } - diff --git a/languages/classes/LanguageKu.deps.php b/languages/classes/LanguageKu.deps.php index 7aeba604..43e2916c 100644 --- a/languages/classes/LanguageKu.deps.php +++ b/languages/classes/LanguageKu.deps.php @@ -3,10 +3,7 @@ // 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 - +// see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.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 index d37d4287..55eb0d56 100644 --- a/languages/classes/LanguageKu.php +++ b/languages/classes/LanguageKu.php @@ -1,19 +1,18 @@ <?php -/** Kurdish - * converter routines - * - * @addtogroup Language - */ - require_once( dirname(__FILE__).'/../LanguageConverter.php' ); require_once( dirname(__FILE__).'/LanguageKu_ku.php' ); +/** Kurdish + * converter routines + * + * @ingroup Language + */ 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', + 'ت' => 't', 'ڤ' => 'v', 'خ' => 'x', 'غ' => 'x', 'ز' => 'z', // ک و => ku -- ist richtig // و ك=> ku -- ist auch richtig @@ -34,7 +33,7 @@ class KuConverter extends LanguageConverter { 'ۆ' => 'o', 'و' => 'w', 'ئ' => '', # initial hemze should not be shown - '،' => ',', + '،' => ',', 'ع' => '\'', # ayn '؟' => '?', @@ -82,7 +81,7 @@ class KuConverter extends LanguageConverter { 'u' => 'و', 'û' => 'وو', 'w' => 'و', - ',' => '،', + ',' => '،', '?' => '؟', # Try to replace the leading vowel @@ -108,7 +107,7 @@ class KuConverter extends LanguageConverter { ' U' => 'ئو ', ' Û' => 'ئوو ', # eyn erstmal deaktivieren, einfache Anführungsstriche sind einfach zu häufig, um sie als eyn zu interpretieren - # '\'' => 'ع', + # '\'' => 'ع', /* # deactivated for now, breaks links i.e. in header of Special:Recentchanges :-( # digits @@ -133,12 +132,11 @@ class KuConverter extends LanguageConverter { ); } - // Do not convert content on talk pages function parserConvert( $text, &$parser ){ if(is_object($parser->getTitle() ) && $parser->getTitle()->isTalkPage()) $this->mDoContentConvert=false; - else + else $this->mDoContentConvert=true; return parent::parserConvert($text, $parser ); @@ -146,7 +144,7 @@ class KuConverter extends LanguageConverter { /* * A function wrapper: - * - if there is no selected variant, leave the link + * - if there is no selected variant, leave the link * names as they were * - do not try to find variants for usernames */ @@ -180,7 +178,7 @@ class KuConverter extends LanguageConverter { */ function autoConvert($text, $toVariant=false) { global $wgTitle; - if(is_object($wgTitle) && $wgTitle->getNameSpace()==NS_IMAGE){ + if(is_object($wgTitle) && $wgTitle->getNameSpace()==NS_IMAGE){ $imagename = $wgTitle->getNsText(); if(preg_match("/^$imagename:/",$text)) return $text; } @@ -227,6 +225,9 @@ class KuConverter extends LanguageConverter { } } +/** + * @ingroup Language + */ class LanguageKu extends LanguageKu_ku { function __construct() { diff --git a/languages/classes/LanguageKu_ku.php b/languages/classes/LanguageKu_ku.php index d8be6d9b..5dec67e6 100644 --- a/languages/classes/LanguageKu_ku.php +++ b/languages/classes/LanguageKu_ku.php @@ -1,11 +1,9 @@ <?php -/** Kurdish - * - * - * @addtogroup Language - */ - +/** Kurdish + * + * @ingroup Language + */ class LanguageKu_ku extends Language { /** # Convert from the nominative form of a noun to some other case @@ -31,5 +29,3 @@ class LanguageKu_ku extends Language { } } } - - diff --git a/languages/classes/LanguageLa.php b/languages/classes/LanguageLa.php index 339eae15..c26d0e8e 100644 --- a/languages/classes/LanguageLa.php +++ b/languages/classes/LanguageLa.php @@ -1,9 +1,9 @@ <?php -/** Latin (lingua Latina) - * - * @addtogroup Language - */ +/** Latin (lingua Latina) + * + * @ingroup Language + */ class LanguageLa extends Language { /** * Convert from the nominative form of a noun to some other case @@ -75,8 +75,4 @@ class LanguageLa extends Language { return $word; } } - } - - - diff --git a/languages/classes/LanguageLt.php b/languages/classes/LanguageLt.php index 0e14cbf8..87519d98 100644 --- a/languages/classes/LanguageLt.php +++ b/languages/classes/LanguageLt.php @@ -1,10 +1,9 @@ <?php + /** Lithuanian (Lietuvių) * - * @addtogroup Language - * + * @ingroup Language */ - class LanguageLt extends Language { /* Word forms (with examples): 1 - vienas (1) lapas, dvidešimt vienas (21) lapas @@ -24,4 +23,3 @@ class LanguageLt extends Language { return $forms[2]; } } - diff --git a/languages/classes/LanguageLv.php b/languages/classes/LanguageLv.php index a3f076e8..1c82831c 100644 --- a/languages/classes/LanguageLv.php +++ b/languages/classes/LanguageLv.php @@ -1,14 +1,14 @@ <?php + /** Latvian (Latviešu) * - * @addtogroup Language + * @ingroup Language * * @author Niklas Laxström * * @copyright Copyright © 2006, Niklas Laxström * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ - class LanguageLv extends Language { /** * Plural form transformations. Using the first form for words with the last digit 1, but not for words with the last digits 11, and the second form for all the others. @@ -45,15 +45,13 @@ class LanguageLv extends Language { $wgGrammarForms['lv']['akuzatīvs']['Vikivārdnīca'] = 'Vikivārdnīcu'; $wgGrammarForms['lv']['lokatīvs' ]['Vikipēdija'] = 'Vikipēdijā'; $wgGrammarForms['lv']['lokatīvs' ]['Vikivārdnīca'] = 'Vikivārdnīcā'; - + if ( isset($wgGrammarForms['lv'][$case][$word]) ) { return $wgGrammarForms['lv'][$case][$word]; } return $word; - } - } diff --git a/languages/classes/LanguageMt.php b/languages/classes/LanguageMt.php new file mode 100644 index 00000000..fff779ac --- /dev/null +++ b/languages/classes/LanguageMt.php @@ -0,0 +1,22 @@ +<?php + +/** Maltese (Malti) + * + * @ingroup Language + * + * @author Niklas Laxström + */ + +class LanguageMt extends Language { + function convertPlural( $count, $forms ) { + if ( !count($forms) ) { return ''; } + + $forms = $this->preConvertPlural( $forms, 4 ); + + if ( $count === 1 ) $index = 0; + elseif ( $count === 0 || ( $count%100>1 && $count%100<11) ) $index = 1; + elseif ( $count%100>10 && $count%100<20 ) $index = 2; + else $index = 3; + return $forms[$index]; + } +}
\ No newline at end of file diff --git a/languages/classes/LanguagePl.php b/languages/classes/LanguagePl.php index 35b2a9c0..54314fab 100644 --- a/languages/classes/LanguagePl.php +++ b/languages/classes/LanguagePl.php @@ -1,9 +1,9 @@ <?php + /** Polish (polski) * - * @addtogroup Language + * @ingroup Language */ - class LanguagePl extends Language { function convertPlural( $count, $forms ) { if ( !count($forms) ) { return ''; } @@ -21,4 +21,4 @@ class LanguagePl extends Language { return $forms[2]; // plural genitive } } -}
\ No newline at end of file +} diff --git a/languages/classes/LanguagePt_br.php b/languages/classes/LanguagePt_br.php index 78965ae3..49726fe7 100644 --- a/languages/classes/LanguagePt_br.php +++ b/languages/classes/LanguagePt_br.php @@ -1,10 +1,9 @@ <?php + /** Brazilian Portugese (Portuguêsi do Brasil) * - * @addtogroup Language - * + * @ingroup Language */ - class LanguagePt_br extends Language { /** * Use singular form for zero (see bug 7309) @@ -16,4 +15,3 @@ class LanguagePt_br extends Language { return ($count <= 1) ? $forms[0] : $forms[1]; } } - diff --git a/languages/classes/LanguageRmy.php b/languages/classes/LanguageRmy.php index e6096348..e3cab8f4 100644 --- a/languages/classes/LanguageRmy.php +++ b/languages/classes/LanguageRmy.php @@ -1,5 +1,8 @@ <?php +/** + * @ingroup Language + */ class LanguageRmy extends Language { /** * Convert from the nominative form of a noun to some other case @@ -68,5 +71,3 @@ class LanguageRmy extends Language { return $word; # this will return the original value for 'nominative' and all undefined case values } } - - diff --git a/languages/classes/LanguageRu.php b/languages/classes/LanguageRu.php index f6311b33..d857920a 100644 --- a/languages/classes/LanguageRu.php +++ b/languages/classes/LanguageRu.php @@ -1,12 +1,11 @@ <?php + /** Russian (русский язык) * * You can contact Alexander Sigachov (alexander.sigachov at Googgle Mail) * - * @addtogroup Language + * @ingroup Language */ - -/* Please, see Language.php for general function comments */ class LanguageRu extends Language { # Convert from the nominative form of a noun to some other case # Invoked with {{grammar:case|word}} @@ -104,5 +103,3 @@ class LanguageRu extends Language { } } } - - diff --git a/languages/classes/LanguageSk.php b/languages/classes/LanguageSk.php index edbe011c..19e66bae 100644 --- a/languages/classes/LanguageSk.php +++ b/languages/classes/LanguageSk.php @@ -1,8 +1,9 @@ <?php + /** * Slovak (Slovenčina) * - * @addtogroup Language + * @ingroup Language */ class LanguageSk extends Language { # Convert from the nominative form of a noun to some other case @@ -89,6 +90,4 @@ class LanguageSk extends Language { } return $forms[$index]; } - } - diff --git a/languages/classes/LanguageSl.php b/languages/classes/LanguageSl.php index 9b1e5c2b..8c1b503b 100644 --- a/languages/classes/LanguageSl.php +++ b/languages/classes/LanguageSl.php @@ -1,8 +1,8 @@ <?php + /** Slovenian (Slovenščina) * - * @addtogroup Language - * + * @ingroup Language */ class LanguageSl extends Language { # Convert from the nominative form of a noun to some other case @@ -88,7 +88,4 @@ class LanguageSl extends Language { } return $forms[$index]; } - - } - diff --git a/languages/classes/LanguageSr.deps.php b/languages/classes/LanguageSr.deps.php index 018a83c2..ffdd234b 100644 --- a/languages/classes/LanguageSr.deps.php +++ b/languages/classes/LanguageSr.deps.php @@ -3,8 +3,7 @@ // LanguageSr.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 +// see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html 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 7fe67941..d57c733d 100644 --- a/languages/classes/LanguageSr.php +++ b/languages/classes/LanguageSr.php @@ -1,19 +1,18 @@ <?php -/** - * @addtogroup Language - */ - -/* - There are two levels of conversion for Serbian: the script level - (Cyrillics <-> Latin), and the variant level (ekavian - <->iyekavian). The two are orthogonal. So we really only need two - dictionaries: one for Cyrillics and Latin, and one for ekavian and - iyekavian. -*/ + require_once( dirname(__FILE__).'/../LanguageConverter.php' ); require_once( dirname(__FILE__).'/LanguageSr_ec.php' ); require_once( dirname(__FILE__).'/LanguageSr_el.php' ); +/** + * There are two levels of conversion for Serbian: the script level + * (Cyrillics <-> Latin), and the variant level (ekavian + * <->iyekavian). The two are orthogonal. So we really only need two + * dictionaries: one for Cyrillics and Latin, and one for ekavian and + * iyekavian. + * + * @ingroup Language + */ class SrConverter extends LanguageConverter { var $mToLatin = array( 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', @@ -54,9 +53,7 @@ class SrConverter extends LanguageConverter { function loadDefaultTables() { $this->mTables = array( 'sr-ec' => new ReplacementArray( $this->mToCyrillics ), - 'sr-jc' => new ReplacementArray( $this->mToCyrillics), 'sr-el' => new ReplacementArray( $this->mToLatin), - 'sr-jl' => new ReplacementArray( $this->mToLatin), 'sr' => new ReplacementArray() ); } @@ -75,7 +72,7 @@ class SrConverter extends LanguageConverter { foreach($this->mVariants as $v) { $carray[$v] = $rule; } - + return $carray; } @@ -83,7 +80,7 @@ class SrConverter extends LanguageConverter { function parserConvert( $text, &$parser ){ if(is_object($parser->getTitle() ) && $parser->getTitle()->isTalkPage()) $this->mDoContentConvert=false; - else + else $this->mDoContentConvert=true; return parent::parserConvert($text, $parser ); @@ -91,7 +88,7 @@ class SrConverter extends LanguageConverter { /* * A function wrapper: - * - if there is no selected variant, leave the link + * - if there is no selected variant, leave the link * names as they were * - do not try to find variants for usernames */ @@ -125,12 +122,12 @@ class SrConverter extends LanguageConverter { */ function autoConvert($text, $toVariant=false) { global $wgTitle; - if(is_object($wgTitle) && $wgTitle->getNameSpace()==NS_IMAGE){ + 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: @@ -145,7 +142,7 @@ class SrConverter extends LanguageConverter { $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 ) ) ); @@ -160,24 +157,23 @@ class SrConverter extends LanguageConverter { return $ret; } - } +/** + * @ingroup Language + */ class LanguageSr extends LanguageSr_ec { function __construct() { global $wgHooks; parent::__construct(); - // these variants are currently UNUSED: - // 'sr-jc', 'sr-jl' $variants = array('sr', 'sr-ec', 'sr-el'); $variantfallbacks = array( 'sr' => 'sr-ec', 'sr-ec' => 'sr', 'sr-el' => 'sr', - ); - + ); $marker = array();//don't mess with these, leave them as they are $flags = array( @@ -188,4 +184,3 @@ class LanguageSr extends LanguageSr_ec { $wgHooks['ArticleSaveComplete'][] = $this->mConverter; } } - diff --git a/languages/classes/LanguageSr_ec.php b/languages/classes/LanguageSr_ec.php index 1f9bb716..c7300198 100644 --- a/languages/classes/LanguageSr_ec.php +++ b/languages/classes/LanguageSr_ec.php @@ -1,12 +1,8 @@ <?php -/** - * @addtogroup Language - */ - -#-------------------------------------------------------------------------- -# Internationalisation code -#-------------------------------------------------------------------------- +/** + * @ingroup Language + */ class LanguageSr_ec extends Language { function convertPlural( $count, $forms ) { if ( !count($forms) ) { return ''; } @@ -24,6 +20,4 @@ class LanguageSr_ec extends Language { } } } - } - diff --git a/languages/classes/LanguageSr_el.deps.php b/languages/classes/LanguageSr_el.deps.php index d73638f4..cec44dcc 100644 --- a/languages/classes/LanguageSr_el.deps.php +++ b/languages/classes/LanguageSr_el.deps.php @@ -6,4 +6,3 @@ // 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 a444e3b7..6ad55f4d 100644 --- a/languages/classes/LanguageSr_el.php +++ b/languages/classes/LanguageSr_el.php @@ -1,12 +1,8 @@ <?php -/** - * @addtogroup Language - */ - -#-------------------------------------------------------------------------- -# Internationalisation code -#-------------------------------------------------------------------------- +/** + * @ingroup Language + */ class LanguageSr_el extends Language { function convertPlural( $count, $forms ) { if ( !count($forms) ) { return ''; } @@ -24,6 +20,4 @@ class LanguageSr_el extends Language { } } } - } - diff --git a/languages/classes/LanguageTg.php b/languages/classes/LanguageTg.php new file mode 100644 index 00000000..3a2840db --- /dev/null +++ b/languages/classes/LanguageTg.php @@ -0,0 +1,104 @@ +<?php + +require_once( dirname(__FILE__).'/../LanguageConverter.php' ); + +/** + * Converts Tajiki to latin orthography + * @ingroup Language + */ +class TgConverter extends LanguageConverter { + private $table = array( + 'а' => 'a', + 'б' => 'b', + 'в' => 'v', + 'г' => 'g', + 'д' => 'd', + 'е' => 'e', + 'ё' => 'jo', + 'ж' => 'ƶ', + 'з' => 'z', + 'ии ' => 'iji ', + 'и' => 'i', + 'й' => 'j', + 'к' => 'k', + 'л' => 'l', + 'м' => 'm', + 'н' => 'n', + 'о' => 'o', + 'п' => 'p', + 'р' => 'r', + 'с' => 's', + 'т' => 't', + 'у' => 'u', + 'ф' => 'f', + 'х' => 'x', + 'ч' => 'c', + 'ш' => 'ş', + 'ъ' => '\'', + 'э' => 'e', + 'ю' => 'ju', + 'я' => 'ja', + 'ғ' => 'ƣ', + 'ӣ' => 'ī', + 'қ' => 'q', + 'ӯ' => 'ū', + 'ҳ' => 'h', + 'ҷ' => 'ç', + 'ц' => 'ts', + 'А' => 'A', + 'Б' => 'B', + 'В' => 'V', + 'Г' => 'G', + 'Д' => 'D', + 'Е' => 'E', + 'Ё' => 'Jo', + 'Ж' => 'Ƶ', + 'З' => 'Z', + 'И' => 'I', + 'Й' => 'J', + 'К' => 'K', + 'Л' => 'L', + 'М' => 'M', + 'Н' => 'N', + 'О' => 'O', + 'П' => 'P', + 'Р' => 'R', + 'С' => 'S', + 'Т' => 'T', + 'У' => 'U', + 'Ф' => 'F', + 'Х' => 'X', + 'Ч' => 'C', + 'Ш' => 'Ş', + 'Ъ' => '\'', + 'Э' => 'E', + 'Ю' => 'Ju', + 'Я' => 'Ja', + 'Ғ' => 'Ƣ', + 'Ӣ' => 'Ī', + 'Қ' => 'Q', + 'Ӯ' => 'Ū', + 'Ҳ' => 'H', + 'Ҷ' => 'Ç', + 'Ц' => 'Ts', + ); + + function loadDefaultTables() { + $this->mTables = array( + 'tg-latn' => new ReplacementArray( $this->table ), + 'tg' => new ReplacementArray() + ); + } + +} + +/** + * @ingroup Language + */ +class LanguageTg extends Language { + function __construct() { + parent::__construct(); + $variants = array( 'tg', 'tg-latn' ); + $this->mConverter = new TgConverter( $this, 'tg', $variants ); + } +} diff --git a/languages/classes/LanguageTr.php b/languages/classes/LanguageTr.php index 9a051a5c..8a2dee09 100644 --- a/languages/classes/LanguageTr.php +++ b/languages/classes/LanguageTr.php @@ -1,8 +1,9 @@ <?php + /** * Turkish (Türkçe) * - * @addtogroup Language + * @ingroup Language */ class LanguageTr extends Language { function ucfirst ( $string ) { @@ -12,6 +13,4 @@ class LanguageTr extends Language { return parent::ucfirst( $string ); } } - } - diff --git a/languages/classes/LanguageTyv.php b/languages/classes/LanguageTyv.php index fd0a18c6..d77f7966 100644 --- a/languages/classes/LanguageTyv.php +++ b/languages/classes/LanguageTyv.php @@ -1,21 +1,17 @@ <?php + /** Tyvan localization (Тыва дыл) - * @addtogroup Language + * From friends at tyvawiki.org + * + * @ingroup Language */ - -# From friends at tyvawiki.org - -#-------------------------------------------------------------------------- -# Internationalisation code -#-------------------------------------------------------------------------- - class LanguageTyv extends Language { /** * Grammatical transformations, needed for inflected languages * Invoked by putting {{grammar:case|word}} in a message * - * @param string $word - * @param string $case + * @param $word string + * @param $case string * @return string */ function convertGrammar( $word, $case ) { @@ -24,7 +20,6 @@ class LanguageTyv extends Language { return $wgGrammarForms['tyv'][$case][$word]; } - // Set up some constants... $allVowels = array("е", "и", "э", "ө", "ү", "а", "ё", "о", "у", "ы", "ю", "я", "a", "e", "i", "o", "ö", "u", "ü", "y"); $frontVowels = array("е", "и", "э", "ө", "ү", "e", "i", "ö", "ü"); @@ -229,4 +224,3 @@ class LanguageTyv extends Language { return $word; } } - diff --git a/languages/classes/LanguageUk.php b/languages/classes/LanguageUk.php index 7d2f58bf..dbebb134 100644 --- a/languages/classes/LanguageUk.php +++ b/languages/classes/LanguageUk.php @@ -1,11 +1,9 @@ <?php -/** Ukrainian (українська мова) - * - * @package MediaWiki - * @subpackage Language - */ -/* Please, see Language.php for general function comments */ +/** Ukrainian (українська мова) + * + * @ingroup Language + */ class LanguageUk extends Language { # Convert from the nominative form of a noun to some other case # Invoked with {{grammar:case|word}} @@ -60,6 +58,10 @@ class LanguageUk extends Language { function convertPlural( $count, $forms ) { if ( !count($forms) ) { return ''; } + + //if no number with word, then use $form[0] for singular and $form[1] for plural or zero + if( count($forms) === 2 ) return $count == 1 ? $forms[0] : $forms[1]; + $forms = $this->preConvertPlural( $forms, 3 ); if ($count > 10 && floor(($count % 100) / 10) == 1) { @@ -87,4 +89,3 @@ class LanguageUk extends Language { } } } - diff --git a/languages/classes/LanguageWa.php b/languages/classes/LanguageWa.php index 194c7720..d97b2026 100644 --- a/languages/classes/LanguageWa.php +++ b/languages/classes/LanguageWa.php @@ -2,7 +2,7 @@ /** * Walloon (Walon) * - * @addtogroup Language + * @ingroup Language */ # NOTE: cweri après "NOTE:" po des racsegnes so des ratournaedjes @@ -27,13 +27,13 @@ class LanguageWa extends Language { $d = substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2); return $d; } - + # dd/mm/YYYY format if ( $datePreference == 'walloon short' ) { $d = substr($ts, 6, 2). '/' . substr($ts, 4, 2). '/' .substr($ts, 0, 4); return $d; } - + # Walloon format # # we output this in all other cases @@ -61,10 +61,8 @@ class LanguageWa extends Language { if ( $datePreference == 'ISO 8601' ) { return parent::timeanddate( $ts, $adj, $format, $tc ); } else { - return $this->date( $ts, $adj, $format, $tc ) . ' a ' . + return $this->date( $ts, $adj, $format, $tc ) . ' a ' . $this->time( $ts, $adj, $format, $tc ); } } } - - diff --git a/languages/classes/LanguageYue.php b/languages/classes/LanguageYue.php index 26e45984..fdc227b3 100644 --- a/languages/classes/LanguageYue.php +++ b/languages/classes/LanguageYue.php @@ -1,7 +1,7 @@ <?php /** - * @addtogroup Language - */ + * @ingroup Language + */ class LanguageYue extends Language { function stripForSearch( $string ) { # MySQL fulltext index doesn't grok utf-8, so we diff --git a/languages/classes/LanguageZh.deps.php b/languages/classes/LanguageZh.deps.php index 05e51799..542170a0 100644 --- a/languages/classes/LanguageZh.deps.php +++ b/languages/classes/LanguageZh.deps.php @@ -3,7 +3,7 @@ // LanguageZh.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 +// see http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html require_once( dirname(__FILE__).'/LanguageZh_hans.php' ); require_once( dirname(__FILE__).'/../LanguageConverter.php' ); diff --git a/languages/classes/LanguageZh.php b/languages/classes/LanguageZh.php index 337783a6..3d162a8e 100644 --- a/languages/classes/LanguageZh.php +++ b/languages/classes/LanguageZh.php @@ -1,35 +1,69 @@ <?php -/** - * @addtogroup Language - */ + require_once( dirname(__FILE__).'/../LanguageConverter.php' ); require_once( dirname(__FILE__).'/LanguageZh_hans.php' ); +/** + * @ingroup Language + */ class ZhConverter extends LanguageConverter { + + function __construct($langobj, $maincode, + $variants=array(), + $variantfallbacks=array(), + $markup=array(), + $flags = array(), + $manualLevel = array() ) { + $this->mDescCodeSep = ':'; + $this->mDescVarSep = ';'; + parent::__construct($langobj, $maincode, + $variants, + $variantfallbacks, + $markup, + $flags, + $manualLevel); + $names = array( + 'zh' => '原文', + 'zh-hans' => '简体', + 'zh-hant' => '繁體', + 'zh-cn' => '大陆', + 'zh-tw' => '台灣', + 'zh-hk' => '香港', + 'zh-mo' => '澳門', + 'zh-sg' => '新加坡', + 'zh-my' => '大马', + ); + $this->mVariantNames = array_merge($this->mVariantNames,$names); + } + function loadDefaultTables() { require( dirname(__FILE__)."/../../includes/ZhConversion.php" ); $this->mTables = array( 'zh-hans' => new ReplacementArray( $zh2Hans ), 'zh-hant' => new ReplacementArray( $zh2Hant ), 'zh-cn' => new ReplacementArray( array_merge($zh2Hans, $zh2CN) ), - 'zh-tw' => new ReplacementArray( array_merge($zh2Hant, $zh2TW) ), - 'zh-sg' => new ReplacementArray( array_merge($zh2Hans, $zh2SG) ), 'zh-hk' => new ReplacementArray( array_merge($zh2Hant, $zh2HK) ), + 'zh-mo' => new ReplacementArray( array_merge($zh2Hant, $zh2HK) ), + 'zh-my' => new ReplacementArray( array_merge($zh2Hans, $zh2SG) ), + 'zh-sg' => new ReplacementArray( array_merge($zh2Hans, $zh2SG) ), + 'zh-tw' => new ReplacementArray( array_merge($zh2Hant, $zh2TW) ), 'zh' => new ReplacementArray ); } function postLoadTables() { $this->mTables['zh-cn']->merge( $this->mTables['zh-hans'] ); - $this->mTables['zh-tw']->merge( $this->mTables['zh-hant'] ); - $this->mTables['zh-sg']->merge( $this->mTables['zh-hans'] ); $this->mTables['zh-hk']->merge( $this->mTables['zh-hant'] ); + $this->mTables['zh-mo']->merge( $this->mTables['zh-hant'] ); + $this->mTables['zh-my']->merge( $this->mTables['zh-hans'] ); + $this->mTables['zh-sg']->merge( $this->mTables['zh-hans'] ); + $this->mTables['zh-tw']->merge( $this->mTables['zh-hant'] ); } /* there shouldn't be any latin text in Chinese conversion, so no need to mark anything. $noParse is there for compatibility with LanguageConvert::markNoConversion - */ + */ function markNoConversion($text, $noParse = false) { return $text; } @@ -39,33 +73,44 @@ class ZhConverter extends LanguageConverter { } } - -/* class that handles both Traditional and Simplified Chinese - right now it only distinguish zh_hans, zh_hant, zh_cn, zh_tw, zh_sg and zh_hk. -*/ +/** + * class that handles both Traditional and Simplified Chinese + * right now it only distinguish zh_hans, zh_hant, zh_cn, zh_tw, zh_sg and zh_hk. + * + * @ingroup Language + */ class LanguageZh extends LanguageZh_hans { function __construct() { global $wgHooks; parent::__construct(); - $variants = array('zh', 'zh-hans', 'zh-hant', 'zh-cn', 'zh-tw', 'zh-sg', 'zh-hk'); + $variants = array('zh','zh-hans','zh-hant','zh-cn','zh-hk','zh-mo','zh-my','zh-sg','zh-tw'); $variantfallbacks = array( - 'zh' => 'zh-hans', - 'zh-hans' => 'zh', - 'zh-hant' => 'zh', - 'zh-cn' => 'zh-hans', - 'zh-sg' => 'zh-hans', - 'zh-tw' => 'zh-hant', - 'zh-hk' => 'zh-hant', + 'zh' => array('zh-hans','zh-hant','zh-cn','zh-tw','zh-hk','zh-sg','zh-mo','zh-my'), + 'zh-hans' => array('zh-cn','zh-sg','zh-my'), + 'zh-hant' => array('zh-tw','zh-hk','zh-mo'), + 'zh-cn' => array('zh-hans','zh-sg','zh-my'), + 'zh-sg' => array('zh-hans','zh-cn','zh-my'), + 'zh-my' => array('zh-hans','zh-sg','zh-cn'), + 'zh-tw' => array('zh-hant','zh-hk','zh-mo'), + 'zh-hk' => array('zh-hant','zh-mo','zh-tw'), + 'zh-mo' => array('zh-hant','zh-hk','zh-tw'), + ); + $ml=array( + 'zh' => 'disable', + 'zh-hans' => 'unidirectional', + 'zh-hant' => 'unidirectional', ); - $this->mConverter = new ZhConverter( $this, 'zh', $variants, $variantfallbacks ); + $this->mConverter = new ZhConverter( $this, 'zh', + $variants, $variantfallbacks, + array(),array(), + $ml); $wgHooks['ArticleSaveComplete'][] = $this->mConverter; } - # this should give much better diff info function segmentForDiff( $text ) { return preg_replace( @@ -108,5 +153,5 @@ class LanguageZh extends LanguageZh_hans { $ret = array_unique( explode('|', $terms) ); return $ret; } - } + diff --git a/languages/classes/LanguageZh_hans.php b/languages/classes/LanguageZh_hans.php index ed7da2b9..983dd485 100644 --- a/languages/classes/LanguageZh_hans.php +++ b/languages/classes/LanguageZh_hans.php @@ -1,7 +1,8 @@ <?php + /** - * @addtogroup Language - */ + * @ingroup Language + */ class LanguageZh_hans extends Language { function stripForSearch( $string ) { # MySQL fulltext index doesn't grok utf-8, so we |