Jump to content

how to design a multiple languages php site?


zgkhoo

Recommended Posts

how to design a multiple languages php site? eg i need to design a website with english n chinese language.

which user can switch between this two language.

need each language contains its own sources code(own website) or control it by the script inside php?

anyone can lead me pls.

thanks you very much..

Just make a file in language.php and include the file in php pages

 

and in language.php

 

<?php
if($language="English")
{
///////////////////////////For Home Page//////////////////////////////////
/////////////////////////Menu////////////////////////////////
$menu1="Home";
$menu2="Assembly stations";
$menu3="Terms";
$menu4="Order tracking";
$menu5="My account";
// your other stuffs...
}

if($language="Chinese")
{
// write the translated version here... 

}

?>

 

If you are saving the contents in DB then you can one add field for language i.e. EN or CH so while fetching data you can check in where clause like where LANG='EN' ...

 

I am doing the same thing for my site... it is working till now ;)

 

Good Luck...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.