you have two different ways of doing it.
- Having the files existing in both languages in two different directories ( /en , /de , /fr ... )
- using the same html templates with dynamic text depending on the language.
In the second case ( which is best, because you can create easily a new language ), you should use a serverside script language, like php, and the easiest way would be to use a dictionnary file (the other way would need a database).
For example, if you have two files :
- fr.dictionnary.php (french) :
$hello = "bonjour";
$enter = "Veuillez entrer";
- en.dictionnary.php (english)
$hello = "hello";
$enter = "Please enter";
In your main file, when you know the language of the user (with javascript on the browser, or with a form ), you can map it in the codes for the languages you provide (don't forget to put one language by default).
let's say you have now a var called $lng that is equal to "fr";
in your main file :
<? include $lng.".dictionnary.php"; ?>
<html>
<head>
...
<body>
<? echo $hello; ?><br />
<a href="inside.html"><? echo $enter; ?></a>
This will display in french.
hope that'll help.
php/java developer
NTIC engineer
|