Click to See Complete Forum and Search --> : Integrating translation pages into frames website


Iain MacInnes
02-05-2003, 11:19 AM
I have been trying to integrate translated pages into my frames website - I have managed to have the main (main.htm) page translated but it is placed in the header frame.
How do I get the translated page to display in the main frame??

<script language="javascript">
function translate(l)
{

window.location = "http://fets3.freetranslation.com/?Sequence=core&Language=English/"+l+"&Url="+"http://www.ceolmor-software.com/CeolMor_files/main.htm";


}


<map name="FPMap0">
<area href="javascript:translate('French')" alt="Translate to French" shape="rect" coords="13, 0, 44, 23">
<area href="javascript:translate('German')" alt="Translate to German" shape="rect" coords="49, 0, 82, 23">
<area href="javascript:translate('Italian')" alt="Translate to Italian" shape="rect" coords="87, 0, 118, 23">
<area href="javascript:translate('Portuguese')" alt="Translate to Portuguese" shape="rect" coords="119, 0, 152, 23">
<area href="javascript:translate('Spanish')" alt="Translate to Spanish" shape="rect" coords="154, 0, 187, 23"></map>

<img border="0" src="header_files/flags.gif" usemap="#FPMap0" width="199" height="37">

Sergey Smirnov
02-05-2003, 12:16 PM
top.main.location.href=

where 'main' is a name of frame you want to place result to.

Iain MacInnes
02-05-2003, 12:59 PM
Thanks Sergey,

Most appreciated!!!

I now need to replace the hardcoded
"http://www.ceolmor-software.com/CeolMor_files/main.htm"; part with the current page that is in the main frame ie

When navigating thro' the site, I then want to translate the current page on view, but I currently get the main.htm page displayed again

ANy help greatly received.

Cheers,
Iain.....

Sergey Smirnov
02-05-2003, 01:06 PM
Use document.location.href to get an URL of current page

Sergey Smirnov
02-05-2003, 01:31 PM
More details:
in case you have two frames one (named 'translator') for code above and one (named 'main') for browsed page:

if you want to add translate button to the browsed page, you can take the the current URL with document.location.href and invoke the translator from translator frame with
top.translator.translate(...)

if you want to have button in translator page, you can take url of browsed page with top.main.location.href

The translator function should be:



Hovewer, if both frames contain URLs with different domains, it should not work, because of security reason

Iain MacInnes
02-05-2003, 03:16 PM
Hello Sergey,


Thanks again. That's me sorted!!!!

Cheers,
Iain.....