multi-language website
I have done it like so
eng.inc.php
$word_1 = "English word";
otherlang.inc.php
$word_1 = "Other lang word";
main.php
if(isset($_GET['lang']))
{
if($_GET['lang'] == 1)
{
include eng.inc.php;
}
}
echo $word_1;```
That should start u off in the right direction .
Btw this is just an example, it will need security etc.
http://alma.ch/blogs/bahut/2006/03/simple-multi-language-web-site.html
Second result when Googling "multi-language website".
mistake25 wrote: 2 Zephyr_Pure: yes i know i can use google, but i want to know yours opinion
Okay… my opinion is that you should use a db with tables for your different content areas and translations for each language, then dynamically populate your pages based upon the language that your visitor chose (and had set through a session variable by your code, most likely).
Coder Disaster wrote: I dnt think that a database is needed for this, just either flat file system , or an .inc file should do, but depends on how much content you want to change.
It's not needed for that, no… nor did I state it was. I gave my suggestion. Is it necessary to have multiple directories and files holding the same content in different languages? No… but, that doesn't make your suggestion any less valid, either.
Coder Disaster wrote: I wasnt having a go at you, i assumed you meant use a database to store the translations.
BUt it all depends on how much content he wants to change.
I did. It depends on how easily expandable he wants it to be, not on how much content he wants to change.
The purpose of a dynamic website driven by database content and static includes is to not have to modify the source every time you want to add a change. For instance, if he decides he wants to add Hebrew to the site at some point, he shouldn't have to manually add it to the included select object listing the languages and to the conditionals in his code that are populating the correct content. Instead, the site should pull all of the available languages from the db when the main page is loaded (to populate the select options), then just run the same queries to pull content based upon the value of a session variable… as compared to the language entry in the db. He could easily add 5, 10, or 100 languages this way.
So, you have a point… and there are different ideal solutions based upon the scope of his idea.