From 19f50a04554575dca0f61e8430993a27edd77a85 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 8 Nov 2005 00:57:09 +0000 Subject: [PATCH] * (bug 3817) Use localized date formats in preferences; 'no preference' option localizable as 'datedefault' message. Tweaked lots of languages files... --- RELEASE-NOTES | 3 + includes/SpecialPreferences.php | 8 ++- languages/Language.php | 100 ++++++++++++++++++++++++++------ languages/LanguageBe.php | 34 ++++++----- languages/LanguageCa.php | 28 +-------- languages/LanguageCs.php | 14 ++--- languages/LanguageDe.php | 16 +++-- languages/LanguageEo.php | 14 ++--- languages/LanguageEs.php | 32 +++------- languages/LanguageEt.php | 1 + languages/LanguageFi.php | 1 + languages/LanguageFr.php | 18 ++---- languages/LanguageFy.php | 1 + languages/LanguageGa.php | 1 + languages/LanguageIa.php | 13 ----- languages/LanguageIs.php | 1 + languages/LanguageIt.php | 11 +--- languages/LanguageJa.php | 1 + languages/LanguageKo.php | 4 ++ languages/LanguageLa.php | 13 ----- languages/LanguageLi.php | 23 ++++---- languages/LanguageNds.php | 14 ++--- languages/LanguageNl.php | 21 ++++--- languages/LanguageNn.php | 1 + languages/LanguageNo.php | 34 +++++------ languages/LanguageOc.php | 19 +++--- languages/LanguagePl.php | 11 +--- languages/LanguagePt.php | 1 + languages/LanguageSc.php | 9 +-- languages/LanguageSk.php | 1 + languages/LanguageSr.php | 1 + languages/LanguageSv.php | 27 ++++----- languages/LanguageTr.php | 1 + languages/LanguageVi.php | 1 + languages/LanguageZh_cn.php | 4 ++ 35 files changed, 234 insertions(+), 248 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index dfa0091a05..a5e1582cb5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -210,6 +210,9 @@ fully support the editing toolbar, but was found to be too confusing. * Allow $wgFeedCacheTimeout of 0 to disable feed caching * Fix WebRequest::getRequestURL() to strip off the host bits squid prepends * Require POST for action=purge, to stop bots from purging the cache +* (bug 3817) Use localized date formats in preferences; 'no preference' option + localizable as 'datedefault' message. Tweaked lots of languages files... + === Caveats === diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index 838e43e57d..77e7a2b099 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -745,10 +745,16 @@ class PreferencesForm { if ($dateopts) { $wgOut->addHTML( "
\n" . wfMsg( 'dateformat' ) . "\n" ); $idCnt = 0; + $epoch = '20010115161234'; foreach($dateopts as $key => $option) { + if( $key == MW_DATE_DEFAULT ) { + $formatted = wfMsgHtml( 'datedefault' ); + } else { + $formatted = htmlspecialchars( $wgLang->timeanddate( $epoch, false, $key ) ); + } ($key == $this->mDate) ? $checked = ' checked="checked"' : $checked = ''; $wgOut->addHTML( "
\n" ); + "value=\"$key\"$checked /> \n" ); $idCnt++; } $wgOut->addHTML( "
\n" ); diff --git a/languages/Language.php b/languages/Language.php index 7ec46697b9..3343e9f223 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -108,12 +108,22 @@ if(isset($wgExtraNamespaces)) { MW_MATH_MATHML => 'mw_math_mathml' ); -# Whether to use user or default setting in Language::date() - -/* private */ $wgDateFormatsEn = array( +/** + * Whether to use user or default setting in Language::date() + * + * NOTE: the array string values are no longer important! + * The actual date format functions are now called for the selection in + * Special:Preferences, and the 'datedefault' message for MW_DATE_DEFAULT. + * + * The array keys make up the set of formats which this language allows + * the user to select. It's exposed via Language::getDateFormats(). + * + * @access private + */ +$wgDateFormatsEn = array( MW_DATE_DEFAULT => 'No preference', - MW_DATE_MDY => '16:12, January 15, 2001', MW_DATE_DMY => '16:12, 15 January 2001', + MW_DATE_MDY => '16:12, January 15, 2001', MW_DATE_YMD => '16:12, 2001 January 15', MW_DATE_ISO => '2001-01-15 16:12:34' ); @@ -873,6 +883,7 @@ $2 List redirects   Search for $3 $9", 'skin' => 'Skin', 'math' => 'Math', 'dateformat' => 'Date format', +'datedefault' => 'No preference', 'datetime' => 'Date and time', 'math_failure' => 'Failed to parse', 'math_unknown_error' => 'unknown error', @@ -2467,17 +2478,23 @@ class Language { * [...] * * - * @param bool $usePrefs: if false, the site/language default is used + * @param mixed $usePrefs: if true, the user's preference is used + * if false, the site/language default is used + * if int/string, assumed to be a format. * @return string */ function dateFormat( $usePrefs = true ) { global $wgUser, $wgAmericanDates; - if( $usePrefs ) { - $datePreference = $wgUser->getOption( 'date' ); + if( is_bool( $usePrefs ) ) { + if( $usePrefs ) { + $datePreference = $wgUser->getOption( 'date' ); + } else { + $options = $this->getDefaultUserOptions(); + $datePreference = (string)$options['date']; + } } else { - $options = $this->getDefaultUserOptions(); - $datePreference = (string)$options['date']; + $datePreference = (string)$usePrefs; } if( $datePreference == MW_DATE_DEFAULT || $datePreference == '' ) { @@ -2492,7 +2509,7 @@ class Language { * date('YmdHis') format with wfTimestamp(TS_MW,$ts) * @param bool $adj whether to adjust the time output according to the * user configured offset ($timecorrection) - * @param bool $format true to use user's date format preference + * @param mixed $format true to use user's date format preference * @param string $timecorrection the time offset as returned by * validateTimeZone() in Special:Preferences * @return string @@ -2504,8 +2521,8 @@ class Language { $datePreference = $this->dateFormat( $format ); - $month = $this->getMonthName( substr( $ts, 4, 2 ) ); - $day = $this->formatNum( 0 + substr( $ts, 6, 2 ) ); + $month = $this->formatMonth( substr( $ts, 4, 2 ), $datePreference ); + $day = $this->formatDay( substr( $ts, 6, 2 ), $datePreference ); $year = $this->formatNum( substr( $ts, 0, 4 ), true ); switch( $datePreference ) { @@ -2522,7 +2539,7 @@ class Language { * date('YmdHis') format with wfTimestamp(TS_MW,$ts) * @param bool $adj whether to adjust the time output according to the * user configured offset ($timecorrection) - * @param bool $format true to use user's date format preference + * @param mixed $format true to use user's date format preference * @param string $timecorrection the time offset as returned by * validateTimeZone() in Special:Preferences * @return string @@ -2532,14 +2549,54 @@ class Language { if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); } $datePreference = $this->dateFormat( $format ); - - $t = substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 ); + + $sep = ($datePreference == MW_DATE_ISO) + ? ':' + : $this->timeSeparator( $format ); + + $t = substr( $ts, 8, 2 ) . $sep . substr( $ts, 10, 2 ); if ( $datePreference == MW_DATE_ISO ) { - $t .= ':' . substr( $ts, 12, 2 ); + $t .= $sep . substr( $ts, 12, 2 ); } return $this->formatNum( $t ); } + + /** + * Default separator character between hours, minutes, and seconds. + * Will be used by Language::time() for non-ISO formats. + * (ISO will always use a colon.) + * @return string + */ + function timeSeparator( $format ) { + return ':'; + } + + /** + * String to insert between the time and the date in a combined + * string. Should include any relevant whitespace. + * @return string + */ + function timeDateSeparator( $format ) { + return ', '; + } + + /** + * Return true if the time should display before the date. + * @return bool + * @access private + */ + function timeBeforeDate() { + return true; + } + + function formatMonth( $month, $format ) { + return $this->getMonthName( $month ); + } + + function formatDay( $day, $format ) { + return $this->formatNum( 0 + $day ); + } /** * @access public @@ -2547,7 +2604,7 @@ class Language { * date('YmdHis') format with wfTimestamp(TS_MW,$ts) * @param bool $adj whether to adjust the time output according to the * user configured offset ($timecorrection) - * @param bool $format true to use user's date format preference + * @param mixed $format true to use user's date format preference * @param string $timecorrection the time offset as returned by * validateTimeZone() in Special:Preferences * @return string @@ -2559,8 +2616,13 @@ class Language { switch ( $datePreference ) { case MW_DATE_ISO: return $this->date( $ts, $adj, $format, $timecorrection ) . ' ' . $this->time( $ts, $adj, $format, $timecorrection ); - default: return $this->time( $ts, $adj, $format, $timecorrection ) . ', ' . - $this->date( $ts, $adj, $format, $timecorrection ); + default: + $time = $this->time( $ts, $adj, $format, $timecorrection ); + $sep = $this->timeDateSeparator( $datePreference ); + $date = $this->date( $ts, $adj, $format, $timecorrection ); + return $this->timeBeforeDate( $datePreference ) + ? $time . $sep . $date + : $date . $sep . $time; } } diff --git a/languages/LanguageBe.php b/languages/LanguageBe.php index 53092a87a2..c242e4821b 100644 --- a/languages/LanguageBe.php +++ b/languages/LanguageBe.php @@ -553,24 +553,26 @@ class LanguageBe extends LanguageUtf8 { global $wgMagicWordsBe; return $wgMagicWordsBe; } - - // The date and time format - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting. - // 20050310001506 => 10.03.2005 - $date = (substr( $ts, 6, 2 )) . '.' . substr( $ts, 4, 2 ) . '.' . substr( $ts, 0, 4 ); - return $date; - } - - function time( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - // 20050310001506 => 00:15 - $time = substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 ); - return $time; + + function getDateFormats() { + return $wgDateFormatsBe = array( + MW_DATE_DEFAULT => MW_DATE_DEFAULT, + '16:12, 15.01.2001' => '16:12, 15.01.2001', + MW_DATE_ISO => MW_DATE_ISO + ); } - function timeanddate( $ts, $adj = false ) { - return $this->time( $ts, $adj ) . ', ' .$this->date( $ts, $adj ); + // The date and time format + function date( $ts, $adj = false, $format = true, $timecorrection = false ) { + $datePreference = $this->dateFormat( $format ); + if( $datePreference == MW_DATE_ISO ) { + return parent::date( $ts, $adj, $datePreference, $timecorrection ); + } else { + if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); } # Adjust based on the timezone setting. + // 20050310001506 => 10.03.2005 + $date = (substr( $ts, 6, 2 )) . '.' . substr( $ts, 4, 2 ) . '.' . substr( $ts, 0, 4 ); + return $date; + } } function getMessage( $key ) { diff --git a/languages/LanguageCa.php b/languages/LanguageCa.php index 6b6c931071..a4182abb79 100644 --- a/languages/LanguageCa.php +++ b/languages/LanguageCa.php @@ -820,32 +820,8 @@ class LanguageCa extends LanguageUtf8 { return $wgSkinNamesCa; } - - function shortdate( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . " " .$this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . ", " . - substr( $ts, 0, 4 ); - return $d; - } - - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . " de " .$this->getMonthName( substr( $ts, 4, 2 ) ) . ", " . - substr( $ts, 0, 4 ); - return $d; - } - - function time( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $t = substr( $ts, 8, 2 ) . ":" . substr( $ts, 10, 2 ); - return $t; - } - - function timeanddate( $ts, $adj = false ) { - return $this->time( $ts, $adj ) . " " . $this->shortdate( $ts, $adj ); + function formatMonth( $month, $format ) { + return $this->getMonthAbbreviation( $month ); } function getMessage( $key ) { diff --git a/languages/LanguageCs.php b/languages/LanguageCs.php index f51a4f44f4..761bfc6e28 100644 --- a/languages/LanguageCs.php +++ b/languages/LanguageCs.php @@ -1831,14 +1831,12 @@ class LanguageCs extends LanguageUtf8 { # Datové a časové funkce možno upřesnit podle jazyka # TODO: Umožnit nastavování formátu data a času. - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . '. ' . - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . - ' ' . - substr( $ts, 0, 4 ); - return $d; + function formatMonth( $month, $format ) { + return intval( $month ) . '.'; + } + + function formatDay( $day, $format ) { + return intval( $day ) . '.'; } function getMessage( $key ) { diff --git a/languages/LanguageDe.php b/languages/LanguageDe.php index 5438d08e71..d2d0a2d76f 100644 --- a/languages/LanguageDe.php +++ b/languages/LanguageDe.php @@ -1247,15 +1247,13 @@ class LanguageDe extends LanguageUtf8 { global $wgSkinNamesDe; return $wgSkinNamesDe; } - - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . ". " . - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . - " " . - substr( $ts, 0, 4 ); - return $d; + + function formatMonth( $month, $format ) { + return $this->getMonthAbbreviation( $month ); + } + + function formatDay( $day, $format ) { + return parent::formatDay( $day, $format ) . '.'; } function getMessage( $key ) { diff --git a/languages/LanguageEo.php b/languages/LanguageEo.php index ff0c71363e..443d245598 100644 --- a/languages/LanguageEo.php +++ b/languages/LanguageEo.php @@ -924,14 +924,12 @@ class LanguageEo extends LanguageUtf8 { } # La dato- kaj tempo-funkciojn oni povas precizigi laÅ­ lingvo - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . '. ' . - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . - ' ' . - substr( $ts, 0, 4 ); - return $d; + function formatMonth( $month, $format ) { + return $this->getMonthAbbreviation( $month ); + } + + function formatDay( $day, $format ) { + return parent::formatDay( $day, $format ) . '.'; } function getMessage( $key ) { diff --git a/languages/LanguageEs.php b/languages/LanguageEs.php index 782c54eafa..55949eb2b7 100644 --- a/languages/LanguageEs.php +++ b/languages/LanguageEs.php @@ -1044,33 +1044,15 @@ class LanguageEs extends LanguageUtf8 { global $wgSkinNamesEs; return $wgSkinNamesEs; } - - function shortdate( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . " " .$this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . ", " . - substr( $ts, 0, 4 ); - return $d; - } - - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . " de " .$this->getMonthName( substr( $ts, 4, 2 ) ) . ", " . - substr( $ts, 0, 4 ); - return $d; + + function formatMonth( $month, $format ) { + return $this->getMonthAbbreviation( $month ); } - - function time( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $t = substr( $ts, 8, 2 ) . ":" . substr( $ts, 10, 2 ); - return $t; - } - - function timeanddate( $ts, $adj = false ) { - return $this->time( $ts, $adj ) . " " . $this->shortdate( $ts, $adj ); + + function timeDateSeparator( $format ) { + return ' '; } + function getMessage( $key ) { global $wgAllMessagesEs; diff --git a/languages/LanguageEt.php b/languages/LanguageEt.php index 057a698e76..30031f5752 100644 --- a/languages/LanguageEt.php +++ b/languages/LanguageEt.php @@ -570,6 +570,7 @@ Teie sisemine ID-number on $2.", "skin" => "Nahk", "math" => "Valemite näitamine", "dateformat" => "Kuupäeva formaat", +'datedefault' => 'Eelistus puudub', "math_failure" => "Arusaamatu süntaks", "math_unknown_error" => "Tundmatu viga", "math_unknown_function" => "Tundmatu funktsioon ", diff --git a/languages/LanguageFi.php b/languages/LanguageFi.php index 2026a0962f..453771cf3d 100644 --- a/languages/LanguageFi.php +++ b/languages/LanguageFi.php @@ -558,6 +558,7 @@ Sivun lähdekoodi:', 'skin' => 'Ulkonäkö', 'math' => 'Matematiikka', 'dateformat' => 'Päiväyksen muoto', +'datedefault' => 'Ei valintaa', 'datetime' => 'Aika ja päiväys', 'math_failure' => 'Jäsentäminen epäonnistui', 'math_unknown_error' => 'Tuntematon virhe', diff --git a/languages/LanguageFr.php b/languages/LanguageFr.php index 367ef964e2..bd974d836d 100644 --- a/languages/LanguageFr.php +++ b/languages/LanguageFr.php @@ -45,7 +45,6 @@ require_once( 'LanguageUtf8.php' ); 'chapitre.com' => 'http://www.chapitre.com/frame_rec.asp?isbn=$1', ); - /* private */ $wgAllMessagesFr = array( # User Toggles @@ -1209,18 +1208,13 @@ class LanguageFr extends LanguageUtf8 { global $wgSkinNamesFr; return $wgSkinNamesFr; } - - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . ' ' . - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . - ' ' . substr( $ts, 0, 4 ); - return $d; + + function timeBeforeDate( $format ) { + return false; } - - function timeanddate( $ts, $adj = false ) { - return $this->date( $ts, $adj ) . ' à ' . $this->time( $ts, $adj ); + + function timeDateSeparator( $format ) { + return " à "; } var $digitTransTable = array( diff --git a/languages/LanguageFy.php b/languages/LanguageFy.php index 1a488b09d5..88ee93d355 100644 --- a/languages/LanguageFy.php +++ b/languages/LanguageFy.php @@ -440,6 +440,7 @@ Jo Wiki-nûmer is $2. "skin" => "Side-oansjen", "math" => "Formules", "dateformat" => "Datum", +'datedefault' => 'Gjin foarkar', "math_failure" => "Untsjutbere formule", "math_unknown_error" => "Unbekinde fout", "math_unknown_function" => "Unbekinde funksje", diff --git a/languages/LanguageGa.php b/languages/LanguageGa.php index c2dbb8662c..07210ad25f 100755 --- a/languages/LanguageGa.php +++ b/languages/LanguageGa.php @@ -745,6 +745,7 @@ Féach ar [[{{ns:4}}:Cabhair do sainroghanna úsáideora]] chun cabhair a fháil "skin" => "Craiceann", "math" => "Ag aistriú na matamaitice", "dateformat" => "Formáid dáta", +'datedefault' => 'Is cuma liom', "math_failure" => "Theip anailís an fhoirmle", "math_unknown_error" => "earráid anaithnid", "math_unknown_function" => "foirmle anaithnid ", diff --git a/languages/LanguageIa.php b/languages/LanguageIa.php index 19f5ddeb00..a76789beb0 100644 --- a/languages/LanguageIa.php +++ b/languages/LanguageIa.php @@ -858,19 +858,6 @@ class LanguageIa extends LanguageUtf8 { return $wgSkinNamesIa; } - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . - " " . (0 + substr( $ts, 6, 2 )) . ", " . - substr( $ts, 0, 4 ); - return $d; - } - - function timeanddate( $ts, $adj = false ) { - return $this->time( $ts, $adj ) . " " . $this->date( $ts, $adj ); - } - function getMessage( $key ) { global $wgAllMessagesIa, $wgAllMessagesEn; $m = $wgAllMessagesIa[$key]; diff --git a/languages/LanguageIs.php b/languages/LanguageIs.php index 1711840158..8903a3a59f 100644 --- a/languages/LanguageIs.php +++ b/languages/LanguageIs.php @@ -216,6 +216,7 @@ the list of currently operational bans and blocks.", 'currentrevisionlink' => "núverandi útgáfa", 'databaseerror' => "Gagnagrunnsvilla", 'dateformat' => "Tímasnið", +'datedefault' => 'Sjálfgefið', 'deadendpages' => "Botnlangar", 'debug' => "Aflúsa", 'dec' => "des", diff --git a/languages/LanguageIt.php b/languages/LanguageIt.php index 91520c3d90..bfa1a91903 100644 --- a/languages/LanguageIt.php +++ b/languages/LanguageIt.php @@ -716,14 +716,9 @@ class LanguageIt extends LanguageUtf8 { global $wgQuickbarSettingsIt; return $wgQuickbarSettingsIt; } - - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . - " " . (0 + substr( $ts, 6, 2 )) . ", " . - substr( $ts, 0, 4 ); - return $d; + + function formatMonth( $month, $format ) { + return $this->getMonthAbbreviation( $month ); } function getMessage( $key ) { diff --git a/languages/LanguageJa.php b/languages/LanguageJa.php index 8454085d98..3a81a6c39c 100644 --- a/languages/LanguageJa.php +++ b/languages/LanguageJa.php @@ -597,6 +597,7 @@ $2リダイレクトを含める       $3 $9', 'skin' => '外装', 'math' => '数式の表記方法', 'dateformat' => '日付の書式', +'datedefault' => '2001å¹´1月15日 16:12 (デフォルト)', 'math_failure' => '構文解析失敗', 'math_unknown_error' => '不明なエラー', 'math_unknown_function' => '不明な関数', diff --git a/languages/LanguageKo.php b/languages/LanguageKo.php index b8370f8521..63bab9286c 100644 --- a/languages/LanguageKo.php +++ b/languages/LanguageKo.php @@ -645,6 +645,10 @@ class LanguageKo extends LanguageUtf8 { global $wgSkinNamesKo; return $wgSkinNamesKo; } + + function getDateFormats() { + return false; + } function date( $ts, $adj = false ) { global $wgWeekdayAbbreviationsKo; diff --git a/languages/LanguageLa.php b/languages/LanguageLa.php index 3dbf45aa02..90b3866c1c 100644 --- a/languages/LanguageLa.php +++ b/languages/LanguageLa.php @@ -137,19 +137,6 @@ class LanguageLa extends LanguageUtf8 { return $wgSkinNamesLa; } - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . - " " . (0 + substr( $ts, 6, 2 )) . ", " . - substr( $ts, 0, 4 ); - return $d; - } - - function timeanddate( $ts, $adj = false ) { - return $this->time( $ts, $adj ) . " " . $this->date( $ts, $adj ); - } - function getMessage( $key ) { global $wgAllMessagesLa; if( isset( $wgAllMessagesLa[$key] ) ) { diff --git a/languages/LanguageLi.php b/languages/LanguageLi.php index 401c0086a7..d751fedc28 100644 --- a/languages/LanguageLi.php +++ b/languages/LanguageLi.php @@ -882,20 +882,19 @@ class LanguageLi extends LanguageUtf8 { global $wgSkinNamesLi; return $wgSkinNamesLi; } - - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . " " . - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . " " . - substr( $ts, 0, 4 ); - return $d; + + function timeBeforeDate( $format ) { + return false; } - - function timeanddate( $ts, $adj = false ) { - return $this->date( $ts, $adj ) . " " . $this->time( $ts, $adj ); + + function timeDateSeparator( $format ) { + return ' '; } - + + function formatMonth( $month, $format ) { + return $this->getMonthAbbreviation( $month ); + } + function getMessage( $key ) { global $wgAllMessagesLi; if( isset( $wgAllMessagesLi[$key] ) ) { diff --git a/languages/LanguageNds.php b/languages/LanguageNds.php index 48e2d80c20..50e988e990 100644 --- a/languages/LanguageNds.php +++ b/languages/LanguageNds.php @@ -1283,14 +1283,12 @@ class LanguageNds extends LanguageUtf8 { return $wgSkinNamesNds; } - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . '. ' . - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . - ' ' . - substr( $ts, 0, 4 ); - return $d; + function formatMonth( $month, $format ) { + return $this->getMonthAbbreviation( $month ); + } + + function formatDay( $day, $format ) { + return parent::formatDay( $day, $format ) . '.'; } function getMessage( $key ) { diff --git a/languages/LanguageNl.php b/languages/LanguageNl.php index 634ad44f8d..09a7cb70fb 100644 --- a/languages/LanguageNl.php +++ b/languages/LanguageNl.php @@ -767,19 +767,18 @@ class LanguageNl extends LanguageUtf8 { return $wgSkinNamesNl; } - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . " " . - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . " " . - substr( $ts, 0, 4 ); - return $d; + function timeBeforeDate( $format ) { + return false; } - - function timeanddate( $ts, $adj = false ) { - return $this->date( $ts, $adj ) . " " . $this->time( $ts, $adj ); + + function timeDateSeparator( $format ) { + return ' '; } - + + function formatMonth( $month, $format ) { + return $this->getMonthAbbreviation( $month ); + } + function getMessage( $key ) { global $wgAllMessagesNl; if( isset( $wgAllMessagesNl[$key] ) ) { diff --git a/languages/LanguageNn.php b/languages/LanguageNn.php index d8b5838937..e43f88f6c1 100644 --- a/languages/LanguageNn.php +++ b/languages/LanguageNn.php @@ -608,6 +608,7 @@ SjÃ¥ [[Help:Brukarinnstillingar|Hjelp]] for ei forklaring pÃ¥ dei ulike innstill 'skin' => 'Drakt', 'math' => 'Matematiske formlar', 'dateformat' => 'Datoformat', +'datedefault' => 'Standard', 'math_failure' => 'Klarte ikkje Ã¥ tolke formelen', 'math_unknown_error' => 'ukjend feil', 'math_unknown_function' => 'ukjend funksjon ', diff --git a/languages/LanguageNo.php b/languages/LanguageNo.php index 3a58c9362b..efffdd83a3 100644 --- a/languages/LanguageNo.php +++ b/languages/LanguageNo.php @@ -953,26 +953,24 @@ class LanguageNo extends LanguageUtf8 { global $wgSkinNamesNo; return $wgSkinNamesNo; } - - - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . ". " . - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . " " . - substr( $ts, 0, 4 ); - return $d; + + function formatMonth( $month, $format ) { + return $this->getMonthAbbreviation( $month ); } - - function time( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $t = substr( $ts, 8, 2 ) . ":" . substr( $ts, 10, 2 ); - return $t; + + function formatDay( $day, $format ) { + return parent::formatDay( $day, $format ) . '.'; } - - function timeanddate( $ts, $adj = false ) { - return $this->date( $ts, $adj ) . " kl." . $this->time( $ts, $adj ); + + function timeanddate( $ts, $adj = false, $format = false, $timecorrection = false ) { + $format = $this->dateFormat( $format ); + if( $format == MW_DATE_ISO ) { + return parent::timeanddate( $ts, $adj, $format, $timecorrection ); + } else { + return $this->date( $ts, $adj, $format, $timecorrection ) . + " kl." . + $this->time( $ts, $adj, $format, $timecorrection ); + } } function formatNum( $number ) { diff --git a/languages/LanguageOc.php b/languages/LanguageOc.php index 06c06addac..3926352df1 100644 --- a/languages/LanguageOc.php +++ b/languages/LanguageOc.php @@ -844,17 +844,16 @@ class LanguageOc extends LanguageUtf8{ return $wgSkinNamesOc; } - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . " " . - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . - " " . substr( $ts, 0, 4 ); - return $d; + function formatMonth( $month, $format ) { + return $this->getMonthAbbreviation( $month ); } - - function timeanddate( $ts, $adj = false ) { - return $this->date( $ts, $adj ) . " à " . $this->time( $ts, $adj ); + + function timeBeforeDate( $format ) { + return false; + } + + function timeDateSeparator( $format ) { + return " à "; } function getMessage( $key ) { diff --git a/languages/LanguagePl.php b/languages/LanguagePl.php index fab2111c22..ba1f6d9a8a 100644 --- a/languages/LanguagePl.php +++ b/languages/LanguagePl.php @@ -972,14 +972,9 @@ class LanguagePl extends LanguageUtf8 { global $wgMonthNamesGenEn; return wfMsg( $wgMonthNamesGenEn[$key-1] ); } - - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . - " " . $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . - " " . substr( $ts, 0, 4 ); - return $d; + + function formatMonth( $month, $format ) { + return $this->getMonthAbbreviation( $month ); } function getMessage( $key ) { diff --git a/languages/LanguagePt.php b/languages/LanguagePt.php index 763a9ec3bd..99cece8d97 100644 --- a/languages/LanguagePt.php +++ b/languages/LanguagePt.php @@ -763,6 +763,7 @@ Note que os índices do conteúdo da {{SITENAME}} destes sites podem estar desac 'skin' => 'Tema', 'math' => 'Matemática', 'dateformat' => 'Formato da data', +'datedefault' => 'Sem preferência', 'datetime' => 'Data e hora', 'math_failure' => 'Falhou ao verificar gramática', 'math_unknown_error' => 'Erro desconhecido', diff --git a/languages/LanguageSc.php b/languages/LanguageSc.php index d59afa6c29..a92c2b498c 100644 --- a/languages/LanguageSc.php +++ b/languages/LanguageSc.php @@ -705,13 +705,8 @@ class LanguageSc extends LanguageUtf8 { return $wgQuickbarSettingsSc; } - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . - " " . (0 + substr( $ts, 6, 2 )) . ", " . - substr( $ts, 0, 4 ); - return $d; + function formatMonth( $month, $format ) { + return $this->getMonthAbbreviation( $month ); } function getMessage( $key ) { diff --git a/languages/LanguageSk.php b/languages/LanguageSk.php index 98fe71def5..8eceb6a32f 100644 --- a/languages/LanguageSk.php +++ b/languages/LanguageSk.php @@ -648,6 +648,7 @@ Pozri [[m:Help:Preferences|Nastavenia]] na vysvetlenie volieb.", 'skin' => 'Vzhľad', 'math' => 'Matematika', 'dateformat' => 'Formát dátumu', +'datedefault' => 'Default', 'math_failure' => 'Syntaktická analýza (parsing) neúspeÅ¡ná', 'math_unknown_error' => 'neznáma chyba', 'math_unknown_function' => 'neznáma funkcia ', diff --git a/languages/LanguageSr.php b/languages/LanguageSr.php index 4735509bdc..f2c178bf4f 100644 --- a/languages/LanguageSr.php +++ b/languages/LanguageSr.php @@ -330,6 +330,7 @@ $3 'data' => 'Подаци', 'databaseerror' => 'Грешка у бази', 'dateformat' => 'Формат датума', +'datedefault' => 'Није битно', 'dberrortext' => 'Десила се синтаксна грешка упита базе. Ово је могуће због илегалног упита, или могуће грешке у софтверу. diff --git a/languages/LanguageSv.php b/languages/LanguageSv.php index 2af84b1651..f646607a48 100644 --- a/languages/LanguageSv.php +++ b/languages/LanguageSv.php @@ -909,26 +909,21 @@ class LanguageSv extends LanguageUtf8 { return $wgSkinNamesSv; } - function date( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $d = (0 + substr( $ts, 6, 2 )) . " " . - $this->getMonthName( substr( $ts, 4, 2 ) ) . " " . - substr( $ts, 0, 4 ); - return $d; - } - // "." is used as the character to separate the // hours from the minutes in the date output - function time( $ts, $adj = false ) { - if ( $adj ) { $ts = $this->userAdjust( $ts ); } - - $t = substr( $ts, 8, 2 ) . "." . substr( $ts, 10, 2 ); - return $t; + function timeSeparator() { + return '.'; } - function timeanddate( $ts, $adj = false ) { - return $this->date( $ts, $adj ) . " kl." . $this->time( $ts, $adj ); + function timeanddate( $ts, $adj = false, $format = false, $timecorrection = false ) { + $format = $this->dateFormat( $format ); + if( $format == MW_DATE_ISO ) { + return parent::timeanddate( $ts, $adj, $format, $timecorrection ); + } else { + return $this->date( $ts, $adj, $format, $timecorrection ) . + " kl." . + $this->time( $ts, $adj, $format, $timecorrection ); + } } function getMessage( $key ) { diff --git a/languages/LanguageTr.php b/languages/LanguageTr.php index 85b295af9d..c9358fb4a6 100644 --- a/languages/LanguageTr.php +++ b/languages/LanguageTr.php @@ -449,6 +449,7 @@ Ayrıca, buraya katkıda bulunarak, bu katkının kendiniz tarafından yazıldı 'currentrev' => 'Güncel sürüm', 'currentrevisionlink' => 'en güncel halini göster', 'dateformat' => 'Tarih gösterimi', +'datedefault' => 'Tercih yok', 'datetime' => 'Tarih ve saat', 'deadendpages' => 'Başka sayfalara bağlantısı olmayan sayfalar', 'default' => 'orjinal', diff --git a/languages/LanguageVi.php b/languages/LanguageVi.php index e603249aaa..6895f2fb60 100644 --- a/languages/LanguageVi.php +++ b/languages/LanguageVi.php @@ -557,6 +557,7 @@ Xem thêm [[{{ns:4}}:Trợ giúp cho Lá»±a chọn cá nhân]].", 'skin' => 'Ngoại hình', 'math' => 'Công thức toán', 'dateformat' => 'Ngày tháng', +'datedefault' => 'Không lá»±a chọn', 'math_failure' => 'Lỗi toán', 'math_unknown_error' => 'lỗi chÆ°a rõ', 'math_unknown_function' => 'hàm chÆ°a rõ', diff --git a/languages/LanguageZh_cn.php b/languages/LanguageZh_cn.php index 03c148f747..561190a2c9 100644 --- a/languages/LanguageZh_cn.php +++ b/languages/LanguageZh_cn.php @@ -924,6 +924,10 @@ class LanguageZh_cn extends LanguageUtf8 { global $wgSkinNamesZh_cn; return $wgSkinNamesZh_cn; } + + function getDateFormats() { + return false; + } function date( $ts, $adj = false ) { if ( $adj ) { $ts = $this->userAdjust( $ts ); } -- 2.20.1