r11676 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11675‎ | r11676 | r11677 >
Date:00:57, 8 November 2005
Author:vibber
Status:old
Tags:
Comment:
* (bug 3817) Use localized date formats in preferences; 'no preference' option
localizable as 'datedefault' message. Tweaked lots of languages files...
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialPreferences.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)
  • /trunk/phase3/languages/LanguageBe.php (modified) (history)
  • /trunk/phase3/languages/LanguageCa.php (modified) (history)
  • /trunk/phase3/languages/LanguageCs.php (modified) (history)
  • /trunk/phase3/languages/LanguageDe.php (modified) (history)
  • /trunk/phase3/languages/LanguageEo.php (modified) (history)
  • /trunk/phase3/languages/LanguageEs.php (modified) (history)
  • /trunk/phase3/languages/LanguageEt.php (modified) (history)
  • /trunk/phase3/languages/LanguageFi.php (modified) (history)
  • /trunk/phase3/languages/LanguageFr.php (modified) (history)
  • /trunk/phase3/languages/LanguageFy.php (modified) (history)
  • /trunk/phase3/languages/LanguageGa.php (modified) (history)
  • /trunk/phase3/languages/LanguageIa.php (modified) (history)
  • /trunk/phase3/languages/LanguageIs.php (modified) (history)
  • /trunk/phase3/languages/LanguageIt.php (modified) (history)
  • /trunk/phase3/languages/LanguageJa.php (modified) (history)
  • /trunk/phase3/languages/LanguageKo.php (modified) (history)
  • /trunk/phase3/languages/LanguageLa.php (modified) (history)
  • /trunk/phase3/languages/LanguageLi.php (modified) (history)
  • /trunk/phase3/languages/LanguageNds.php (modified) (history)
  • /trunk/phase3/languages/LanguageNl.php (modified) (history)
  • /trunk/phase3/languages/LanguageNn.php (modified) (history)
  • /trunk/phase3/languages/LanguageNo.php (modified) (history)
  • /trunk/phase3/languages/LanguageOc.php (modified) (history)
  • /trunk/phase3/languages/LanguagePl.php (modified) (history)
  • /trunk/phase3/languages/LanguagePt.php (modified) (history)
  • /trunk/phase3/languages/LanguageSc.php (modified) (history)
  • /trunk/phase3/languages/LanguageSk.php (modified) (history)
  • /trunk/phase3/languages/LanguageSr.php (modified) (history)
  • /trunk/phase3/languages/LanguageSv.php (modified) (history)
  • /trunk/phase3/languages/LanguageTr.php (modified) (history)
  • /trunk/phase3/languages/LanguageVi.php (modified) (history)
  • /trunk/phase3/languages/LanguageZh_cn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialPreferences.php
@@ -745,10 +745,16 @@
746746 if ($dateopts) {
747747 $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsg( 'dateformat' ) . "</legend>\n" );
748748 $idCnt = 0;
 749+ $epoch = '20010115161234';
749750 foreach($dateopts as $key => $option) {
 751+ if( $key == MW_DATE_DEFAULT ) {
 752+ $formatted = wfMsgHtml( 'datedefault' );
 753+ } else {
 754+ $formatted = htmlspecialchars( $wgLang->timeanddate( $epoch, false, $key ) );
 755+ }
750756 ($key == $this->mDate) ? $checked = ' checked="checked"' : $checked = '';
751757 $wgOut->addHTML( "<div><input type='radio' name=\"wpDate\" id=\"wpDate$idCnt\" ".
752 - "value=\"$key\"$checked /> <label for=\"wpDate$idCnt\">$option</label></div>\n" );
 758+ "value=\"$key\"$checked /> <label for=\"wpDate$idCnt\">$formatted</label></div>\n" );
753759 $idCnt++;
754760 }
755761 $wgOut->addHTML( "</fieldset>\n" );
Index: trunk/phase3/RELEASE-NOTES
@@ -210,7 +210,10 @@
211211 * Allow $wgFeedCacheTimeout of 0 to disable feed caching
212212 * Fix WebRequest::getRequestURL() to strip off the host bits squid prepends
213213 * Require POST for action=purge, to stop bots from purging the cache
 214+* (bug 3817) Use localized date formats in preferences; 'no preference' option
 215+ localizable as 'datedefault' message. Tweaked lots of languages files...
214216
 217+
215218 === Caveats ===
216219
217220 Some output, particularly involving user-supplied inline HTML, may not
Index: trunk/phase3/languages/LanguageFi.php
@@ -558,6 +558,7 @@
559559 'skin' => 'Ulkonäkö',
560560 'math' => 'Matematiikka',
561561 'dateformat' => 'Päiväyksen muoto',
 562+'datedefault' => 'Ei valintaa',
562563 'datetime' => 'Aika ja päiväys',
563564 'math_failure' => 'Jäsentäminen epäonnistui',
564565 'math_unknown_error' => 'Tuntematon virhe',
Index: trunk/phase3/languages/LanguageFr.php
@@ -45,7 +45,6 @@
4646 'chapitre.com' => 'http://www.chapitre.com/frame_rec.asp?isbn=$1',
4747 );
4848
49 -
5049 /* private */ $wgAllMessagesFr = array(
5150
5251 # User Toggles
@@ -1209,18 +1208,13 @@
12101209 global $wgSkinNamesFr;
12111210 return $wgSkinNamesFr;
12121211 }
1213 -
1214 - function date( $ts, $adj = false ) {
1215 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
1216 -
1217 - $d = (0 + substr( $ts, 6, 2 )) . ' ' .
1218 - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) .
1219 - ' ' . substr( $ts, 0, 4 );
1220 - return $d;
 1212+
 1213+ function timeBeforeDate( $format ) {
 1214+ return false;
12211215 }
1222 -
1223 - function timeanddate( $ts, $adj = false ) {
1224 - return $this->date( $ts, $adj ) . ' à ' . $this->time( $ts, $adj );
 1216+
 1217+ function timeDateSeparator( $format ) {
 1218+ return " à ";
12251219 }
12261220
12271221 var $digitTransTable = array(
Index: trunk/phase3/languages/LanguageNl.php
@@ -767,19 +767,18 @@
768768 return $wgSkinNamesNl;
769769 }
770770
771 - function date( $ts, $adj = false ) {
772 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
773 -
774 - $d = (0 + substr( $ts, 6, 2 )) . " " .
775 - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . " " .
776 - substr( $ts, 0, 4 );
777 - return $d;
 771+ function timeBeforeDate( $format ) {
 772+ return false;
778773 }
779 -
780 - function timeanddate( $ts, $adj = false ) {
781 - return $this->date( $ts, $adj ) . " " . $this->time( $ts, $adj );
 774+
 775+ function timeDateSeparator( $format ) {
 776+ return ' ';
782777 }
783 -
 778+
 779+ function formatMonth( $month, $format ) {
 780+ return $this->getMonthAbbreviation( $month );
 781+ }
 782+
784783 function getMessage( $key ) {
785784 global $wgAllMessagesNl;
786785 if( isset( $wgAllMessagesNl[$key] ) ) {
Index: trunk/phase3/languages/LanguageNn.php
@@ -608,6 +608,7 @@
609609 'skin' => 'Drakt',
610610 'math' => 'Matematiske formlar',
611611 'dateformat' => 'Datoformat',
 612+'datedefault' => 'Standard',
612613 'math_failure' => 'Klarte ikkje å tolke formelen',
613614 'math_unknown_error' => 'ukjend feil',
614615 'math_unknown_function' => 'ukjend funksjon ',
Index: trunk/phase3/languages/LanguageNo.php
@@ -953,26 +953,24 @@
954954 global $wgSkinNamesNo;
955955 return $wgSkinNamesNo;
956956 }
957 -
958 -
959 - function date( $ts, $adj = false ) {
960 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
961 -
962 - $d = (0 + substr( $ts, 6, 2 )) . ". " .
963 - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . " " .
964 - substr( $ts, 0, 4 );
965 - return $d;
 957+
 958+ function formatMonth( $month, $format ) {
 959+ return $this->getMonthAbbreviation( $month );
966960 }
967 -
968 - function time( $ts, $adj = false ) {
969 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
970 -
971 - $t = substr( $ts, 8, 2 ) . ":" . substr( $ts, 10, 2 );
972 - return $t;
 961+
 962+ function formatDay( $day, $format ) {
 963+ return parent::formatDay( $day, $format ) . '.';
973964 }
974 -
975 - function timeanddate( $ts, $adj = false ) {
976 - return $this->date( $ts, $adj ) . " kl." . $this->time( $ts, $adj );
 965+
 966+ function timeanddate( $ts, $adj = false, $format = false, $timecorrection = false ) {
 967+ $format = $this->dateFormat( $format );
 968+ if( $format == MW_DATE_ISO ) {
 969+ return parent::timeanddate( $ts, $adj, $format, $timecorrection );
 970+ } else {
 971+ return $this->date( $ts, $adj, $format, $timecorrection ) .
 972+ " kl." .
 973+ $this->time( $ts, $adj, $format, $timecorrection );
 974+ }
977975 }
978976
979977 function formatNum( $number ) {
Index: trunk/phase3/languages/LanguageVi.php
@@ -557,6 +557,7 @@
558558 'skin' => 'Ngoại hình',
559559 'math' => 'Công thức toán',
560560 'dateformat' => 'Ngày tháng',
 561+'datedefault' => 'Không lựa chọn',
561562 'math_failure' => 'Lỗi toán',
562563 'math_unknown_error' => 'lỗi chưa rõ',
563564 'math_unknown_function' => 'hàm chưa rõ',
Index: trunk/phase3/languages/LanguageFy.php
@@ -440,6 +440,7 @@
441441 "skin" => "Side-oansjen",
442442 "math" => "Formules",
443443 "dateformat" => "Datum",
 444+'datedefault' => 'Gjin foarkar',
444445 "math_failure" => "Untsjutbere formule",
445446 "math_unknown_error" => "Unbekinde fout",
446447 "math_unknown_function" => "Unbekinde funksje",
Index: trunk/phase3/languages/Language.php
@@ -108,12 +108,22 @@
109109 MW_MATH_MATHML => 'mw_math_mathml'
110110 );
111111
112 -# Whether to use user or default setting in Language::date()
113 -
114 -/* private */ $wgDateFormatsEn = array(
 112+/**
 113+ * Whether to use user or default setting in Language::date()
 114+ *
 115+ * NOTE: the array string values are no longer important!
 116+ * The actual date format functions are now called for the selection in
 117+ * Special:Preferences, and the 'datedefault' message for MW_DATE_DEFAULT.
 118+ *
 119+ * The array keys make up the set of formats which this language allows
 120+ * the user to select. It's exposed via Language::getDateFormats().
 121+ *
 122+ * @access private
 123+ */
 124+$wgDateFormatsEn = array(
115125 MW_DATE_DEFAULT => 'No preference',
 126+ MW_DATE_DMY => '16:12, 15 January 2001',
116127 MW_DATE_MDY => '16:12, January 15, 2001',
117 - MW_DATE_DMY => '16:12, 15 January 2001',
118128 MW_DATE_YMD => '16:12, 2001 January 15',
119129 MW_DATE_ISO => '2001-01-15 16:12:34'
120130 );
@@ -873,6 +883,7 @@
874884 'skin' => 'Skin',
875885 'math' => 'Math',
876886 'dateformat' => 'Date format',
 887+'datedefault' => 'No preference',
877888 'datetime' => 'Date and time',
878889 'math_failure' => 'Failed to parse',
879890 'math_unknown_error' => 'unknown error',
@@ -2467,17 +2478,23 @@
24682479 * [...]
24692480 *</code>
24702481 *
2471 - * @param bool $usePrefs: if false, the site/language default is used
 2482+ * @param mixed $usePrefs: if true, the user's preference is used
 2483+ * if false, the site/language default is used
 2484+ * if int/string, assumed to be a format.
24722485 * @return string
24732486 */
24742487 function dateFormat( $usePrefs = true ) {
24752488 global $wgUser, $wgAmericanDates;
24762489
2477 - if( $usePrefs ) {
2478 - $datePreference = $wgUser->getOption( 'date' );
 2490+ if( is_bool( $usePrefs ) ) {
 2491+ if( $usePrefs ) {
 2492+ $datePreference = $wgUser->getOption( 'date' );
 2493+ } else {
 2494+ $options = $this->getDefaultUserOptions();
 2495+ $datePreference = (string)$options['date'];
 2496+ }
24792497 } else {
2480 - $options = $this->getDefaultUserOptions();
2481 - $datePreference = (string)$options['date'];
 2498+ $datePreference = (string)$usePrefs;
24822499 }
24832500
24842501 if( $datePreference == MW_DATE_DEFAULT || $datePreference == '' ) {
@@ -2492,7 +2509,7 @@
24932510 * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
24942511 * @param bool $adj whether to adjust the time output according to the
24952512 * user configured offset ($timecorrection)
2496 - * @param bool $format true to use user's date format preference
 2513+ * @param mixed $format true to use user's date format preference
24972514 * @param string $timecorrection the time offset as returned by
24982515 * validateTimeZone() in Special:Preferences
24992516 * @return string
@@ -2504,8 +2521,8 @@
25052522
25062523 $datePreference = $this->dateFormat( $format );
25072524
2508 - $month = $this->getMonthName( substr( $ts, 4, 2 ) );
2509 - $day = $this->formatNum( 0 + substr( $ts, 6, 2 ) );
 2525+ $month = $this->formatMonth( substr( $ts, 4, 2 ), $datePreference );
 2526+ $day = $this->formatDay( substr( $ts, 6, 2 ), $datePreference );
25102527 $year = $this->formatNum( substr( $ts, 0, 4 ), true );
25112528
25122529 switch( $datePreference ) {
@@ -2522,7 +2539,7 @@
25232540 * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
25242541 * @param bool $adj whether to adjust the time output according to the
25252542 * user configured offset ($timecorrection)
2526 - * @param bool $format true to use user's date format preference
 2543+ * @param mixed $format true to use user's date format preference
25272544 * @param string $timecorrection the time offset as returned by
25282545 * validateTimeZone() in Special:Preferences
25292546 * @return string
@@ -2532,22 +2549,62 @@
25332550
25342551 if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
25352552 $datePreference = $this->dateFormat( $format );
 2553+
 2554+ $sep = ($datePreference == MW_DATE_ISO)
 2555+ ? ':'
 2556+ : $this->timeSeparator( $format );
 2557+
 2558+ $t = substr( $ts, 8, 2 ) . $sep . substr( $ts, 10, 2 );
25362559
2537 - $t = substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 );
2538 -
25392560 if ( $datePreference == MW_DATE_ISO ) {
2540 - $t .= ':' . substr( $ts, 12, 2 );
 2561+ $t .= $sep . substr( $ts, 12, 2 );
25412562 }
25422563 return $this->formatNum( $t );
25432564 }
 2565+
 2566+ /**
 2567+ * Default separator character between hours, minutes, and seconds.
 2568+ * Will be used by Language::time() for non-ISO formats.
 2569+ * (ISO will always use a colon.)
 2570+ * @return string
 2571+ */
 2572+ function timeSeparator( $format ) {
 2573+ return ':';
 2574+ }
 2575+
 2576+ /**
 2577+ * String to insert between the time and the date in a combined
 2578+ * string. Should include any relevant whitespace.
 2579+ * @return string
 2580+ */
 2581+ function timeDateSeparator( $format ) {
 2582+ return ', ';
 2583+ }
 2584+
 2585+ /**
 2586+ * Return true if the time should display before the date.
 2587+ * @return bool
 2588+ * @access private
 2589+ */
 2590+ function timeBeforeDate() {
 2591+ return true;
 2592+ }
25442593
 2594+ function formatMonth( $month, $format ) {
 2595+ return $this->getMonthName( $month );
 2596+ }
 2597+
 2598+ function formatDay( $day, $format ) {
 2599+ return $this->formatNum( 0 + $day );
 2600+ }
 2601+
25452602 /**
25462603 * @access public
25472604 * @param mixed $ts the time format which needs to be turned into a
25482605 * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
25492606 * @param bool $adj whether to adjust the time output according to the
25502607 * user configured offset ($timecorrection)
2551 - * @param bool $format true to use user's date format preference
 2608+ * @param mixed $format true to use user's date format preference
25522609 * @param string $timecorrection the time offset as returned by
25532610 * validateTimeZone() in Special:Preferences
25542611 * @return string
@@ -2559,8 +2616,13 @@
25602617 switch ( $datePreference ) {
25612618 case MW_DATE_ISO: return $this->date( $ts, $adj, $format, $timecorrection ) . ' ' .
25622619 $this->time( $ts, $adj, $format, $timecorrection );
2563 - default: return $this->time( $ts, $adj, $format, $timecorrection ) . ', ' .
2564 - $this->date( $ts, $adj, $format, $timecorrection );
 2620+ default:
 2621+ $time = $this->time( $ts, $adj, $format, $timecorrection );
 2622+ $sep = $this->timeDateSeparator( $datePreference );
 2623+ $date = $this->date( $ts, $adj, $format, $timecorrection );
 2624+ return $this->timeBeforeDate( $datePreference )
 2625+ ? $time . $sep . $date
 2626+ : $date . $sep . $time;
25652627 }
25662628 }
25672629
Index: trunk/phase3/languages/LanguageCa.php
@@ -820,34 +820,10 @@
821821 return $wgSkinNamesCa;
822822 }
823823
824 -
825 - function shortdate( $ts, $adj = false ) {
826 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
827 -
828 - $d = (0 + substr( $ts, 6, 2 )) . " " .$this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . ", " .
829 - substr( $ts, 0, 4 );
830 - return $d;
 824+ function formatMonth( $month, $format ) {
 825+ return $this->getMonthAbbreviation( $month );
831826 }
832827
833 - function date( $ts, $adj = false ) {
834 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
835 -
836 - $d = (0 + substr( $ts, 6, 2 )) . " de " .$this->getMonthName( substr( $ts, 4, 2 ) ) . ", " .
837 - substr( $ts, 0, 4 );
838 - return $d;
839 - }
840 -
841 - function time( $ts, $adj = false ) {
842 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
843 -
844 - $t = substr( $ts, 8, 2 ) . ":" . substr( $ts, 10, 2 );
845 - return $t;
846 - }
847 -
848 - function timeanddate( $ts, $adj = false ) {
849 - return $this->time( $ts, $adj ) . " " . $this->shortdate( $ts, $adj );
850 - }
851 -
852828 function getMessage( $key ) {
853829 global $wgAllMessagesCa;
854830 if( isset( $wgAllMessagesCa[$key] ) ) {
Index: trunk/phase3/languages/LanguageGa.php
@@ -745,6 +745,7 @@
746746 "skin" => "Craiceann",
747747 "math" => "Ag aistriú na matamaitice",
748748 "dateformat" => "Formáid dáta",
 749+'datedefault' => 'Is cuma liom',
749750 "math_failure" => "Theip anailís an fhoirmle",
750751 "math_unknown_error" => "earráid anaithnid",
751752 "math_unknown_function" => "foirmle anaithnid ",
Index: trunk/phase3/languages/LanguageOc.php
@@ -844,18 +844,17 @@
845845 return $wgSkinNamesOc;
846846 }
847847
848 - function date( $ts, $adj = false ) {
849 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
850 -
851 - $d = (0 + substr( $ts, 6, 2 )) . " " .
852 - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) .
853 - " " . substr( $ts, 0, 4 );
854 - return $d;
 848+ function formatMonth( $month, $format ) {
 849+ return $this->getMonthAbbreviation( $month );
855850 }
856 -
857 - function timeanddate( $ts, $adj = false ) {
858 - return $this->date( $ts, $adj ) . " à " . $this->time( $ts, $adj );
 851+
 852+ function timeBeforeDate( $format ) {
 853+ return false;
859854 }
 855+
 856+ function timeDateSeparator( $format ) {
 857+ return " à ";
 858+ }
860859
861860 function getMessage( $key ) {
862861 global $wgAllMessagesOc, $wgAllMessagesEn;
Index: trunk/phase3/languages/LanguageCs.php
@@ -1831,15 +1831,13 @@
18321832
18331833 # Datové a časové funkce možno upřesnit podle jazyka
18341834 # TODO: Umožnit nastavování formátu data a času.
1835 - function date( $ts, $adj = false ) {
1836 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
1837 -
1838 - $d = (0 + substr( $ts, 6, 2 )) . '. ' .
1839 - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) .
1840 - ' ' .
1841 - substr( $ts, 0, 4 );
1842 - return $d;
 1835+ function formatMonth( $month, $format ) {
 1836+ return intval( $month ) . '.';
18431837 }
 1838+
 1839+ function formatDay( $day, $format ) {
 1840+ return intval( $day ) . '.';
 1841+ }
18441842
18451843 function getMessage( $key ) {
18461844 global $wgAllMessagesCs;
Index: trunk/phase3/languages/LanguageSc.php
@@ -705,13 +705,8 @@
706706 return $wgQuickbarSettingsSc;
707707 }
708708
709 - function date( $ts, $adj = false ) {
710 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
711 -
712 - $d = $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) .
713 - " " . (0 + substr( $ts, 6, 2 )) . ", " .
714 - substr( $ts, 0, 4 );
715 - return $d;
 709+ function formatMonth( $month, $format ) {
 710+ return $this->getMonthAbbreviation( $month );
716711 }
717712
718713 function getMessage( $key ) {
Index: trunk/phase3/languages/LanguageKo.php
@@ -645,6 +645,10 @@
646646 global $wgSkinNamesKo;
647647 return $wgSkinNamesKo;
648648 }
 649+
 650+ function getDateFormats() {
 651+ return false;
 652+ }
649653
650654 function date( $ts, $adj = false ) {
651655 global $wgWeekdayAbbreviationsKo;
Index: trunk/phase3/languages/LanguageSk.php
@@ -648,6 +648,7 @@
649649 'skin' => 'Vzhľad',
650650 'math' => 'Matematika',
651651 'dateformat' => 'Formát dátumu',
 652+'datedefault' => 'Default',
652653 'math_failure' => 'Syntaktická analýza (parsing) neúspešná',
653654 'math_unknown_error' => 'neznáma chyba',
654655 'math_unknown_function' => 'neznáma funkcia ',
Index: trunk/phase3/languages/LanguageSr.php
@@ -330,6 +330,7 @@
331331 'data' => 'Подаци',
332332 'databaseerror' => 'Грешка у бази',
333333 'dateformat' => 'Формат датума',
 334+'datedefault' => 'Није битно',
334335 'dberrortext' => 'Десила се синтаксна грешка упита базе.
335336 Ово је могуће због илегалног упита,
336337 или могуће грешке у софтверу.
Index: trunk/phase3/languages/LanguageSv.php
@@ -909,26 +909,21 @@
910910 return $wgSkinNamesSv;
911911 }
912912
913 - function date( $ts, $adj = false ) {
914 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
915 -
916 - $d = (0 + substr( $ts, 6, 2 )) . " " .
917 - $this->getMonthName( substr( $ts, 4, 2 ) ) . " " .
918 - substr( $ts, 0, 4 );
919 - return $d;
920 - }
921 -
922913 // "." is used as the character to separate the
923914 // hours from the minutes in the date output
924 - function time( $ts, $adj = false ) {
925 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
926 -
927 - $t = substr( $ts, 8, 2 ) . "." . substr( $ts, 10, 2 );
928 - return $t;
 915+ function timeSeparator() {
 916+ return '.';
929917 }
930918
931 - function timeanddate( $ts, $adj = false ) {
932 - return $this->date( $ts, $adj ) . " kl." . $this->time( $ts, $adj );
 919+ function timeanddate( $ts, $adj = false, $format = false, $timecorrection = false ) {
 920+ $format = $this->dateFormat( $format );
 921+ if( $format == MW_DATE_ISO ) {
 922+ return parent::timeanddate( $ts, $adj, $format, $timecorrection );
 923+ } else {
 924+ return $this->date( $ts, $adj, $format, $timecorrection ) .
 925+ " kl." .
 926+ $this->time( $ts, $adj, $format, $timecorrection );
 927+ }
933928 }
934929
935930 function getMessage( $key ) {
Index: trunk/phase3/languages/LanguageDe.php
@@ -1247,16 +1247,14 @@
12481248 global $wgSkinNamesDe;
12491249 return $wgSkinNamesDe;
12501250 }
1251 -
1252 - function date( $ts, $adj = false ) {
1253 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
1254 -
1255 - $d = (0 + substr( $ts, 6, 2 )) . ". " .
1256 - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) .
1257 - " " .
1258 - substr( $ts, 0, 4 );
1259 - return $d;
 1251+
 1252+ function formatMonth( $month, $format ) {
 1253+ return $this->getMonthAbbreviation( $month );
12601254 }
 1255+
 1256+ function formatDay( $day, $format ) {
 1257+ return parent::formatDay( $day, $format ) . '.';
 1258+ }
12611259
12621260 function getMessage( $key ) {
12631261 global $wgAllMessagesDe;
Index: trunk/phase3/languages/LanguageLa.php
@@ -137,19 +137,6 @@
138138 return $wgSkinNamesLa;
139139 }
140140
141 - function date( $ts, $adj = false ) {
142 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
143 -
144 - $d = $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) .
145 - " " . (0 + substr( $ts, 6, 2 )) . ", " .
146 - substr( $ts, 0, 4 );
147 - return $d;
148 - }
149 -
150 - function timeanddate( $ts, $adj = false ) {
151 - return $this->time( $ts, $adj ) . " " . $this->date( $ts, $adj );
152 - }
153 -
154141 function getMessage( $key ) {
155142 global $wgAllMessagesLa;
156143 if( isset( $wgAllMessagesLa[$key] ) ) {
Index: trunk/phase3/languages/LanguageLi.php
@@ -882,20 +882,19 @@
883883 global $wgSkinNamesLi;
884884 return $wgSkinNamesLi;
885885 }
886 -
887 - function date( $ts, $adj = false ) {
888 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
889 -
890 - $d = (0 + substr( $ts, 6, 2 )) . " " .
891 - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . " " .
892 - substr( $ts, 0, 4 );
893 - return $d;
 886+
 887+ function timeBeforeDate( $format ) {
 888+ return false;
894889 }
895 -
896 - function timeanddate( $ts, $adj = false ) {
897 - return $this->date( $ts, $adj ) . " " . $this->time( $ts, $adj );
 890+
 891+ function timeDateSeparator( $format ) {
 892+ return ' ';
898893 }
899 -
 894+
 895+ function formatMonth( $month, $format ) {
 896+ return $this->getMonthAbbreviation( $month );
 897+ }
 898+
900899 function getMessage( $key ) {
901900 global $wgAllMessagesLi;
902901 if( isset( $wgAllMessagesLi[$key] ) ) {
Index: trunk/phase3/languages/LanguagePl.php
@@ -972,14 +972,9 @@
973973 global $wgMonthNamesGenEn;
974974 return wfMsg( $wgMonthNamesGenEn[$key-1] );
975975 }
976 -
977 - function date( $ts, $adj = false ) {
978 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
979 -
980 - $d = (0 + substr( $ts, 6, 2 )) .
981 - " " . $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) .
982 - " " . substr( $ts, 0, 4 );
983 - return $d;
 976+
 977+ function formatMonth( $month, $format ) {
 978+ return $this->getMonthAbbreviation( $month );
984979 }
985980
986981 function getMessage( $key ) {
Index: trunk/phase3/languages/LanguagePt.php
@@ -763,6 +763,7 @@
764764 'skin' => 'Tema',
765765 'math' => 'Matemática',
766766 'dateformat' => 'Formato da data',
 767+'datedefault' => 'Sem preferência',
767768 'datetime' => 'Data e hora',
768769 'math_failure' => 'Falhou ao verificar gramática',
769770 'math_unknown_error' => 'Erro desconhecido',
Index: trunk/phase3/languages/LanguageTr.php
@@ -449,6 +449,7 @@
450450 'currentrev' => 'Güncel sürüm',
451451 'currentrevisionlink' => 'en güncel halini göster',
452452 'dateformat' => 'Tarih gösterimi',
 453+'datedefault' => 'Tercih yok',
453454 'datetime' => 'Tarih ve saat',
454455 'deadendpages' => 'Başka sayfalara bağlantısı olmayan sayfalar',
455456 'default' => 'orjinal',
Index: trunk/phase3/languages/LanguageIa.php
@@ -858,19 +858,6 @@
859859 return $wgSkinNamesIa;
860860 }
861861
862 - function date( $ts, $adj = false ) {
863 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
864 -
865 - $d = $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) .
866 - " " . (0 + substr( $ts, 6, 2 )) . ", " .
867 - substr( $ts, 0, 4 );
868 - return $d;
869 - }
870 -
871 - function timeanddate( $ts, $adj = false ) {
872 - return $this->time( $ts, $adj ) . " " . $this->date( $ts, $adj );
873 - }
874 -
875862 function getMessage( $key ) {
876863 global $wgAllMessagesIa, $wgAllMessagesEn;
877864 $m = $wgAllMessagesIa[$key];
Index: trunk/phase3/languages/LanguageZh_cn.php
@@ -924,6 +924,10 @@
925925 global $wgSkinNamesZh_cn;
926926 return $wgSkinNamesZh_cn;
927927 }
 928+
 929+ function getDateFormats() {
 930+ return false;
 931+ }
928932
929933 function date( $ts, $adj = false ) {
930934 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
Index: trunk/phase3/languages/LanguageEo.php
@@ -924,15 +924,13 @@
925925 }
926926
927927 # La dato- kaj tempo-funkciojn oni povas precizigi laŭ lingvo
928 - function date( $ts, $adj = false ) {
929 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
930 -
931 - $d = (0 + substr( $ts, 6, 2 )) . '. ' .
932 - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) .
933 - ' ' .
934 - substr( $ts, 0, 4 );
935 - return $d;
 928+ function formatMonth( $month, $format ) {
 929+ return $this->getMonthAbbreviation( $month );
936930 }
 931+
 932+ function formatDay( $day, $format ) {
 933+ return parent::formatDay( $day, $format ) . '.';
 934+ }
937935
938936 function getMessage( $key ) {
939937 global $wgAllMessagesEo;
Index: trunk/phase3/languages/LanguageEs.php
@@ -1044,34 +1044,16 @@
10451045 global $wgSkinNamesEs;
10461046 return $wgSkinNamesEs;
10471047 }
1048 -
1049 - function shortdate( $ts, $adj = false ) {
1050 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
1051 -
1052 - $d = (0 + substr( $ts, 6, 2 )) . " " .$this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . ", " .
1053 - substr( $ts, 0, 4 );
1054 - return $d;
 1048+
 1049+ function formatMonth( $month, $format ) {
 1050+ return $this->getMonthAbbreviation( $month );
10551051 }
1056 -
1057 - function date( $ts, $adj = false ) {
1058 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
1059 -
1060 - $d = (0 + substr( $ts, 6, 2 )) . " de " .$this->getMonthName( substr( $ts, 4, 2 ) ) . ", " .
1061 - substr( $ts, 0, 4 );
1062 - return $d;
 1052+
 1053+ function timeDateSeparator( $format ) {
 1054+ return ' ';
10631055 }
 1056+
10641057
1065 - function time( $ts, $adj = false ) {
1066 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
1067 -
1068 - $t = substr( $ts, 8, 2 ) . ":" . substr( $ts, 10, 2 );
1069 - return $t;
1070 - }
1071 -
1072 - function timeanddate( $ts, $adj = false ) {
1073 - return $this->time( $ts, $adj ) . " " . $this->shortdate( $ts, $adj );
1074 - }
1075 -
10761058 function getMessage( $key ) {
10771059 global $wgAllMessagesEs;
10781060 if( isset( $wgAllMessagesEs[$key] ) ) {
Index: trunk/phase3/languages/LanguageEt.php
@@ -570,6 +570,7 @@
571571 "skin" => "Nahk",
572572 "math" => "Valemite näitamine",
573573 "dateformat" => "Kuupäeva formaat",
 574+'datedefault' => 'Eelistus puudub',
574575 "math_failure" => "Arusaamatu süntaks",
575576 "math_unknown_error" => "Tundmatu viga",
576577 "math_unknown_function" => "Tundmatu funktsioon ",
Index: trunk/phase3/languages/LanguageIs.php
@@ -216,6 +216,7 @@
217217 'currentrevisionlink' => "núverandi útgáfa",
218218 'databaseerror' => "Gagnagrunnsvilla",
219219 'dateformat' => "Tímasnið",
 220+'datedefault' => 'Sjálfgefið',
220221 'deadendpages' => "Botnlangar",
221222 'debug' => "Aflúsa",
222223 'dec' => "des",
Index: trunk/phase3/languages/LanguageIt.php
@@ -716,14 +716,9 @@
717717 global $wgQuickbarSettingsIt;
718718 return $wgQuickbarSettingsIt;
719719 }
720 -
721 - function date( $ts, $adj = false ) {
722 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
723 -
724 - $d = $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) .
725 - " " . (0 + substr( $ts, 6, 2 )) . ", " .
726 - substr( $ts, 0, 4 );
727 - return $d;
 720+
 721+ function formatMonth( $month, $format ) {
 722+ return $this->getMonthAbbreviation( $month );
728723 }
729724
730725 function getMessage( $key ) {
Index: trunk/phase3/languages/LanguageNds.php
@@ -1283,15 +1283,13 @@
12841284 return $wgSkinNamesNds;
12851285 }
12861286
1287 - function date( $ts, $adj = false ) {
1288 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
1289 -
1290 - $d = (0 + substr( $ts, 6, 2 )) . '. ' .
1291 - $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) .
1292 - ' ' .
1293 - substr( $ts, 0, 4 );
1294 - return $d;
 1287+ function formatMonth( $month, $format ) {
 1288+ return $this->getMonthAbbreviation( $month );
12951289 }
 1290+
 1291+ function formatDay( $day, $format ) {
 1292+ return parent::formatDay( $day, $format ) . '.';
 1293+ }
12961294
12971295 function getMessage( $key ) {
12981296 global $wgAllMessagesNds;
Index: trunk/phase3/languages/LanguageBe.php
@@ -553,26 +553,28 @@
554554 global $wgMagicWordsBe;
555555 return $wgMagicWordsBe;
556556 }
 557+
 558+ function getDateFormats() {
 559+ return $wgDateFormatsBe = array(
 560+ MW_DATE_DEFAULT => MW_DATE_DEFAULT,
 561+ '16:12, 15.01.2001' => '16:12, 15.01.2001',
 562+ MW_DATE_ISO => MW_DATE_ISO
 563+ );
 564+ }
557565
558566 // The date and time format
559 - function date( $ts, $adj = false ) {
560 - if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting.
561 - // 20050310001506 => 10.03.2005
562 - $date = (substr( $ts, 6, 2 )) . '.' . substr( $ts, 4, 2 ) . '.' . substr( $ts, 0, 4 );
563 - return $date;
 567+ function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
 568+ $datePreference = $this->dateFormat( $format );
 569+ if( $datePreference == MW_DATE_ISO ) {
 570+ return parent::date( $ts, $adj, $datePreference, $timecorrection );
 571+ } else {
 572+ if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); } # Adjust based on the timezone setting.
 573+ // 20050310001506 => 10.03.2005
 574+ $date = (substr( $ts, 6, 2 )) . '.' . substr( $ts, 4, 2 ) . '.' . substr( $ts, 0, 4 );
 575+ return $date;
 576+ }
564577 }
565578
566 - function time( $ts, $adj = false ) {
567 - if ( $adj ) { $ts = $this->userAdjust( $ts ); }
568 - // 20050310001506 => 00:15
569 - $time = substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 );
570 - return $time;
571 - }
572 -
573 - function timeanddate( $ts, $adj = false ) {
574 - return $this->time( $ts, $adj ) . ', ' .$this->date( $ts, $adj );
575 - }
576 -
577579 function getMessage( $key ) {
578580 global $wgAllMessagesBe;
579581 if( isset( $wgAllMessagesBe[$key] ) ) {
Index: trunk/phase3/languages/LanguageJa.php
@@ -597,6 +597,7 @@
598598 'skin' => '外装',
599599 'math' => '数式の表記方法',
600600 'dateformat' => '日付の書式',
 601+'datedefault' => '2001年1月15日 16:12 (デフォルト)',
601602 'math_failure' => '構文解析失敗',
602603 'math_unknown_error' => '不明なエラー',
603604 'math_unknown_function' => '不明な関数',

Status & tagging log