How do I implement multiple languages for one website?


hopefully this post is in the right place, I am a bit new to forums.
I am also new to webdesign so I have a noob question, like the title says.

How do I implement multiple languages for one website?

I would like to have a nice looking menu somewhere on my website where you can choose the language of your preference.
Before posting, I searched for other threads on this but I didn’t find andthing, like this question unfortunately.

Thank you,
Milan :slight_smile:

Make duplicate pages in the other languages, save them in folders with an abbreviated code for the language - eg /en/index.htm for English, /fr/index.htm for French, etc, and link to the alternative language versions at top right or top left of each page. - it seems to be common to have these links as flags or same abbreviation as used for the folders . It’s not exactly a difficult problem to solve, is it?

Off Topic:

These days, using Chrome, if I come across a site that’s not in my native language, I’m asked if I want it translated—meaning I can read it in my own language in an instant. Probably not ideal, but signs of a brave new world, indeed.

Are you currently learning a programming language? If you don’t intend to, then I recommend that you use a CMS that has good multi-lingual support, either directly built-in (can’t think of one) or via an add-on or plugin. Most of the popular CMSes have a few third-party solutions.

All three answers were super helpful. For now I will do more research about the brave future and cms of course. But first attend to more pressing matters with the website like writing more content.

Thank you!

The logical way would be to have a website divided into equal sized chunks - one chunk for each language. The navigation structure and the formatting (the CSS) could be the same for all the chunks. You would just need to create translated pages named in the proper language (for search engine optimization). At least you do not need to worry about dulicate content :slight_smile:

Do remember to change the language meta-tag in the head of each page.

I understand everything you advised and I think that is a very practical way of doing it.
Unfortunately at this point I lack the skills needed, so I will learn more about the details of it all first.
No fun for me if it isn’t perfect lol oh and thank you! :slight_smile:

Instead of typing it all up again, here are my thoughts and experience from the first time I did a multilingual site. Not perfect, but it was the first and a great learning experience.

Thank you, that’s very helpful!

Since the rising of Google chrome, i don’t think it’s still necessary to make a translation of your page :slight_smile:

You are joking, aren’t you? Chrome has something under 30% of the browser market share, so you’re willing to discount 70% of your visitors?

very interesting to read abut such a frequently queried question…personally I would tackle this slightly different from a sheer Google point of view…it is important that websites are easily understood by Google, it does not like dynamic content for one… so to do it properly i would create a variety of HTML pages (variant of the main homepage) and store this on a sub-directory so: [noparse][/noparse]. Then submit a sitemap in webmaster tools suggesting this change…

Here are a few ways

Chrome is growing, and i’m sure other browser will get the same function :slight_smile:

Not necessarily, as I assume it’s a Google trick that perhaps will be kept for Chrome alone.

The easiest way is to install wordpress and add “The WordPress Multilingual Plugin” available at wpml[dot]org


You can use language files also.

Create english.php, hindi.php and spanish.php
And define words and phrases in that file and use them in your php scripts accordingly.
You just have to load the language file that the user has selected.


In english.php:

$language["hi"] = "hi";
$language["howareyou"] = "how are you ?";

In hindi.php:

$language["hi"] = "namaste";
$language["howareyou"] = "kaise hain aap ?";

In spanish.php:

$language["hi"] = "hola";
$language["howareyou"] = "como es usta ?";

When a user comes to your site the default lang. file in english.php

Your php file should have something like that in it:

if (empty($_SESSION["langfile"])) { $_SESSION["langfile"] = "english.php"; }
require_once ($_SESSION["langfile"]);
echo $language["hi"];

So they see: hi
But if they select Hindi or Spanish then you load content from the respective language file and if its Hindi then it will show: namaste and if its spanish it will show hola

Links can be like this:

<a href="language.php?l=english">En</a>
<a href="language.php?l=hindi">Hi</a>
<a href="language.php?l=spanish">Sp</a>


if (!empty($_GET["l"]))
$_SESSION["langfile"] = $_GET["l"] . ".php"; 
header ("location: index.php"); exit();

This is a very basic example, you can make it more complex and more secure.

Hope this helps.