moved weekday, monthname etc to AllMessages arrays.
authorJens Frank <jeluf@users.mediawiki.org>
Sat, 17 Jul 2004 15:46:22 +0000 (15:46 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Sat, 17 Jul 2004 15:46:22 +0000 (15:46 +0000)
languages/Language.php
languages/LanguageDe.php
languages/LanguageFr.php
languages/LanguageZh.php

index feb4487..84f483f 100644 (file)
@@ -130,19 +130,20 @@ $wgLanguageNamesEn =& $wgLanguageNames;
 
 
 /* private */ $wgWeekdayNamesEn = array(
-       'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
-       'Friday', 'Saturday'
+       'sunday', 'monday', 'tuesday', 'wednesday', 'thursday',
+       'friday', 'saturday'
 );
 
+
 /* private */ $wgMonthNamesEn = array(
-       'January', 'February', 'March', 'April', 'May', 'June',
-       'July', 'August', 'September', 'October', 'November',
-       'December'
+       'january', 'february', 'march', 'april', 'may', 'june',
+       'july', 'august', 'september', 'october', 'november',
+       'december'
 );
 
 /* private */ $wgMonthAbbreviationsEn = array(
-       'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
-       'Sep', 'Oct', 'Nov', 'Dec'
+       'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug',
+       'sep', 'oct', 'nov', 'dec'
 );
 
 # Note to translators:
@@ -205,6 +206,38 @@ $wgLanguageNamesEn =& $wgLanguageNames;
 
 /* private */ $wgAllMessagesEn = array(
 
+# dates
+'sunday' => 'Sunday', 
+'monday' => 'Monday',
+'tuesday' => 'Tuesday',
+'wednesday' => 'Wednesday',
+'thursday' => 'Thursday',
+'friday' => 'Friday',
+'saturday' => 'Saturday',
+'january' => 'January',
+'february' => 'February',
+'march' => 'March',
+'april' => 'April',
+'may' => 'May',
+'june' => 'June',
+'july' => 'July',
+'august' => 'August',
+'september' => 'September',
+'october' => 'October',
+'november' => 'November',
+'december' => 'December',
+'jan' => 'Jan',
+'feb' => 'Feb',
+'mar' => 'Mar',
+'apr' => 'Apr',
+'may' => 'May',
+'jun' => 'Jun',
+'jul' => 'Jul',
+'aug' => 'Aug',
+'sep' => 'Sep',
+'oct' => 'Oct',
+'nov' => 'Nov',
+'dec' => 'Dec',
 # Bits of text used by many pages:
 #
 'categories' => 'Categories',
@@ -1485,7 +1518,7 @@ class Language {
        function getMonthName( $key )
        {
                global $wgMonthNamesEn;
-               return $wgMonthNamesEn[$key-1];
+               return wfMsg($wgMonthNamesEn[$key-1]);
        }
 
        /* by default we just return base form */
@@ -1497,13 +1530,13 @@ class Language {
        function getMonthAbbreviation( $key )
        {
                global $wgMonthAbbreviationsEn;
-               return @$wgMonthAbbreviationsEn[$key-1];
+               return wfMsg(@$wgMonthAbbreviationsEn[$key-1]);
        }
 
        function getWeekdayName( $key )
        {
                global $wgWeekdayNamesEn;
-               return $wgWeekdayNamesEn[$key-1];
+               return wfMsg($wgWeekdayNamesEn[$key-1]);
        }
 
        function userAdjust( $ts )
index 30cdc60..063ab4b 100644 (file)
@@ -79,21 +79,6 @@ if($wgMetaNamespace === FALSE)
        "Lehmanns Fachbuchhandlung" => "http://www.lob.de/cgi-bin/work/suche?flag=new&stich1=$1",
 );
 
-/* private */ $wgWeekdayNamesDe = array(
-       "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag",
-       "Freitag", "Samstag"
-);
-
-/* private */ $wgMonthNamesDe = array(
-       "Januar", "Februar", "März", "April", "Mai", "Juni",
-       "Juli", "August", "September", "Oktober", "November",
-       "Dezember"
-);
-
-/* private */ $wgMonthAbbreviationsDe = array(
-       "Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug",
-       "Sep", "Okt", "Nov", "Dez"
-);
 
 /* private */ $wgValidSpecialPagesDe = array(
   "Userlogin"           => "",
@@ -144,6 +129,39 @@ if($wgMetaNamespace === FALSE)
 );
 
 /* private */ $wgAllMessagesDe = array(
+# Dates
+'sunday' => "Sonntag",
+'monday' => "Montag",
+'tuesday' => "Dienstag",
+'wednesday' => "Mittwoch",
+'thursday' => "Donnerstag",
+'friday' => "Freitag",
+'saturday' => "Samstag",
+'january' => "Januar",
+'february' => "Februar",
+'march' => "März",
+'april' => "April",
+'may' => "Mai",
+'june' => "Juni",
+'july' => "Juli",
+'august' => "August",
+'september' => "September",
+'october' => "Oktober",
+'november' => "November",
+'december' => "Dezember",
+'jan' => "Jan",
+'feb' => "Feb",
+'mar' => "Mär",
+'apr' => "Apr",
+'may' => "Mai",
+'jun' => "Jun",
+'jul' => "Jul",
+'aug' => "Aug",
+'sep' => "Sep",
+'oct' => "Okt",
+'nov' => "Nov",
+'dec' => "Dez",
+
 
 # Bits of text used by many pages:
 #
@@ -1210,24 +1228,6 @@ class LanguageDe extends LanguageUtf8 {
                return $wgUserTogglesDe;
        }
 
-       function getMonthName( $key )
-       {
-               global $wgMonthNamesDe;
-               return $wgMonthNamesDe[$key-1];
-       }
-
-       function getMonthAbbreviation( $key )
-       {
-               global $wgMonthAbbreviationsDe;
-               return $wgMonthAbbreviationsDe[$key-1];
-       }
-
-       function getWeekdayName( $key )
-       {
-               global $wgWeekdayNamesDe;
-               return $wgWeekdayNamesDe[$key-1];
-       }
-
        # Inherit userAdjust()
  
        function date( $ts, $adj = false )
index 54595d2..32510d9 100644 (file)
@@ -72,21 +72,6 @@ require_once( "LanguageUtf8.php" );
        "chapitre.com"  => "http://www.chapitre.com/frame_rec.asp?isbn=$1",
 );
 
-/* private */ $wgWeekdayNamesFr = array(
-       "dimanche", "lundi", "mardi", "mercredi", "jeudi",
-       "vendredi", "samedi"
-);
-
-/* private */ $wgMonthNamesFr = array(
-       "janvier", "février", "mars", "avril", "mai", "juin",
-       "juillet", "août", "septembre", "octobre", "novembre",
-       "décembre"
-);
-
-/* private */ $wgMonthAbbreviationsFr = array(
-       "jan", "fév", "mar", "avr", "mai", "jun", "jul", "aoû",
-       "sep", "oct", "nov", "déc"
-);
 
 // All special pages have to be listed here: a description of ""
 // will make them not show up on the "Special Pages" page, which
@@ -144,6 +129,40 @@ require_once( "LanguageUtf8.php" );
 );
 
 /* private */ $wgAllMessagesFr = array(
+# Dates
+
+'sunday' => "dimanche",
+'monday' => "lundi",
+'tuesday' => "mardi",
+'wednesday' => "mercredi",
+'thursday' => "jeudi",
+'friday' => "vendredi",
+'saturday' => "samedi",
+'january' => "janvier",
+'february' => "février",
+'march' => "mars",
+'april' => "avril",
+'may' => "mai",
+'june' => "juin",
+'july' => "juillet",
+'august' => "août",
+'september' => "septembre",
+'october' => "octobre",
+'november' => "novembre",
+'december' => "décembre",
+'jan' => "jan",
+'feb' => "fév",
+'mar' => "mar",
+'apr' => "avr",
+'may' => "mai",
+'jun' => "jun",
+'jul' => "jul",
+'aug' => "aoû",
+'sep' => "sep",
+'oct' => "oct",
+'nov' => "nov",
+'dec' => "déc",
+
 
 # Bits of text used by many pages:
 #
@@ -1215,24 +1234,6 @@ class LanguageFr extends LanguageUtf8
                return $wgUserTogglesFr;
        }
 
-       function getMonthName( $key )
-       {
-               global $wgMonthNamesFr;
-               return $wgMonthNamesFr[$key-1];
-       }
-
-       function getMonthAbbreviation( $key )
-       {
-               global $wgMonthAbbreviationsFr;
-               return $wgMonthAbbreviationsFr[$key-1];
-       }
-
-       function getWeekdayName( $key )
-       {
-               global $wgWeekdayNamesFr;
-               return $wgWeekdayNamesFr[$key-1];
-       }
-
        // Inherit userAdjust()
 
        function date( $ts, $adj = false )
index 0c9e0e2..404b238 100644 (file)
@@ -92,29 +92,6 @@ this</a> (alternative: like this<a href=\"\" class=\"internal\">?</a>).", */
        "Amazon.com" => "http://www.amazon.com/exec/obidos/ISBN=$1"
 );
 
-/* private */ $wgWeekdayNamesZh = array(
-        "星期日", "星期一", "星期二", "星期三", "星期四",
-       "星期五", "星期六"
-/* "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
-       "Friday", "Saturday" */
-);
-
-/* private */ $wgMonthNamesZh = array(
-        "1月", "2月", "3月", "4月", "5月", "6月",
-       "7月", "8月", "9月", "10月", "11月",
-       "12月"
-/* "January", "February", "March", "April", "May", "June",
-   "July", "August", "September", "October", "November",
-       "December" */
-);
-
-/* private */ $wgMonthAbbreviationsZh = array(
-"1月", "2月", "3月", "4月", "5月", "6月",
-       "7月", "8月", "9月", "10月", "11月",
-       "12月"
-/* "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
-       "Sep", "Oct", "Nov", "Dec" */
-);
 
 # All special pages have to be listed here: a description of ""
 # will make them not show up on the "Special Pages" page, which
@@ -181,6 +158,39 @@ this</a> (alternative: like this<a href=\"\" class=\"internal\">?</a>).", */
 );
 
 /* private */ $wgAllMessagesZh = array(
+# Dates
+
+'sunday' => "星期日",
+'monday' => "星期一",
+'tuesday' => "星期二",
+'wednesday' => "星期三",
+'thursday' => "星期四",
+'friday' => "星期五",
+'saturday' => "星期六",
+'january' => "1月",
+'february' => "2月",
+'march' => "3月",
+'april' => "4月",
+'may' => "5月",
+'june' => "6月",
+'july' => "7月",
+'august' => "8月",
+'september' => "9月",
+'october' => "10月",
+'november' => "11月",
+'december' => "12月",
+'jan' => "1月",
+'feb' => "2月",
+'mar' => "3月",
+'apr' => "4月",
+'may' => "5月",
+'jun' => "6月",
+'jul' => "7月",
+'aug' => "8月",
+'sep' => "9月",
+'oct' => "10月",
+'nov' => "11月",
+'dec' => "12月",
 
 # Bits of text used by many pages:
 #
@@ -1003,31 +1013,6 @@ class LanguageZh extends LanguageUtf8 {
                return $wgUserTogglesZh;
        }
 
-       function getMonthName( $key )
-       {
-               global $wgMonthNamesZh;
-               return $wgMonthNamesZh[$key-1];
-       }
-
-       /* by default we just return base form */
-       function getMonthNameGen( $key )
-       {
-               global $wgMonthNamesZh;
-               return $wgMonthNamesZh[$key-1];
-       }
-
-       function getMonthAbbreviation( $key )
-       {
-               global $wgMonthAbbreviationsZh;
-               return $wgMonthAbbreviationsZh[$key-1];
-       }
-
-       function getWeekdayName( $key )
-       {
-               global $wgWeekdayNamesZh;
-               return $wgWeekdayNamesZh[$key-1];
-       }
-
 # The date and time functions can be tweaked if need be
 
        # inherit userAdjust()