November 24, 2011

Now with translation!

I "fiddled" around with the blog today because I have a lot of visitors from outside the US.  What I needed was an easy way to translate the blog for these visitors.

While I like the end result, the journey to get there was interesting.  I found some snippets of code that were very easy to plug in.  There were some good supporting graphics as well, but I went with what I thought looked best.  Big mistake.  In trying out that code I translated the page into Yiddish and I couldn't quickly get it translated back.  There was no "back" button or methodology to revert things back to the original.  The best I could do is translate it back into English.

This can lead to hilarious results, but I was too concerned with the blog to look for any.  If you ever get the chance, I highly recommend a little translation fun by getting a copy of Monty Python and the Holy Grail....in Japanese.  Switch on the English subtitles and be prepared to laugh your ass off in a whole new way.  This was available on the Laser Disc and I don't know if it is on any particular DVD release.  Evidently they decided to include English subtitles as an after-thought and instead of simply using the original text, they quickly translated the Japanese back into English, butchering it in the process.

Once I deleted the translation script I poked around a bit to see what other people were using.  Why reinvent the wheel if you don't have to?  Looking at the source code from Blogography I noticed Dave used pretty much the same translator my earlier code snippet used, just written up much cleaner.  I borrowed his code and tried it out, and of course it worked for me as well as it did on his site, including being able to revert back to the original.  Now I'm not a straight-up code thief here.  What Dave has is freely available straight from Google.  If you did happen to pop onto my blog while I was screwing around for about 20-30 minutes you might have seen part of a graphic that was from his page.  Until I "fixed" my translation code snippet and placed an appropriate graphic, his was on my site.

Odds are nobody ever saw that page, or even noticed, but that isn't the point.


No comments: