Hi
I have a website and I willing to make it multi language support.
So regarding this I request kindly sugest me anyone.
Thanks..
How to use multi language support in my website ?
Moderator: General Moderators
-
shubhamdas.mca
- Forum Newbie
- Posts: 1
- Joined: Thu Mar 04, 2010 8:49 am
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: How to use multi language support in my website ?
There are many ways to do this. For a simple approach, I would store the multi-lingual content in the database with a language identifier:
main table
You can have multiple tables for different content just as you would normally:
articles table
Then you have easy ways to get the correct data after you know the user's language:
This makes it easy to add a form where different editors can translate stories, messages, etc.
main table
Code: Select all
id lang key value
1 en WELCOME Welcome to my site
2 fr WELCOME Bienvenue sur mon sitearticles table
Code: Select all
id lang title article
1 en My Article This is my article content.
1 fr Mon article Ceci est le contenu de mon article.Code: Select all
SELECT value FROM main WHERE key='WELCOME' AND lang='en'
SELECT * FROM articles WHERE id=1 AND lang='fr'
Last edited by AbraCadaver on Mon Feb 28, 2011 10:57 am, edited 1 time in total.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: How to use multi language support in my website ?
No entry matches that condition?AbraCadaver wrote:articles tableThen you have easy ways to get the correct data after you know the user's language:Code: Select all
id title article 1 en My Article This is my article content. 2 fr Mon article Ceci est le contenu de mon article.
Code: Select all
SELECT value FROM main WHERE key='WELCOME' AND lang='en' SELECT * FROM articles [color=#BF0000]WHERE id=1 AND lang='fr'[/color]