vishal <vi************@yahoo.co.in> wrote:
i want to craete site which shows the contents as per the langauge i
choose. so can anyone give me idea that how this is possible. i know
tha problem but i don't have any idea about soultion. so pls reply me
if u know
I have this solotion for my site:
files:
lang.hr.php
lang.en.php
lang.de.php
with langugae variables in files:
(hr)
$welcome = "Dobrodosli";
(en)
$welcome = "Welcome";
(de)
$welcome = "Willcomen";
and so on...
Then, I give my visitors cookie $_COOKIE['lang'], as my site is primary
for croatian vistors, I just look if visitor have choosen other language
on his visit before (that was *my-clumsy-english*...sorry):
//"gui" part
if(isset($_COOKIE['lang'])) {
$lang = "$_COOKIE[lang]";
} else {
$lang = "hr";
}
include("lang/lang.$lang.php");
//site content
mysql_query("SELECT * FROM table WHERE (somthing='$wanted_content' AND
lang = '$lang')";
//in case of some old not yet converted static data:
include("data/$lang/$linked_file");
.... that wasn't "copy-paste" method, so some "typing errors" are
possible...
--
Jan ko?
http://fotozine.org/?omen=janimir
--