PBworks User Manual

 

Translator

You may have noticed a "Translate this page" drop down menu in the Sidebar of this workspace. 

By selecting the language you want the workspace translated into and clicking "Translate" the page is sent to Google for translation.

 

Here's how you can implement this translator for your own workspace.  Please review the requirements first to make sure you understand which workspaces can use this, and which members of the workspace can implement it.

 

Requirements

  • Your workspace must be publicly viewable:

    This means that nobody needs to log in to view pages.  Here's how your Workspace Security page must be set to use this Translator:

    This is necessary because the Google Translation service cannot translate the workspace if it requires a login to read the content.

  • You must be the Administrator of the workspace:

    The translator uses a little bit of Javascript, so you must be an Administrator on the workspace to implement it.  If you're not sure what role you have on the workspace, look in the upper right corner of the workspace, and see if you can see the "Settings" link.  If you can, then you are an administrator on the workspace, and can implement the Translator.

  • The best place for the translator is the Sidebar:

    You can technically place the translator anywhere, but the SideBar appears on every page, so that's the best place for it.  Additionally, you can't have two Translator plugins on the same page.

 

Installing the Translator

The translator has lots of code in it, so it requires you to place three HTML/Javascript plugins successively (with no gaps between).  The HTML/Javascript plugin has a length limit, so you need to embed all three code snippets exactly in the order that is described.

 

In the end, here's how the plugins look in Edit mode:

 

  1. While in edit mode on the SideBar, click the Insert Plugin button.
  2. Select the "HTML/Javascript" plugin in the "PBworks Magic" category.
  3. Insert the following code, when you're done, click the Preview button, and then OK.
    <form name="openlocation">
    <select name="href">
    <option value='en'>English</option>
    <option value='sq'>Albanian</option>
    <option value='ar'>Arabic</option>
    <option value='bg'>Bulgarian</option>
    <option value='ca'>Catalan</option>
    <option value='zh-CN'>Chinese-Simplified</option>
    <option value='zh-TW'>Chinese-Traditional</option>
    <option value='hr'>Croatian</option>
    <option value='cs'>Czech</option>
    <option value='da'>Danish</option>
    <option value='nl'>Dutch</option>
    <option value='et'>Estonian</option>
    <option value='tl'>Filipino</option>
    <option value='fi'>Finnish</option>
    <option value='fr'>French</option>
    <option value='gl'>Galician</option>
    <option value='de'>German</option>
    <option value='el'>Greek</option>
    <option value='iw'>Hebrew</option>
    <option value='hi'>Hindi</option>
    <option value='hu'>Hungarian</option>
    <option value='id'>Indonesian</option>
    <option value='it'>Italian</option>
    <option value='ja'>Japanese</option>
    <option value='ko'>Korean</option>
    <option value='lv'>Latvian</option>
    <option value='lt'>Lithuanian</option>
    <option value='mt'>Maltese</option>
    
  4. Then, while still in edit mode, place the cursor exactly after the plugin you just inserted.  Click Insert Plugin again and create the second HTML/Javascript Plugin with the folllowing code:
    <option value='nw'>Norwegian</option>
    <option value='pl'>Polish</option>
    <option value='pt'>Portuguese</option>
    <option value='ro'>Romanian</option>
    <option value='ru'>Russian</option>
    <option value='sr'>Serbian</option>
    <option value='sk'>Slovak</option>
    <option value='sl'>Slovenian</option>
    <option value='es'>Spanish</option>
    <option value='sv'>Swedish</option>
    <option value='th'>Thai</option>
    <option value='tr'>Turkish</option>
    <option value='uk'>Ukranian</option>
    <option value='vi'>Vietnamese</option>
    </select>
    
  5. Finally, create a third HTML/Javascript plugin with this code.  This code contains actual Javascript so you must check the "Allow Javascript" checkbox on this third plugin.
    <input type="button" value="Translate" onClick="location.href='http://translate.google.com/translate?prev=_t&hl=en&ie=UTF-8&u='+ location.href +'&sl=en&tl='+document.openlocation.href.value+'&history_state0=';">
    </form>
    
  6. Save the page with these three plugins.

 

If you're having trouble, please make sure you've checked the "Allow Javascript" box on the last plugin.  This will not work unless that checkbox is marked on the plugin made in step 5.