View Single Post
09-23-2007, 09:02 PM
#3
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

You do it by cookie or session (I like cookies better), it will contain a number corresponding to the language ID. You will then have a language array (example in php)
PHP Code:
//this code sets the array
$phrase["Welcome message"]["0"] = "Hello, welcome to the site";
$phrase["Welcome message"]["1"] = "Hola, bienvenido al sitio. ";
$phrase["Welcome message"]["2"] = "Bonjour, accueillir au site. "
Now in the file
PHP Code:
echo $phrase["$lang_id"]["meaning"]; 
I would store them in a hard coded array rather then a database, each page should have its own opposed to the entire site storing every pages. Store universal ones in a header file.