diff --git a/wp-includes/locale.php b/wp-includes/locale.php index 379d8797e2..5a699412ea 100644 --- a/wp-includes/locale.php +++ b/wp-includes/locale.php @@ -10,6 +10,25 @@ $weekday[4] = __('Thursday'); $weekday[5] = __('Friday'); $weekday[6] = __('Saturday'); +// The first letter of each day. Note that marking single characters for +// translation is useless, but here it is. +$weekday_initial['Sunday'] = __('S'); +$weekday_initial['Monday'] = __('M'); +$weekday_initial['Tuesday'] = __('T'); +$weekday_initial['Wednesday'] = __('W'); +$weekday_initial['Thursday'] = __('T'); +$weekday_initial['Friday'] = __('F'); +$weekday_initial['Saturday'] = __('S'); + +// Abbreviations for each day. +$weekday_abbrev['Sunday'] = __('Sun'); +$weekday_abbrev['Monday'] = __('Mon'); +$weekday_abbrev['Tuesday'] = __('Tue'); +$weekday_abbrev['Wednesday'] = __('Wed'); +$weekday_abbrev['Thursday'] = __('Thu'); +$weekday_abbrev['Friday'] = __('Fri'); +$weekday_abbrev['Saturday'] = __('Sat'); + // The Months $month['01'] = __('January'); $month['02'] = __('February'); @@ -23,4 +42,18 @@ $month['09'] = __('September'); $month['10'] = __('October'); $month['11'] = __('November'); $month['12'] = __('December'); + +// Abbreviations for each month. +$month_abbrev['January'] = __('Jan'); +$month_abbrev['February'] = __('Feb'); +$month_abbrev['March'] = __('Mar'); +$month_abbrev['April'] = __('Apr'); +$month_abbrev['May'] = __('May'); +$month_abbrev['June'] = __('Jun'); +$month_abbrev['July'] = __('Jul'); +$month_abbrev['August'] = __('Aug'); +$month_abbrev['September'] = __('Sep'); +$month_abbrev['October'] = __('Oct'); +$month_abbrev['November'] = __('Nov'); +$month_abbrev['December'] = __('Dec'); ?> \ No newline at end of file diff --git a/wp-includes/template-functions-general.php b/wp-includes/template-functions-general.php index 511d675bcf..6dd838960e 100644 --- a/wp-includes/template-functions-general.php +++ b/wp-includes/template-functions-general.php @@ -307,7 +307,7 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after } function get_calendar($daylength = 1) { - global $wpdb, $m, $monthnum, $year, $timedifference, $month, $weekday, $tableposts, $posts; + global $wpdb, $m, $monthnum, $year, $timedifference, $month, $month_abbrev, $weekday, $weekday_initial, $weekday_abbrev, $tableposts, $posts; // Quick check. If we have no posts at all, abort! if (!$posts) { @@ -367,8 +367,14 @@ function get_calendar($daylength = 1) { ' . $month[zeroise($thismonth, 2)] . ' ' . date('Y', $unixmonth) . ' '; + + $day_abbrev = $weekday_initial; + if ($daylength > 1) { + $day_abbrev = $weekday_abbrev; + } + foreach ($weekday as $wd) { - echo "\n\t\t" . substr($wd, 0, $daylength) . ''; + echo "\n\t\t" . $day_abbrev[$wd] . ''; } echo ' @@ -380,8 +386,7 @@ function get_calendar($daylength = 1) { if ($previous) { echo "\n\t\t".'« ' . substr($month[zeroise($previous->month, 2)], 0, 3) . ''; + get_month_link($previous->year, $previous->month) . '" title="' . sprintf(__('View posts for %1$s %2$s'), $month[zeroise($previous->month, 2)], date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year))) . '">« ' . $month_abbrev[$month[zeroise($previous->month, 2)]] . ''; } else { echo "\n\t\t".' '; }