Does anyone know of any PHP and MySQL code that will help me out?

I'm looking to translate my website but without the use of Google, Yahoo, Bing and so on, but would like to try drive the website through a database.

The idea was to have friends from around the world fill in a spreadsheet of words into translations and then feed them into the mysql database and then depending on what word in english is written and the language the user has chosen then the word will be selected from the mysql.

Is this possible?

Thanks guys (:

You can create a table with your default english texts, and a second table with the translated version and the target language linked to the first table. Of course you can also put this in one table.

How would I go about replacing the english on the website with the alternative language?

It seems simple on paper but putting it into action seems a tad harder

For one, everything needs to be in the DB. Are you talking about words, sentences or texts (or all) ? Suppose all your sentences (messages and such) now come from the DB. You now need to create a query to see if that sentence is available in the current language, and is so display that one instead. It depends on how you do things now, what is your website like ? Everything comes from the database, or do you still have static content ?

At current we have static content on the site.

So iv built a static site where we manually translate the site using google translator and save the rewritten pages in a translater sub dir

eg: myurl.com/fr

but instead of all this work. im hoping that there is a way or a free tool so i can use a DB.

My thoughts were to manually write the static english content and then the php/mysql function which will check every word and put back the translated version in its place dependant on the select sub dir

Possible, but as you probably know, an english sentence cannot be translated word for word into another language. The result is gibberish.

If you still want to do it, the method used in this thread can be used (although it needs to be modified of course).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.