From 820a2884b6ebbb6895c3b80f9ddb3a3ef85dce11 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Mon, 10 Jul 2006 20:22:49 +0000 Subject: [PATCH] make methods compatible with parent class 'Language' --- languages/Language.php | 4 ++-- languages/LanguageAr.php | 2 +- languages/LanguageBg.php | 2 +- languages/LanguageBr.php | 11 ++++++++--- languages/LanguageCy.php | 2 +- languages/LanguageDa.php | 10 ++++++++-- languages/LanguageHu.php | 11 ++++++++--- languages/LanguageIs.php | 15 ++++++++++++--- languages/LanguageKo.php | 5 ++++- languages/LanguageNn.php | 15 ++++++++++++--- languages/LanguagePt.php | 2 +- languages/LanguageRu.php | 2 +- languages/LanguageSr.php | 2 +- languages/LanguageSr_ec.php | 2 +- languages/LanguageSr_el.php | 2 +- languages/LanguageTt.php | 16 ++++++++++++---- languages/LanguageZh_cn.php | 10 ++++++++-- 17 files changed, 82 insertions(+), 31 deletions(-) diff --git a/languages/Language.php b/languages/Language.php index cbb5e31655..1eda8edab1 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1048,8 +1048,8 @@ class Language { * @param string $wordform3 (optional) * @return string */ - function convertPlural( $count, $wordform1, $wordform2, $wordform3) { - return $count == '1' ? $wordform1 : $wordform2; + function convertPlural( $count, $w1, $w2, $w3) { + return $count == '1' ? $w1 : $w2; } /** diff --git a/languages/LanguageAr.php b/languages/LanguageAr.php index f56053d865..ebd2a6f57b 100644 --- a/languages/LanguageAr.php +++ b/languages/LanguageAr.php @@ -147,7 +147,7 @@ class LanguageAr extends LanguageUtf8 { return 'windows-1256'; } - function getMagicWords() { + function &getMagicWords() { global $wgMagicWordsAr; return $wgMagicWordsAr; } diff --git a/languages/LanguageBg.php b/languages/LanguageBg.php index da600989cb..1a158dbd05 100644 --- a/languages/LanguageBg.php +++ b/languages/LanguageBg.php @@ -167,7 +167,7 @@ class LanguageBg extends LanguageUtf8 { * Exports $wgMagicWordsBg * @return array */ - function getMagicWords() { + function &getMagicWords() { global $wgMagicWordsBg; return $wgMagicWordsBg; } diff --git a/languages/LanguageBr.php b/languages/LanguageBr.php index 30939866e1..8a1bf9ac22 100644 --- a/languages/LanguageBr.php +++ b/languages/LanguageBr.php @@ -94,8 +94,10 @@ class LanguageBr extends LanguageUtf8 { return $wgSkinNamesBr; } - - function date( $ts, $adj = false ) { + /** + * $format and $timecorrection are for compatibility with Language::date + */ + function date( $ts, $adj = false, $format = true, $timecorrection = false ) { if ( $adj ) { $ts = $this->userAdjust( $ts ); } $d = (0 + substr( $ts, 6, 2 )) . " " . @@ -104,7 +106,10 @@ class LanguageBr extends LanguageUtf8 { return $d; } - function timeanddate( $ts, $adj = false ) { + /** + * $format and $timecorrection are for compatibility with Language::date + */ + function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) { return $this->date( $ts, $adj ) . " da " . $this->time( $ts, $adj ); } diff --git a/languages/LanguageCy.php b/languages/LanguageCy.php index 840248c7a6..543b5e6ad5 100644 --- a/languages/LanguageCy.php +++ b/languages/LanguageCy.php @@ -127,7 +127,7 @@ class LanguageCy extends LanguageUtf8 { return $wgAllMessagesCy; } - function getMagicWords() { + function &getMagicWords() { global $wgMagicWordsCy, $wgMagicWordsEn; return $wgMagicWordsCy + $wgMagicWordsEn; } diff --git a/languages/LanguageDa.php b/languages/LanguageDa.php index 26391067e5..ae7d2f6f66 100644 --- a/languages/LanguageDa.php +++ b/languages/LanguageDa.php @@ -80,7 +80,10 @@ class LanguageDa extends LanguageUtf8 { return $wgDateFormatsDa; } - function date( $ts, $adj = false ) { + /** + * $format and $timecorrection are for compatibility with Language::date + */ + function date( $ts, $adj = false, $format = true, $timecorrection = false ) { if ( $adj ) { $ts = $this->userAdjust( $ts ); } $d = (0 + substr( $ts, 6, 2 )) . ". " . @@ -89,7 +92,10 @@ class LanguageDa extends LanguageUtf8 { return $d; } - function timeanddate( $ts, $adj = false ) { + /** + * $format and $timecorrection are for compatibility with Language::date + */ + function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) { return $this->date( $ts, $adj ) . " kl. " . $this->time( $ts, $adj ); } diff --git a/languages/LanguageHu.php b/languages/LanguageHu.php index 277998d71b..8500102dc6 100644 --- a/languages/LanguageHu.php +++ b/languages/LanguageHu.php @@ -109,8 +109,10 @@ class LanguageHu extends LanguageUtf8 { return "iso8859-2"; } - # localised date and time - function date( $ts, $adj = false ) { + /** + * $format and $timecorrection are for compatibility with Language::date + */ + function date( $ts, $adj = false, $format = true, $timecorrection = false ) { if ( $adj ) { $ts = $this->userAdjust( $ts ); } $d = substr( $ts, 0, 4 ) . ". " . @@ -119,7 +121,10 @@ class LanguageHu extends LanguageUtf8 { return $d; } - function timeanddate( $ts, $adj = false ) { + /** + * $format and $timecorrection are for compatibility with Language::date + */ + function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) { return $this->date( $ts, $adj ) . ", " . $this->time( $ts, $adj ); } diff --git a/languages/LanguageIs.php b/languages/LanguageIs.php index 97c5aa36f8..4b958fd720 100644 --- a/languages/LanguageIs.php +++ b/languages/LanguageIs.php @@ -103,7 +103,10 @@ class LanguageIs extends LanguageUtf8 { return $this->mMessagesIs; } - function date( $ts, $adj = false, $format = true) { + /** + * $timecorrection is for compatibility with Language::date + */ + function date( $ts, $adj = false, $format = true, $timecorrection = false ) { if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting. $format = $this->dateFormat($format); @@ -123,7 +126,10 @@ class LanguageIs extends LanguageUtf8 { } - function time($ts, $adj = false, $format = true) { + /** + * $timecorrection is for compatibility with language::time + */ + function time($ts, $adj = false, $format = true, $timecorrection = false) { global $wgUser; if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting. @@ -137,7 +143,10 @@ class LanguageIs extends LanguageUtf8 { } - function timeanddate( $ts, $adj = false, $format = true) { + /** + * $timecorrection is for compatibility with Language::date + */ + function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) { global $wgUser; $format = $this->dateFormat($format); diff --git a/languages/LanguageKo.php b/languages/LanguageKo.php index d1a64b93e1..9d55598a8c 100644 --- a/languages/LanguageKo.php +++ b/languages/LanguageKo.php @@ -101,7 +101,10 @@ class LanguageKo extends LanguageUtf8 { return $this->mMessagesKo; } - function date( $ts, $adj = false ) { + /** + * $format and $timecorrection are for compatibility with Language::date + */ + function date( $ts, $adj = false, $format = true, $timecorrection = false ) { if ( $adj ) { $ts = $this->userAdjust( $ts ); } $year = (int)substr( $ts, 0, 4 ); diff --git a/languages/LanguageNn.php b/languages/LanguageNn.php index 78229ecd6a..1ef973b7d0 100644 --- a/languages/LanguageNn.php +++ b/languages/LanguageNn.php @@ -171,7 +171,10 @@ class LanguageNn extends LanguageUtf8 { } - function time($ts, $adj = false, $format = true) { + /** + * $timecorrection is for compatibility with language::time + */ + function time($ts, $adj = false, $format = true, $timecorrection = false) { if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting. $format = $this->dateFormat($format); @@ -184,7 +187,10 @@ class LanguageNn extends LanguageUtf8 { } - function date( $ts, $adj = false, $format = true) { + /** + * $timecorrection is for compatibility with Language::date + */ + function date( $ts, $adj = false, $format = true, $timecorrection = false ) { global $wgUser; if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting. $format = $this->dateFormat($format); @@ -205,7 +211,10 @@ class LanguageNn extends LanguageUtf8 { } - function timeanddate( $ts, $adj = false, $format = true) { + /** + * $format and $timecorrection are for compatibility with Language::date + */ + function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) { global $wgUser; $format = $this->dateFormat($format); diff --git a/languages/LanguagePt.php b/languages/LanguagePt.php index 47f8f95fa8..ecd47eb55f 100644 --- a/languages/LanguagePt.php +++ b/languages/LanguagePt.php @@ -194,7 +194,7 @@ class LanguagePt extends LanguageUtf8 { * Exports $wgMagicWordsPt * @return array */ - function getMagicWords() { + function &getMagicWords() { global $wgMagicWordsPt; return $wgMagicWordsPt; } diff --git a/languages/LanguageRu.php b/languages/LanguageRu.php index 4b1b385fb8..204163923f 100644 --- a/languages/LanguageRu.php +++ b/languages/LanguageRu.php @@ -154,7 +154,7 @@ class LanguageRu extends LanguageUtf8 { //only for quotation mark function linkPrefixExtension() { return true; } - function getMagicWords() { + function &getMagicWords() { global $wgMagicWordsRu; return $wgMagicWordsRu; } diff --git a/languages/LanguageSr.php b/languages/LanguageSr.php index ffbb678476..2eede4b632 100644 --- a/languages/LanguageSr.php +++ b/languages/LanguageSr.php @@ -66,7 +66,7 @@ class SrConverter extends LanguageConverter { /* rules should be defined as -{ekavian | iyekavian-} -or- -{code:text | code:text | ...}- */ - function parseManualRule($rule, $flags) { + function parseManualRule($rule, $flags=array()) { $echoices = preg_split("/(<[^>]+>)/",$rule,-1,PREG_SPLIT_DELIM_CAPTURE); $choices = array(); diff --git a/languages/LanguageSr_ec.php b/languages/LanguageSr_ec.php index bacca1b469..fea3c2b502 100644 --- a/languages/LanguageSr_ec.php +++ b/languages/LanguageSr_ec.php @@ -157,7 +157,7 @@ class LanguageSr_ec extends LanguageUtf8 { * Exports $wgMagicWordsSr_ec * @return array */ - function getMagicWords() { + function &getMagicWords() { global $wgMagicWordsSr_ec; return $wgMagicWordsSr_ec; } diff --git a/languages/LanguageSr_el.php b/languages/LanguageSr_el.php index 2c56bd88d2..8251573048 100644 --- a/languages/LanguageSr_el.php +++ b/languages/LanguageSr_el.php @@ -157,7 +157,7 @@ class LanguageSr_el extends LanguageUtf8 { * Exports $wgMagicWordsSr_el * @return array */ - function getMagicWords() { + function &getMagicWords() { global $wgMagicWordsSr_el; return $wgMagicWordsSr_el; } diff --git a/languages/LanguageTt.php b/languages/LanguageTt.php index 80eec2abfb..eb049fbff8 100644 --- a/languages/LanguageTt.php +++ b/languages/LanguageTt.php @@ -90,8 +90,10 @@ class LanguageTt extends LanguageUtf8 { return $wgDateFormatsTt; } - - function date( $ts, $adj = false ) { + /** + * $format and $timecorrection are for compatibility with Language::date + */ + function date( $ts, $adj = false, $format = true, $timecorrection = false ) { if ( $adj ) { $ts = $this->userAdjust( $ts ); } $d = (0 + substr( $ts, 6, 2 )) . ". " . @@ -100,14 +102,20 @@ class LanguageTt extends LanguageUtf8 { return $d; } - function time( $ts, $adj = false ) { + /** + * $format and $timecorrection are for compatibility with language::time + */ + function time($ts, $adj = false, $format = true, $timecorrection = false) { if ( $adj ) { $ts = $this->userAdjust( $ts ); } $t = substr( $ts, 8, 2 ) . ":" . substr( $ts, 10, 2 ); return $t; } - function timeanddate( $ts, $adj = false ) { + /** + * $format and $timecorrection are for compatibility with Language::date + */ + function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) { return $this->date( $ts, $adj ) . ", " . $this->time( $ts, $adj ); } diff --git a/languages/LanguageZh_cn.php b/languages/LanguageZh_cn.php index df008d7bb9..c5a163620d 100644 --- a/languages/LanguageZh_cn.php +++ b/languages/LanguageZh_cn.php @@ -95,7 +95,10 @@ class LanguageZh_cn extends LanguageUtf8 { return false; } - function date( $ts, $adj = false ) { + /** + * $format and $timecorrection are for compatibility with Language::date + */ + function date( $ts, $adj = false, $format = true, $timecorrection = false ) { if ( $adj ) { $ts = $this->userAdjust( $ts ); } $d = substr( $ts, 0, 4 ) . "å¹´" . @@ -104,7 +107,10 @@ class LanguageZh_cn extends LanguageUtf8 { return $d; } - function timeanddate( $ts, $adj = false ) { + /** + * $format and $timecorrection are for compatibility with Language::date + */ + function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) { return $this->time( $ts, $adj ) . " " . $this->date( $ts, $adj ); } -- 2.20.1