Jump to content

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...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.