[wp-hackers] Weekday abbreviations and localization

Luca Lizzeri luca.lizzeri at ngi.it
Thu Jul 1 09:23:36 UTC 2004


Ryan,

>That's a known bug that I really need to get around to fixing.  That
>hack does not work for multi-byte languages.
>  
>
So, would this be better, or is mb_substr not deployed widely enough ?

--- template-functions-general.php.orig	2004-06-14 17:05:00.000000000 +0200
+++ template-functions-general.php	2004-07-01 11:20:35.703125000 +0200
@@ -367,13 +367,8 @@
     <thead>
     <tr>';
 
-    $day_abbrev = $weekday_initial;
-    if ($daylength > 1) {
-        $day_abbrev = $weekday_abbrev;
-    }
-
     foreach ($weekday as $wd) {
-        echo "\n\t\t<th abbr=\"$wd\" scope=\"col\" title=\"$wd\">" . $day_abbrev[$wd] . '</th>';
+        echo "\n\t\t<th abbr=\"$wd\" scope=\"col\" title=\"$wd\">" . mb_substr($wd, 0, 1) . '</th>';
     }
 
     echo '


Cheers,
    Luca Lizzeri



More information about the hackers mailing list