Index: trunk/phase3/includes/SpecialPreferences.php |
— | — | @@ -745,10 +745,16 @@ |
746 | 746 | if ($dateopts) { |
747 | 747 | $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsg( 'dateformat' ) . "</legend>\n" ); |
748 | 748 | $idCnt = 0; |
| 749 | + $epoch = '20010115161234'; |
749 | 750 | 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 | + } |
750 | 756 | ($key == $this->mDate) ? $checked = ' checked="checked"' : $checked = ''; |
751 | 757 | $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" ); |
753 | 759 | $idCnt++; |
754 | 760 | } |
755 | 761 | $wgOut->addHTML( "</fieldset>\n" ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -210,7 +210,10 @@ |
211 | 211 | * Allow $wgFeedCacheTimeout of 0 to disable feed caching |
212 | 212 | * Fix WebRequest::getRequestURL() to strip off the host bits squid prepends |
213 | 213 | * 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... |
214 | 216 | |
| 217 | + |
215 | 218 | === Caveats === |
216 | 219 | |
217 | 220 | Some output, particularly involving user-supplied inline HTML, may not |
Index: trunk/phase3/languages/LanguageFi.php |
— | — | @@ -558,6 +558,7 @@ |
559 | 559 | 'skin' => 'Ulkonäkö', |
560 | 560 | 'math' => 'Matematiikka', |
561 | 561 | 'dateformat' => 'Päiväyksen muoto', |
| 562 | +'datedefault' => 'Ei valintaa', |
562 | 563 | 'datetime' => 'Aika ja päiväys', |
563 | 564 | 'math_failure' => 'Jäsentäminen epäonnistui', |
564 | 565 | 'math_unknown_error' => 'Tuntematon virhe', |
Index: trunk/phase3/languages/LanguageFr.php |
— | — | @@ -45,7 +45,6 @@ |
46 | 46 | 'chapitre.com' => 'http://www.chapitre.com/frame_rec.asp?isbn=$1', |
47 | 47 | ); |
48 | 48 | |
49 | | - |
50 | 49 | /* private */ $wgAllMessagesFr = array( |
51 | 50 | |
52 | 51 | # User Toggles |
— | — | @@ -1209,18 +1208,13 @@ |
1210 | 1209 | global $wgSkinNamesFr; |
1211 | 1210 | return $wgSkinNamesFr; |
1212 | 1211 | } |
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; |
1221 | 1215 | } |
1222 | | - |
1223 | | - function timeanddate( $ts, $adj = false ) { |
1224 | | - return $this->date( $ts, $adj ) . ' à ' . $this->time( $ts, $adj ); |
| 1216 | + |
| 1217 | + function timeDateSeparator( $format ) { |
| 1218 | + return " à "; |
1225 | 1219 | } |
1226 | 1220 | |
1227 | 1221 | var $digitTransTable = array( |
Index: trunk/phase3/languages/LanguageNl.php |
— | — | @@ -767,19 +767,18 @@ |
768 | 768 | return $wgSkinNamesNl; |
769 | 769 | } |
770 | 770 | |
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; |
778 | 773 | } |
779 | | - |
780 | | - function timeanddate( $ts, $adj = false ) { |
781 | | - return $this->date( $ts, $adj ) . " " . $this->time( $ts, $adj ); |
| 774 | + |
| 775 | + function timeDateSeparator( $format ) { |
| 776 | + return ' '; |
782 | 777 | } |
783 | | - |
| 778 | + |
| 779 | + function formatMonth( $month, $format ) { |
| 780 | + return $this->getMonthAbbreviation( $month ); |
| 781 | + } |
| 782 | + |
784 | 783 | function getMessage( $key ) { |
785 | 784 | global $wgAllMessagesNl; |
786 | 785 | if( isset( $wgAllMessagesNl[$key] ) ) { |
Index: trunk/phase3/languages/LanguageNn.php |
— | — | @@ -608,6 +608,7 @@ |
609 | 609 | 'skin' => 'Drakt', |
610 | 610 | 'math' => 'Matematiske formlar', |
611 | 611 | 'dateformat' => 'Datoformat', |
| 612 | +'datedefault' => 'Standard', |
612 | 613 | 'math_failure' => 'Klarte ikkje å tolke formelen', |
613 | 614 | 'math_unknown_error' => 'ukjend feil', |
614 | 615 | 'math_unknown_function' => 'ukjend funksjon ', |
Index: trunk/phase3/languages/LanguageNo.php |
— | — | @@ -953,26 +953,24 @@ |
954 | 954 | global $wgSkinNamesNo; |
955 | 955 | return $wgSkinNamesNo; |
956 | 956 | } |
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 ); |
966 | 960 | } |
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 ) . '.'; |
973 | 964 | } |
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 | + } |
977 | 975 | } |
978 | 976 | |
979 | 977 | function formatNum( $number ) { |
Index: trunk/phase3/languages/LanguageVi.php |
— | — | @@ -557,6 +557,7 @@ |
558 | 558 | 'skin' => 'Ngoại hình', |
559 | 559 | 'math' => 'Công thức toán', |
560 | 560 | 'dateformat' => 'Ngày tháng', |
| 561 | +'datedefault' => 'Không lựa chọn', |
561 | 562 | 'math_failure' => 'Lỗi toán', |
562 | 563 | 'math_unknown_error' => 'lỗi chưa rõ', |
563 | 564 | 'math_unknown_function' => 'hàm chưa rõ', |
Index: trunk/phase3/languages/LanguageFy.php |
— | — | @@ -440,6 +440,7 @@ |
441 | 441 | "skin" => "Side-oansjen", |
442 | 442 | "math" => "Formules", |
443 | 443 | "dateformat" => "Datum", |
| 444 | +'datedefault' => 'Gjin foarkar', |
444 | 445 | "math_failure" => "Untsjutbere formule", |
445 | 446 | "math_unknown_error" => "Unbekinde fout", |
446 | 447 | "math_unknown_function" => "Unbekinde funksje", |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -108,12 +108,22 @@ |
109 | 109 | MW_MATH_MATHML => 'mw_math_mathml' |
110 | 110 | ); |
111 | 111 | |
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( |
115 | 125 | MW_DATE_DEFAULT => 'No preference', |
| 126 | + MW_DATE_DMY => '16:12, 15 January 2001', |
116 | 127 | MW_DATE_MDY => '16:12, January 15, 2001', |
117 | | - MW_DATE_DMY => '16:12, 15 January 2001', |
118 | 128 | MW_DATE_YMD => '16:12, 2001 January 15', |
119 | 129 | MW_DATE_ISO => '2001-01-15 16:12:34' |
120 | 130 | ); |
— | — | @@ -873,6 +883,7 @@ |
874 | 884 | 'skin' => 'Skin', |
875 | 885 | 'math' => 'Math', |
876 | 886 | 'dateformat' => 'Date format', |
| 887 | +'datedefault' => 'No preference', |
877 | 888 | 'datetime' => 'Date and time', |
878 | 889 | 'math_failure' => 'Failed to parse', |
879 | 890 | 'math_unknown_error' => 'unknown error', |
— | — | @@ -2467,17 +2478,23 @@ |
2468 | 2479 | * [...] |
2469 | 2480 | *</code> |
2470 | 2481 | * |
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. |
2472 | 2485 | * @return string |
2473 | 2486 | */ |
2474 | 2487 | function dateFormat( $usePrefs = true ) { |
2475 | 2488 | global $wgUser, $wgAmericanDates; |
2476 | 2489 | |
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 | + } |
2479 | 2497 | } else { |
2480 | | - $options = $this->getDefaultUserOptions(); |
2481 | | - $datePreference = (string)$options['date']; |
| 2498 | + $datePreference = (string)$usePrefs; |
2482 | 2499 | } |
2483 | 2500 | |
2484 | 2501 | if( $datePreference == MW_DATE_DEFAULT || $datePreference == '' ) { |
— | — | @@ -2492,7 +2509,7 @@ |
2493 | 2510 | * date('YmdHis') format with wfTimestamp(TS_MW,$ts) |
2494 | 2511 | * @param bool $adj whether to adjust the time output according to the |
2495 | 2512 | * 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 |
2497 | 2514 | * @param string $timecorrection the time offset as returned by |
2498 | 2515 | * validateTimeZone() in Special:Preferences |
2499 | 2516 | * @return string |
— | — | @@ -2504,8 +2521,8 @@ |
2505 | 2522 | |
2506 | 2523 | $datePreference = $this->dateFormat( $format ); |
2507 | 2524 | |
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 ); |
2510 | 2527 | $year = $this->formatNum( substr( $ts, 0, 4 ), true ); |
2511 | 2528 | |
2512 | 2529 | switch( $datePreference ) { |
— | — | @@ -2522,7 +2539,7 @@ |
2523 | 2540 | * date('YmdHis') format with wfTimestamp(TS_MW,$ts) |
2524 | 2541 | * @param bool $adj whether to adjust the time output according to the |
2525 | 2542 | * 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 |
2527 | 2544 | * @param string $timecorrection the time offset as returned by |
2528 | 2545 | * validateTimeZone() in Special:Preferences |
2529 | 2546 | * @return string |
— | — | @@ -2532,22 +2549,62 @@ |
2533 | 2550 | |
2534 | 2551 | if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); } |
2535 | 2552 | $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 ); |
2536 | 2559 | |
2537 | | - $t = substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 ); |
2538 | | - |
2539 | 2560 | if ( $datePreference == MW_DATE_ISO ) { |
2540 | | - $t .= ':' . substr( $ts, 12, 2 ); |
| 2561 | + $t .= $sep . substr( $ts, 12, 2 ); |
2541 | 2562 | } |
2542 | 2563 | return $this->formatNum( $t ); |
2543 | 2564 | } |
| 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 | + } |
2544 | 2593 | |
| 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 | + |
2545 | 2602 | /** |
2546 | 2603 | * @access public |
2547 | 2604 | * @param mixed $ts the time format which needs to be turned into a |
2548 | 2605 | * date('YmdHis') format with wfTimestamp(TS_MW,$ts) |
2549 | 2606 | * @param bool $adj whether to adjust the time output according to the |
2550 | 2607 | * 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 |
2552 | 2609 | * @param string $timecorrection the time offset as returned by |
2553 | 2610 | * validateTimeZone() in Special:Preferences |
2554 | 2611 | * @return string |
— | — | @@ -2559,8 +2616,13 @@ |
2560 | 2617 | switch ( $datePreference ) { |
2561 | 2618 | case MW_DATE_ISO: return $this->date( $ts, $adj, $format, $timecorrection ) . ' ' . |
2562 | 2619 | $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; |
2565 | 2627 | } |
2566 | 2628 | } |
2567 | 2629 | |
Index: trunk/phase3/languages/LanguageCa.php |
— | — | @@ -820,34 +820,10 @@ |
821 | 821 | return $wgSkinNamesCa; |
822 | 822 | } |
823 | 823 | |
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 ); |
831 | 826 | } |
832 | 827 | |
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 | | - |
852 | 828 | function getMessage( $key ) { |
853 | 829 | global $wgAllMessagesCa; |
854 | 830 | if( isset( $wgAllMessagesCa[$key] ) ) { |
Index: trunk/phase3/languages/LanguageGa.php |
— | — | @@ -745,6 +745,7 @@ |
746 | 746 | "skin" => "Craiceann", |
747 | 747 | "math" => "Ag aistriú na matamaitice", |
748 | 748 | "dateformat" => "Formáid dáta", |
| 749 | +'datedefault' => 'Is cuma liom', |
749 | 750 | "math_failure" => "Theip anailís an fhoirmle", |
750 | 751 | "math_unknown_error" => "earráid anaithnid", |
751 | 752 | "math_unknown_function" => "foirmle anaithnid ", |
Index: trunk/phase3/languages/LanguageOc.php |
— | — | @@ -844,18 +844,17 @@ |
845 | 845 | return $wgSkinNamesOc; |
846 | 846 | } |
847 | 847 | |
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 ); |
855 | 850 | } |
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; |
859 | 854 | } |
| 855 | + |
| 856 | + function timeDateSeparator( $format ) { |
| 857 | + return " à "; |
| 858 | + } |
860 | 859 | |
861 | 860 | function getMessage( $key ) { |
862 | 861 | global $wgAllMessagesOc, $wgAllMessagesEn; |
Index: trunk/phase3/languages/LanguageCs.php |
— | — | @@ -1831,15 +1831,13 @@ |
1832 | 1832 | |
1833 | 1833 | # Datové a časové funkce možno upřesnit podle jazyka |
1834 | 1834 | # 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 ) . '.'; |
1843 | 1837 | } |
| 1838 | + |
| 1839 | + function formatDay( $day, $format ) { |
| 1840 | + return intval( $day ) . '.'; |
| 1841 | + } |
1844 | 1842 | |
1845 | 1843 | function getMessage( $key ) { |
1846 | 1844 | global $wgAllMessagesCs; |
Index: trunk/phase3/languages/LanguageSc.php |
— | — | @@ -705,13 +705,8 @@ |
706 | 706 | return $wgQuickbarSettingsSc; |
707 | 707 | } |
708 | 708 | |
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 ); |
716 | 711 | } |
717 | 712 | |
718 | 713 | function getMessage( $key ) { |
Index: trunk/phase3/languages/LanguageKo.php |
— | — | @@ -645,6 +645,10 @@ |
646 | 646 | global $wgSkinNamesKo; |
647 | 647 | return $wgSkinNamesKo; |
648 | 648 | } |
| 649 | + |
| 650 | + function getDateFormats() { |
| 651 | + return false; |
| 652 | + } |
649 | 653 | |
650 | 654 | function date( $ts, $adj = false ) { |
651 | 655 | global $wgWeekdayAbbreviationsKo; |
Index: trunk/phase3/languages/LanguageSk.php |
— | — | @@ -648,6 +648,7 @@ |
649 | 649 | 'skin' => 'Vzhľad', |
650 | 650 | 'math' => 'Matematika', |
651 | 651 | 'dateformat' => 'Formát dátumu', |
| 652 | +'datedefault' => 'Default', |
652 | 653 | 'math_failure' => 'Syntaktická analýza (parsing) neúspešná', |
653 | 654 | 'math_unknown_error' => 'neznáma chyba', |
654 | 655 | 'math_unknown_function' => 'neznáma funkcia ', |
Index: trunk/phase3/languages/LanguageSr.php |
— | — | @@ -330,6 +330,7 @@ |
331 | 331 | 'data' => 'Подаци', |
332 | 332 | 'databaseerror' => 'Грешка у бази', |
333 | 333 | 'dateformat' => 'Формат датума', |
| 334 | +'datedefault' => 'Није битно', |
334 | 335 | 'dberrortext' => 'Десила се синтаксна грешка упита базе. |
335 | 336 | Ово је могуће због илегалног упита, |
336 | 337 | или могуће грешке у софтверу. |
Index: trunk/phase3/languages/LanguageSv.php |
— | — | @@ -909,26 +909,21 @@ |
910 | 910 | return $wgSkinNamesSv; |
911 | 911 | } |
912 | 912 | |
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 | | - |
922 | 913 | // "." is used as the character to separate the |
923 | 914 | // 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 '.'; |
929 | 917 | } |
930 | 918 | |
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 | + } |
933 | 928 | } |
934 | 929 | |
935 | 930 | function getMessage( $key ) { |
Index: trunk/phase3/languages/LanguageDe.php |
— | — | @@ -1247,16 +1247,14 @@ |
1248 | 1248 | global $wgSkinNamesDe; |
1249 | 1249 | return $wgSkinNamesDe; |
1250 | 1250 | } |
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 ); |
1260 | 1254 | } |
| 1255 | + |
| 1256 | + function formatDay( $day, $format ) { |
| 1257 | + return parent::formatDay( $day, $format ) . '.'; |
| 1258 | + } |
1261 | 1259 | |
1262 | 1260 | function getMessage( $key ) { |
1263 | 1261 | global $wgAllMessagesDe; |
Index: trunk/phase3/languages/LanguageLa.php |
— | — | @@ -137,19 +137,6 @@ |
138 | 138 | return $wgSkinNamesLa; |
139 | 139 | } |
140 | 140 | |
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 | | - |
154 | 141 | function getMessage( $key ) { |
155 | 142 | global $wgAllMessagesLa; |
156 | 143 | if( isset( $wgAllMessagesLa[$key] ) ) { |
Index: trunk/phase3/languages/LanguageLi.php |
— | — | @@ -882,20 +882,19 @@ |
883 | 883 | global $wgSkinNamesLi; |
884 | 884 | return $wgSkinNamesLi; |
885 | 885 | } |
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; |
894 | 889 | } |
895 | | - |
896 | | - function timeanddate( $ts, $adj = false ) { |
897 | | - return $this->date( $ts, $adj ) . " " . $this->time( $ts, $adj ); |
| 890 | + |
| 891 | + function timeDateSeparator( $format ) { |
| 892 | + return ' '; |
898 | 893 | } |
899 | | - |
| 894 | + |
| 895 | + function formatMonth( $month, $format ) { |
| 896 | + return $this->getMonthAbbreviation( $month ); |
| 897 | + } |
| 898 | + |
900 | 899 | function getMessage( $key ) { |
901 | 900 | global $wgAllMessagesLi; |
902 | 901 | if( isset( $wgAllMessagesLi[$key] ) ) { |
Index: trunk/phase3/languages/LanguagePl.php |
— | — | @@ -972,14 +972,9 @@ |
973 | 973 | global $wgMonthNamesGenEn; |
974 | 974 | return wfMsg( $wgMonthNamesGenEn[$key-1] ); |
975 | 975 | } |
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 ); |
984 | 979 | } |
985 | 980 | |
986 | 981 | function getMessage( $key ) { |
Index: trunk/phase3/languages/LanguagePt.php |
— | — | @@ -763,6 +763,7 @@ |
764 | 764 | 'skin' => 'Tema', |
765 | 765 | 'math' => 'Matemática', |
766 | 766 | 'dateformat' => 'Formato da data', |
| 767 | +'datedefault' => 'Sem preferência', |
767 | 768 | 'datetime' => 'Data e hora', |
768 | 769 | 'math_failure' => 'Falhou ao verificar gramática', |
769 | 770 | 'math_unknown_error' => 'Erro desconhecido', |
Index: trunk/phase3/languages/LanguageTr.php |
— | — | @@ -449,6 +449,7 @@ |
450 | 450 | 'currentrev' => 'Güncel sürüm', |
451 | 451 | 'currentrevisionlink' => 'en güncel halini göster', |
452 | 452 | 'dateformat' => 'Tarih gösterimi', |
| 453 | +'datedefault' => 'Tercih yok', |
453 | 454 | 'datetime' => 'Tarih ve saat', |
454 | 455 | 'deadendpages' => 'Başka sayfalara bağlantısı olmayan sayfalar', |
455 | 456 | 'default' => 'orjinal', |
Index: trunk/phase3/languages/LanguageIa.php |
— | — | @@ -858,19 +858,6 @@ |
859 | 859 | return $wgSkinNamesIa; |
860 | 860 | } |
861 | 861 | |
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 | | - |
875 | 862 | function getMessage( $key ) { |
876 | 863 | global $wgAllMessagesIa, $wgAllMessagesEn; |
877 | 864 | $m = $wgAllMessagesIa[$key]; |
Index: trunk/phase3/languages/LanguageZh_cn.php |
— | — | @@ -924,6 +924,10 @@ |
925 | 925 | global $wgSkinNamesZh_cn; |
926 | 926 | return $wgSkinNamesZh_cn; |
927 | 927 | } |
| 928 | + |
| 929 | + function getDateFormats() { |
| 930 | + return false; |
| 931 | + } |
928 | 932 | |
929 | 933 | function date( $ts, $adj = false ) { |
930 | 934 | if ( $adj ) { $ts = $this->userAdjust( $ts ); } |
Index: trunk/phase3/languages/LanguageEo.php |
— | — | @@ -924,15 +924,13 @@ |
925 | 925 | } |
926 | 926 | |
927 | 927 | # 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 ); |
936 | 930 | } |
| 931 | + |
| 932 | + function formatDay( $day, $format ) { |
| 933 | + return parent::formatDay( $day, $format ) . '.'; |
| 934 | + } |
937 | 935 | |
938 | 936 | function getMessage( $key ) { |
939 | 937 | global $wgAllMessagesEo; |
Index: trunk/phase3/languages/LanguageEs.php |
— | — | @@ -1044,34 +1044,16 @@ |
1045 | 1045 | global $wgSkinNamesEs; |
1046 | 1046 | return $wgSkinNamesEs; |
1047 | 1047 | } |
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 ); |
1055 | 1051 | } |
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 ' '; |
1063 | 1055 | } |
| 1056 | + |
1064 | 1057 | |
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 | | - |
1076 | 1058 | function getMessage( $key ) { |
1077 | 1059 | global $wgAllMessagesEs; |
1078 | 1060 | if( isset( $wgAllMessagesEs[$key] ) ) { |
Index: trunk/phase3/languages/LanguageEt.php |
— | — | @@ -570,6 +570,7 @@ |
571 | 571 | "skin" => "Nahk", |
572 | 572 | "math" => "Valemite näitamine", |
573 | 573 | "dateformat" => "Kuupäeva formaat", |
| 574 | +'datedefault' => 'Eelistus puudub', |
574 | 575 | "math_failure" => "Arusaamatu süntaks", |
575 | 576 | "math_unknown_error" => "Tundmatu viga", |
576 | 577 | "math_unknown_function" => "Tundmatu funktsioon ", |
Index: trunk/phase3/languages/LanguageIs.php |
— | — | @@ -216,6 +216,7 @@ |
217 | 217 | 'currentrevisionlink' => "núverandi útgáfa", |
218 | 218 | 'databaseerror' => "Gagnagrunnsvilla", |
219 | 219 | 'dateformat' => "Tímasnið", |
| 220 | +'datedefault' => 'Sjálfgefið', |
220 | 221 | 'deadendpages' => "Botnlangar", |
221 | 222 | 'debug' => "Aflúsa", |
222 | 223 | 'dec' => "des", |
Index: trunk/phase3/languages/LanguageIt.php |
— | — | @@ -716,14 +716,9 @@ |
717 | 717 | global $wgQuickbarSettingsIt; |
718 | 718 | return $wgQuickbarSettingsIt; |
719 | 719 | } |
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 ); |
728 | 723 | } |
729 | 724 | |
730 | 725 | function getMessage( $key ) { |
Index: trunk/phase3/languages/LanguageNds.php |
— | — | @@ -1283,15 +1283,13 @@ |
1284 | 1284 | return $wgSkinNamesNds; |
1285 | 1285 | } |
1286 | 1286 | |
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 ); |
1295 | 1289 | } |
| 1290 | + |
| 1291 | + function formatDay( $day, $format ) { |
| 1292 | + return parent::formatDay( $day, $format ) . '.'; |
| 1293 | + } |
1296 | 1294 | |
1297 | 1295 | function getMessage( $key ) { |
1298 | 1296 | global $wgAllMessagesNds; |
Index: trunk/phase3/languages/LanguageBe.php |
— | — | @@ -553,26 +553,28 @@ |
554 | 554 | global $wgMagicWordsBe; |
555 | 555 | return $wgMagicWordsBe; |
556 | 556 | } |
| 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 | + } |
557 | 565 | |
558 | 566 | // 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 | + } |
564 | 577 | } |
565 | 578 | |
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 | | - |
577 | 579 | function getMessage( $key ) { |
578 | 580 | global $wgAllMessagesBe; |
579 | 581 | if( isset( $wgAllMessagesBe[$key] ) ) { |
Index: trunk/phase3/languages/LanguageJa.php |
— | — | @@ -597,6 +597,7 @@ |
598 | 598 | 'skin' => '外装', |
599 | 599 | 'math' => '数式の表記方法', |
600 | 600 | 'dateformat' => '日付の書式', |
| 601 | +'datedefault' => '2001年1月15日 16:12 (デフォルト)', |
601 | 602 | 'math_failure' => '構文解析失敗', |
602 | 603 | 'math_unknown_error' => '不明なエラー', |
603 | 604 | 'math_unknown_function' => '不明な関数', |