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%22%22%2B(window.getSelection%3Fwindow.getSelection()%3Adocument.getSelection%3Fdocument.getSelection()%3Adocument.selection.createRange().text)%3Bif(escape(q).indexOf(%22%25u%22)%3C0)%7Balert(%22Your%20selection%20doesn't%20have%20Chinese%20text%22)%3B%7Delse%7Bvar%20i%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%200%3B%20width%3A%201px%3B%20height%3A%201px%3B%20position%3A%20absolute%3B%20left%3A%200%3B%20top%3A%200%3B')%3B%20document.body.appendChild(i)%3B%20var%20ID%20%3D%20function%20()%20%7Breturn%20Math.random().toString(36).substr(2%2C%2032)%3B%7D%3B%20%20var%20uid%20%3D%20%22https%3A%2F%2Fwww.purpleculture.net%2Fchinese-pinyin-converter%2F%3Fsession%3D%22%2BID()%3B%20%20var%20html%3D'%3Chtml%3E%3Cbody%3E'%2B'%3Cform%20action%3D%22'%2Buid%2B'%22%20method%3D%22post%22%20id%3D%22iframe-form%22%20accept-charset%3D%22utf-8%22%20target%3D%22_blank%22%3E'%2B'%3Cinput%20type%3D%22hidden%22%20name%3D%22wdqchs%22%20value%3D%22'%2Bq%2B'%22%2F%3E'%2B'%3Cinput%20type%3D%22hidden%22%20name%3D%22convert%22%20value%3D%22y%22%2F%3E'%2B'%3Cinput%20type%3D%22hidden%22%20name%3D%22tone_type%22%20value%3D%22mark%22%2F%3E'%2B'%3C%2Fform%3E'%2B'%3Cscr'%2B%22ipt%3E%20var%20e%3DencodeURIComponent%2Cw%3Dwindow%2Cd%3Ddocument%2Cf%3Dd.getElementById('f')%3B%22%2B%22d.getElementById('iframe-form').submit()%3B%22%2B'document.body.removeChild(document.getElementById(%22iframe-form%22))%3B%3C%2Fscr'%2B%22ipt%3E%3C%2Fbody%3E%3C%2Fhtml%3E%22%3B%20window.frames%5B'frame-id'%5D.document.write(html)%3B%20%20%7Dvoid%200%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