Blogger weekday translator

It’s been far too long since I did anything for Blogger (yeah, let’s skip the obvious reply to that), so by request, here’s a little javascript to translate the weekdays in Blogger’s BlogDateHeaderDate to whatever suits you.

Add to your main template, somewhere between <head> and </head>:

<script type="text/javascript">
function changeWeekday(dateheader){
  var splitDate = dateheader.split(",");
  weekday = splitDate[0];
  weekday = weekday.toLowerCase();
  switch (weekday){
    case "monday" :
      splitDate[0] = "Isilya";
    case "tuesday" :
      splitDate[0] = "Aldëa";
    case "wednesday" :
      splitDate[0] = "Menelya";
    case "thursday" :
      splitDate[0] = "Eärenya";
    case "friday" :
      splitDate[0] = "Valanya";
    case "saturday" :
      splitDate[0] = "Elenya";
    case "sunday" :
      splitDate[0] = "Anarya";
  var gluedDate = splitDate.join(",");  
  return gluedDate;

Then, in your <BlogDateHeader> section:

  <script type="text/javascript">

Change the translated weekdays to whatever suits you (if you need a double quote in the translation, use ” so it doesn’t prematurely end the string), save and publish, and you should see the translation with javascript enabled, and the original without javascript.


Comment by michel v #
2002-08-25 05:31:03

One could also just write some little PHP to parse Blogger’s Date/Time format (the one that’s like ’8/25/2002 5:25:45 AM’) to obtain the Unix timestamp, have $weekdays and $months arrays, and then write simple date() spin-off. So one could format their Blogger date just how they want it with a date() format string.
I have written such a thing for b2, users could use ’F’ in the format string and it would get the month from their $months array, for example, instead of looking on the server (which 99% times won’t have any locale except english).

I would write such a thing for Blogger, if I could save a little minutes for it.
But since I’m starting an english/portuguese blog on soon, I’ll have that script done for it and I’ll release the source for anyone who’d want it :)

Comment by Phil Ringnalda #
2002-08-25 09:07:07

Sounds great: I just did this in javascript since the request came from someone on Blog*Spot. Does have a Blog*Spot-equivalent? My Portuguese is so terrible (with a dictionary, I can answer really simple questions if there’s absolutely no slang involved) that I haven’t really looked at it.

Comment by michel v #
2002-08-25 11:10:23 is like Blogspot with Blogger Pro service, for free.
I need to find my portuguese book though, since this blog will be about my learning progresses ;)

Comment by michel v #
2002-08-25 11:12:05

Erm, now I hope we won’t see a migration of cheap users to just because of the free pro services -_-

Comment by jswiders #
2002-08-30 14:56:23

dude, your <pre> blocks look really weird in IE (6.0/Win2000). [Screenshot]

Comment by Phil Ringnalda #
2002-08-30 15:24:42

Cool, yet another thing that IE 6 can’t display. It’s funny that you don’t hear more about just how intolerably bug-ridden its CSS layout really is. (Displays just fine in Mozilla, Opera, and although some other parts look evil, the <pre> looks just fine in the copy of Netscape 4.5 that I keep around to annoy people with the number of NS4.x hits that their page gets.)

Oddly enough, although I see the same sort of effect in IE6/Win98, on my main machine with IE6/WinXP it displays just fine. So there’s your answer from Redmond: stop using an ancient operating system. You’re probably using old hardware, too: is your graphics card & driver more than three months old?

Too bad the browser wars are over, or Netscape 7 being released would mean that IE7 would be out shortly.

My three solutions to all the other various IE6 display problems seem to work with this as well: if there’s enough page to scroll it out of view and back in, that works, or either highlight it and then cancel the selection, or hit F11 twice (I presume you know which finger I use to press the key).

Name (required)
E-mail (required - never shown publicly)
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <del datetime="" cite=""> <dd> <dl> <dt> <em> <i> <ins datetime="" cite=""> <kbd> <li> <ol> <p> <pre> <q cite=""> <samp> <strong> <sub> <sup> <ul> in your comment.