Author Topic: Dual translator sidebar for Opera!  (Read 379 times)

Offline Ɗα√ϵς§

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5524
  • PCLinuxOS: A revolution in personal computing
Dual translator sidebar for Opera!
« on: June 20, 2012, 08:01:11 AM »
If you try to enclose Google Translate in a frame now, it will not work - so I came up with something!

IM translator is a Firefox extension, but the URL can be called from any browser so this is what I did:

I created 3 files in the same directory, this is the first one, called sidebar-enes.html

Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>Google Translate 2-pane</TITLE>
</HEAD>
  <BODY>
<!-- Begin Widget Translator 335x390 -->

<script type="text/javascript">
var dir="en/es";
var loc="en";
</script>
<div id="TranslatorBuilder"><a href="http://imtranslator.net/translation/" id="ImTranslator" target="_top" title="Translator - imtranslator.net">Translator</a><div id=ImBack></div></div>
<script type="text/javascript" src="http://imtranslator.net/translation/webmaster/wm-im-335x390.js"></script>

<!-- End Widget Translator 335x390 -->

</BODY>
</HTML>

The second one was the same, except the line starting var dir= was different, I called this sidebar-esen.html:

Code: [Select]
var dir="es/en";

The lines starting val dir define the input and output language - the lines starting var loc define the interface language. They can be changed once the site is running. You should experiment and try with other codes for the languages you want.

The third file, I called it sidebar-trans.html and here is the code for that:

Code: [Select]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>Google Translate 2-pane</TITLE>
</HEAD>
  <FRAMESET rows="50%, 50%">
      <FRAME src="sidebar-enes.html">
      <FRAME src="sidebar-esen.html">
  </FRAMESET>
</HTML>


Now all you have to do is ensure that all three files are in the same folder, and in Opera, click on the plus sign on the left to add a new Web Panel - when prompted, type in the full path and file name to sidebar-trans.html, and hey presto, a dual panel translator on a pop-up sidebar!
« Last Edit: June 20, 2012, 08:03:10 AM by Ɗα√ϵς§ »
PCLinuxOS has no wealthy sponsors and can only survive with your donations! Don't wait it might be too late.

Running PCLOS on Athlon II/250 with 2Gb Ram using ASUS M2N68-AM Plus Mobo with Nvidia GF7600GT graphics, and Samsung NC10 Netbook

Offline longtom

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3342
  • Satellite Station Africa
Re: Dual translator sidebar for Opera!
« Reply #1 on: June 21, 2012, 01:51:30 AM »
and works like a bomb.  Thanks buddy!! :)
Regards longtom

PCLinuxOS KDE 32bit
Intel Core 2 Duo E2200 / 2.2 GHz
2GB Ram
Nvidia GT610