Home | Max's Wish List | Contact Information
on the web since 1993
Max's Home Page > 한국 블로그

May 19, 2005

Instant word translations

Due to overwhelming popular demand (well, um, three people are vaguely curious), here's how to get the instant translation thing going on your own site. There are similar services like popjisyo that provide pop-up dictionary definitions, but the main advantange of embedding the translation yourself is that it's contextual.

Consequently, 한국어를 할수있다 and people can still understand even if they can't read any Korean. (It should work with any other writing system as well.)

Step 1: In the <head> section of your HTML, insert this:

<script language="JavaScript" src="http://www.max.tc/bi.js"></script>
It must be present on every page that uses the translations; bloggers can achieve this by modifying their templates.

Step 2: When you want to do a translation, this is the syntax:

<span onmouseover="biling(this,'ENGLISH')">KOREAN</span>
For example:
<span onmouseover="biling(this,'book')">책</span>

There are some bugs -- as I recall, the English mustn't contain any spaces (you can use dashes instead, or multiple SPANs with spaces between them), and lines must be kept short so that none of the SPANs get word-wrapped, or else it goes crazy. Your mileage may vary!

The code is free with the proviso that any modifications are contributed back here for the benefit of myself and other users.

Posted by Max at May 19, 2005 09:08 AM | TrackBack
독자의견
여기에 독자의견를 주새요.