A bookmarklet is a special type of bookmark that you can put in your bookmark toolbar. Our Pinyin Converter bookmarklet will allow you to quickly translate selected Chinese text from any webpage to Pinyin or Zhuyin.
To install, simply drag the link below into your bookmark toolbar. You can rename it to something different if you want.
Step 1: Add a Bookmark for this page
Step 2: Copy the Javascript
Copy the Javascript below.
javascript:(function()%7Bjavascript%3A(function()%7Bjavascript%3Aq%3D""%2B(window.getSelection%3Fwindow.getSelection()%3Adocument.getSelection%3Fdocument.getSelection()%3Adocument.selection.createRange().text)%3Bif(escape(q).indexOf("%25u")<0)%7Balert("Your selection doesn't have Chinese text")%3B%7Delse%7Bvar i%3Ddocument.createElement('iframe')%3Bi.setAttribute('name'%2C'frame-id')%3Bi.setAttribute('id'%2C'frame-id')%3Bi.setAttribute('allowtransparency'%2C'true')%3Bi.setAttribute('style'%2C'border%3A 0%3B width%3A 1px%3B height%3A 1px%3B position%3A absolute%3B left%3A 0%3B top%3A 0%3B')%3B document.body.appendChild(i)%3B
var%20ID%3Dfunction()%7Breturn%22xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%22.replace(%2F%5Bxy%5D%2Fg%2Cfunction(b)%7Bvar%20a%3D16*Math.random()%7C0%3Breturn(%22x%22%3D%3Db%3Fa%3Aa%263%7C8).toString(16)%7D)%7D%3B var uid %3D "https%3A%2F%2Fwww.purpleculture.net%2Fchinese-pinyin-converter%2F%3Fsession%3D"%2BID()%3B var html%3D''%2B'
Step 3: Edit Bookmark added in Step 1
Tap the Bookmarks button, navigate through your Bookmarks folders until you find the bookmark you just added. Click Edit, and paste the Javascript in the second field (no need to save, it's saved automatically).
That's it!
If the bookmarklet still doesn't appear, go to Safair Settings, then activate "Always Show Bookmarks Bar".
Select Chinese text on any webpage, click on the bookmarklet in your bookmark toolbar. You will be redirected to our Pinyin Converter page, with selected text converted.
View all news for Sunday 29 July, 2012 on one page