faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 21 people (38%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

PHP: Does it allow me to translate a website to another language at the click of a button?

Mar 19th, 2008 22:13
ha mo, Knud van Eeden, sh, Andy Wright,


hi !
ofcourse you can. you can use some translating engines such like 
babelfish.. its not too easy to do it, you must know the correct syntax 
to the babelfish cgi to submit your datas there, and then you must 
gather the info and such.. use fsockopen()..
-sh
------------------------------------------------------------------------
--- Knud van Eeden - 18 October 2001 - 09:27 am ------------------------
[Internet: see also: 
http://www.faqts.com/knowledge_base/view.phtml/aid/11896/fid/53]
You can use e.g. the translation engine at www.freetranslation.com to
translate your website, by passing that url, the to and from language.
Possible choices are: English to/from French, German, Spanish, Italian,
Portuguese and Norwegian.
A possible PHP program where you can set the URL, to and from
variables and then generate an HTML page containing a link to
this translation page is for example:
#!/usr/local/bin/php
<? $languagefromS = "English" ?>
<? $languagetoS = "Spanish" ?>
<? $myurlS = "www.knudvaneeden.com" ?>
<? $url1S = "http://fets3.freetranslation.com:5081/?Language=" ?>
<? $url2S = "%2F" ?>
<? $url3S = "&Url=http%3A%2F%2F" ?>
<? $url4S = "&Sequence=core" ?>
<? $urlS = $url1S . $languagefromS . $url2S . $languagetoS . $url3S . 
$myurlS . $url4S ?>
<? echo "<HTML>" ?>
<? echo "<BODY>" ?>
<? echo "The website being translated = " ?>
<? echo $myurlS ?>
<? echo " from " ?>
<? echo $languagefromS ?>
<? echo " to" ?>
<? echo $languagetoS ?>
<? echo " " ?>
<? echo '<A HREF="' . $urlS . '">' . "translate" . "</A>" ?>
<? echo "</BODY>" ?>
<? echo "</HTML>" ?>
------------------------------------------------------------------------
http://www.tantofa.com
http://www.fantofa.com
http://www.mantofa.com
http://www.tanpola.com
http://www.tampola.com
http://www.yamot.com
http://www.mozmar.com
http://www.templatestemp.com