View Full Version : multilingual site

10-19-2009, 10:49 PM
Hello, I'm a bit of a novice when it comes to html & css but I can build sites that validate.

I am currently building a site in html & css with a bit of flash thrown in.

My client requires the site to be in English, Italian & Chinese.

I have built the site in English first and I have the text.doc for the Italian and Chinese content.

I think I have to use index1 (eng), index2 (ita) and index3 (chin) and need to get it to automatically load reading the users geographical location.

Does anyone have this code or can steer me in the right direction I would be extremely grateful!

All the best


10-19-2009, 10:58 PM
Do you know how to use PHP or are already implementing this or another server-side programming language?

10-19-2009, 11:08 PM
I'm using .php for my contact form but I get my brother to help me with it.
I did ask him about my problem but he doesn't know!

10-19-2009, 11:15 PM
Basically what you'd do is one file called index.php, let's say.

You'd pass a variable to it to signify the language in the URL, like index.php?lang=en, index.php?lang=it and index.php?lang=cn.

At the top of your index.php file, you'd have this little snippet:

$lang = $_GET['lang'];
if($lang) {
<!doctype html>

And whenever you have text, you'd do this:

<p><?php if($lang == "en") { ?>I speak English!<?php } elseif($lang == "it") { ?>Io parlo italiano!<?php } else { ?>I really don't speak Chinese!<?php } ?></p>

If this is a simple site, that is. If it were larger, we'd have to use something more robust.

You then end the file with this:

} else {
echo "No language specified!";

10-20-2009, 12:02 AM

Thanks for your help, I'll have a look at that with my bro.

All the best


10-20-2009, 03:51 AM
Interesting... I've always wanted to translate my website into German for some odd reason lol (I love the language).

10-20-2009, 04:02 AM
lol. I can do the scripting bit. Its the content I am falling down on since I am only bi-lingual - at a considerable stretch.