Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -36,6 +36,9 @@ |
37 | 37 | * Most presentational html attributes like valign are now converted to inline |
38 | 38 | css style rules. These attributes were removed from html5 and so we clean them up |
39 | 39 | when $wgHtml5 is enabled. This can be disabled using $wgCleanupPresentationalAttributes. |
| 40 | +* Magic words (time and number-formatting ones, plus DIRECTIONMARK, but not NAMESPACE) |
| 41 | + now depend on the page content language instead of the site language. In theory |
| 42 | + this sets the right magic words in system messages, although they are not used there. |
40 | 43 | |
41 | 44 | === Bug fixes in 1.19 === |
42 | 45 | * $wgUploadNavigationUrl should be used for file redlinks if |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -2694,48 +2694,50 @@ |
2695 | 2695 | date_default_timezone_set( $oldtz ); |
2696 | 2696 | } |
2697 | 2697 | |
| 2698 | + $pageLang = $this->getFunctionLang(); |
| 2699 | + |
2698 | 2700 | switch ( $index ) { |
2699 | 2701 | case 'currentmonth': |
2700 | | - $value = $wgContLang->formatNum( gmdate( 'm', $ts ) ); |
| 2702 | + $value = $pageLang->formatNum( gmdate( 'm', $ts ) ); |
2701 | 2703 | break; |
2702 | 2704 | case 'currentmonth1': |
2703 | | - $value = $wgContLang->formatNum( gmdate( 'n', $ts ) ); |
| 2705 | + $value = $pageLang->formatNum( gmdate( 'n', $ts ) ); |
2704 | 2706 | break; |
2705 | 2707 | case 'currentmonthname': |
2706 | | - $value = $wgContLang->getMonthName( gmdate( 'n', $ts ) ); |
| 2708 | + $value = $pageLang->getMonthName( gmdate( 'n', $ts ) ); |
2707 | 2709 | break; |
2708 | 2710 | case 'currentmonthnamegen': |
2709 | | - $value = $wgContLang->getMonthNameGen( gmdate( 'n', $ts ) ); |
| 2711 | + $value = $pageLang->getMonthNameGen( gmdate( 'n', $ts ) ); |
2710 | 2712 | break; |
2711 | 2713 | case 'currentmonthabbrev': |
2712 | | - $value = $wgContLang->getMonthAbbreviation( gmdate( 'n', $ts ) ); |
| 2714 | + $value = $pageLang->getMonthAbbreviation( gmdate( 'n', $ts ) ); |
2713 | 2715 | break; |
2714 | 2716 | case 'currentday': |
2715 | | - $value = $wgContLang->formatNum( gmdate( 'j', $ts ) ); |
| 2717 | + $value = $pageLang->formatNum( gmdate( 'j', $ts ) ); |
2716 | 2718 | break; |
2717 | 2719 | case 'currentday2': |
2718 | | - $value = $wgContLang->formatNum( gmdate( 'd', $ts ) ); |
| 2720 | + $value = $pageLang->formatNum( gmdate( 'd', $ts ) ); |
2719 | 2721 | break; |
2720 | 2722 | case 'localmonth': |
2721 | | - $value = $wgContLang->formatNum( $localMonth ); |
| 2723 | + $value = $pageLang->formatNum( $localMonth ); |
2722 | 2724 | break; |
2723 | 2725 | case 'localmonth1': |
2724 | | - $value = $wgContLang->formatNum( $localMonth1 ); |
| 2726 | + $value = $pageLang->formatNum( $localMonth1 ); |
2725 | 2727 | break; |
2726 | 2728 | case 'localmonthname': |
2727 | | - $value = $wgContLang->getMonthName( $localMonthName ); |
| 2729 | + $value = $pageLang->getMonthName( $localMonthName ); |
2728 | 2730 | break; |
2729 | 2731 | case 'localmonthnamegen': |
2730 | | - $value = $wgContLang->getMonthNameGen( $localMonthName ); |
| 2732 | + $value = $pageLang->getMonthNameGen( $localMonthName ); |
2731 | 2733 | break; |
2732 | 2734 | case 'localmonthabbrev': |
2733 | | - $value = $wgContLang->getMonthAbbreviation( $localMonthName ); |
| 2735 | + $value = $pageLang->getMonthAbbreviation( $localMonthName ); |
2734 | 2736 | break; |
2735 | 2737 | case 'localday': |
2736 | | - $value = $wgContLang->formatNum( $localDay ); |
| 2738 | + $value = $pageLang->formatNum( $localDay ); |
2737 | 2739 | break; |
2738 | 2740 | case 'localday2': |
2739 | | - $value = $wgContLang->formatNum( $localDay2 ); |
| 2741 | + $value = $pageLang->formatNum( $localDay2 ); |
2740 | 2742 | break; |
2741 | 2743 | case 'pagename': |
2742 | 2744 | $value = wfEscapeWikiText( $this->mTitle->getText() ); |
— | — | @@ -2860,68 +2862,68 @@ |
2861 | 2863 | $value = ( wfUrlencode( $this->mTitle->getSubjectNsText() ) ); |
2862 | 2864 | break; |
2863 | 2865 | case 'currentdayname': |
2864 | | - $value = $wgContLang->getWeekdayName( gmdate( 'w', $ts ) + 1 ); |
| 2866 | + $value = $pageLang->getWeekdayName( gmdate( 'w', $ts ) + 1 ); |
2865 | 2867 | break; |
2866 | 2868 | case 'currentyear': |
2867 | | - $value = $wgContLang->formatNum( gmdate( 'Y', $ts ), true ); |
| 2869 | + $value = $pageLang->formatNum( gmdate( 'Y', $ts ), true ); |
2868 | 2870 | break; |
2869 | 2871 | case 'currenttime': |
2870 | | - $value = $wgContLang->time( wfTimestamp( TS_MW, $ts ), false, false ); |
| 2872 | + $value = $pageLang->time( wfTimestamp( TS_MW, $ts ), false, false ); |
2871 | 2873 | break; |
2872 | 2874 | case 'currenthour': |
2873 | | - $value = $wgContLang->formatNum( gmdate( 'H', $ts ), true ); |
| 2875 | + $value = $pageLang->formatNum( gmdate( 'H', $ts ), true ); |
2874 | 2876 | break; |
2875 | 2877 | case 'currentweek': |
2876 | 2878 | # @bug 4594 PHP5 has it zero padded, PHP4 does not, cast to |
2877 | 2879 | # int to remove the padding |
2878 | | - $value = $wgContLang->formatNum( (int)gmdate( 'W', $ts ) ); |
| 2880 | + $value = $pageLang->formatNum( (int)gmdate( 'W', $ts ) ); |
2879 | 2881 | break; |
2880 | 2882 | case 'currentdow': |
2881 | | - $value = $wgContLang->formatNum( gmdate( 'w', $ts ) ); |
| 2883 | + $value = $pageLang->formatNum( gmdate( 'w', $ts ) ); |
2882 | 2884 | break; |
2883 | 2885 | case 'localdayname': |
2884 | | - $value = $wgContLang->getWeekdayName( $localDayOfWeek + 1 ); |
| 2886 | + $value = $pageLang->getWeekdayName( $localDayOfWeek + 1 ); |
2885 | 2887 | break; |
2886 | 2888 | case 'localyear': |
2887 | | - $value = $wgContLang->formatNum( $localYear, true ); |
| 2889 | + $value = $pageLang->formatNum( $localYear, true ); |
2888 | 2890 | break; |
2889 | 2891 | case 'localtime': |
2890 | | - $value = $wgContLang->time( $localTimestamp, false, false ); |
| 2892 | + $value = $pageLang->time( $localTimestamp, false, false ); |
2891 | 2893 | break; |
2892 | 2894 | case 'localhour': |
2893 | | - $value = $wgContLang->formatNum( $localHour, true ); |
| 2895 | + $value = $pageLang->formatNum( $localHour, true ); |
2894 | 2896 | break; |
2895 | 2897 | case 'localweek': |
2896 | 2898 | # @bug 4594 PHP5 has it zero padded, PHP4 does not, cast to |
2897 | 2899 | # int to remove the padding |
2898 | | - $value = $wgContLang->formatNum( (int)$localWeek ); |
| 2900 | + $value = $pageLang->formatNum( (int)$localWeek ); |
2899 | 2901 | break; |
2900 | 2902 | case 'localdow': |
2901 | | - $value = $wgContLang->formatNum( $localDayOfWeek ); |
| 2903 | + $value = $pageLang->formatNum( $localDayOfWeek ); |
2902 | 2904 | break; |
2903 | 2905 | case 'numberofarticles': |
2904 | | - $value = $wgContLang->formatNum( SiteStats::articles() ); |
| 2906 | + $value = $pageLang->formatNum( SiteStats::articles() ); |
2905 | 2907 | break; |
2906 | 2908 | case 'numberoffiles': |
2907 | | - $value = $wgContLang->formatNum( SiteStats::images() ); |
| 2909 | + $value = $pageLang->formatNum( SiteStats::images() ); |
2908 | 2910 | break; |
2909 | 2911 | case 'numberofusers': |
2910 | | - $value = $wgContLang->formatNum( SiteStats::users() ); |
| 2912 | + $value = $pageLang->formatNum( SiteStats::users() ); |
2911 | 2913 | break; |
2912 | 2914 | case 'numberofactiveusers': |
2913 | | - $value = $wgContLang->formatNum( SiteStats::activeUsers() ); |
| 2915 | + $value = $pageLang->formatNum( SiteStats::activeUsers() ); |
2914 | 2916 | break; |
2915 | 2917 | case 'numberofpages': |
2916 | | - $value = $wgContLang->formatNum( SiteStats::pages() ); |
| 2918 | + $value = $pageLang->formatNum( SiteStats::pages() ); |
2917 | 2919 | break; |
2918 | 2920 | case 'numberofadmins': |
2919 | | - $value = $wgContLang->formatNum( SiteStats::numberingroup( 'sysop' ) ); |
| 2921 | + $value = $pageLang->formatNum( SiteStats::numberingroup( 'sysop' ) ); |
2920 | 2922 | break; |
2921 | 2923 | case 'numberofedits': |
2922 | | - $value = $wgContLang->formatNum( SiteStats::edits() ); |
| 2924 | + $value = $pageLang->formatNum( SiteStats::edits() ); |
2923 | 2925 | break; |
2924 | 2926 | case 'numberofviews': |
2925 | | - $value = $wgContLang->formatNum( SiteStats::views() ); |
| 2927 | + $value = $pageLang->formatNum( SiteStats::views() ); |
2926 | 2928 | break; |
2927 | 2929 | case 'currenttimestamp': |
2928 | 2930 | $value = wfTimestamp( TS_MW, $ts ); |
— | — | @@ -2948,7 +2950,7 @@ |
2949 | 2951 | case 'stylepath': |
2950 | 2952 | return $wgStylePath; |
2951 | 2953 | case 'directionmark': |
2952 | | - return $wgContLang->getDirMark(); |
| 2954 | + return $pageLang->getDirMark(); |
2953 | 2955 | case 'contentlanguage': |
2954 | 2956 | global $wgLanguageCode; |
2955 | 2957 | return $wgLanguageCode; |