Pinyin Converter Bookmarklet

MONDAY 03 JUNE, 2013 | RSS Feed

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.

Install

To install, simply drag the link below into your bookmark toolbar. You can rename it to something different if you want.

Pinyin Converter
<-- Drag the left link into your bookmark toolbar.


Install on iPad/iPhone

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'
'%2B''%2B''%2B''%2B'<%2Fform>'%2B' var e%3DencodeURIComponent%2Cw%3Dwindow%2Cd%3Ddocument%2Cf%3Dd.getElementById('f')%3B"%2B"d.getElementById('iframe-form').submit()%3B"%2B'document.body.removeChild(document.getElementById("iframe-form"))%3B<%2Fscr'%2B"ipt><%2Fbody><%2Fhtml>"%3B window.frames%5B'frame-id'%5D.document.write(html)%3B %7Dvoid 0%7D)()%7D)()


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". 

How to Use

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.



Recent News

News archive