Website Translation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
leebo
Forum Commoner
Posts: 44
Joined: Sun Oct 20, 2002 9:49 am

Website Translation

Post by leebo »

Hi

Is there any php software which you can buy which will display your website into a different language ?

so for english version it would be mysite.com
for the spanish version it would be mysite.com/spanish

Which would have a script/software that will display in spanish.

Any ideas ?
ghost007
Forum Commoner
Posts: 49
Joined: Sat Nov 22, 2003 10:10 am

Post by ghost007 »

User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

That's not php software you can buy and put on your site, ghost. But that is probably the best bet for translating entire sites.

There is also the option to do what I've seen done in some major open source apps (I think even this forum). Most words displayed on the site will be within a translate("text text text", "language") type of function. Then language can be controlled by a users preference in the database, or a global variable within a config file.

eg.

Code: Select all

<?php
$lang = array();
$lang[0] = "en";
$lang[1] = "de";
$lang[2] = "es";
// etc..
translate("Welcome", "$lang[1]");
?>
the translate function would then query a database and pull up the transation for that specific word.

This is limited to menus and other 1 or 2 word phrases. I've never seen it done on a full scale (huge paragraphs) before.
leebo
Forum Commoner
Posts: 44
Joined: Sun Oct 20, 2002 9:49 am

Post by leebo »

Thanks but I found a script which converts it automatically on the fly.
User avatar
mrvanjohnson
Forum Contributor
Posts: 137
Joined: Wed May 28, 2003 11:38 am
Location: San Diego, CA

Post by mrvanjohnson »

Care to share... What script did you find others might appreicate knowing :-)
ghost007
Forum Commoner
Posts: 49
Joined: Sat Nov 22, 2003 10:10 am

Post by ghost007 »

yes plz share this unique piece of super coding. I think I can quit my job once I will have registered this :?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

check out this class from PHP Classes - http://www.phpclasses.org/browse.html/package/1389.html

This class is meant to translate text between different languages using Altavista Babelfish remote service via the Web.

Just pass to the class a text string in any of the supported idioms and obtain it translated to another supported idiom.

Currently, the supported idioms are: English, Chinese, French, German, Italian, Japanese, Korean, Portuguese and Russian

Quite useful

Mark
leebo
Forum Commoner
Posts: 44
Joined: Sun Oct 20, 2002 9:49 am

Post by leebo »

Ok OK steady on lads.

http://www.rohitab.com/cgiscripts/translingo.html

one file to config thats it - your site is multilingual

If you choose different engines when making the link for the translation ( all explained in the files ) there is one which has no banner.

OH and its free!!!!!
ghost007
Forum Commoner
Posts: 49
Joined: Sat Nov 22, 2003 10:10 am

Post by ghost007 »

nice it can be usefull but will use other tranlation services which are payable if you want to use them on commercial website. And once you pay they provide you with the necessary code.

"you should have look at the Terms of Use of the translation service"

thx for the info but will have to keep my job :mrgreen:

siech
markbeadle
Forum Commoner
Posts: 29
Joined: Tue Dec 02, 2003 2:50 am
Location: Aachen, Germany

Post by markbeadle »

I have heard that Gettext extension may be used although I have not yet tried it. Any experiences welcomed.
User avatar
Derfel Cadarn
Forum Contributor
Posts: 193
Joined: Thu Jul 17, 2003 12:02 pm
Location: Berlin, Germany

Post by Derfel Cadarn »

leebo wrote:http://www.rohitab.com/cgiscripts/translingo.html

one file to config thats it - your site is multilingual

OH and its free!!!!!
..and that shows!! 8O
My god, those translations are worse than what babelguppy comes up with! Or IS it babalguppy?
Post Reply