ann86 Posted March 16, 2009 Share Posted March 16, 2009 Hello, I am a working on a website and the client wants it bilingual English/Spanish. He wants to be able to put in his stories himself so I have a database where he will be able to type in his stories and it will display. How would I make it display in Spanish when he wants the site in Spanish? P.S. Also I am a beginner in coding. Quote Link to comment https://forums.phpfreaks.com/topic/149662-making-a-website-bilingual/ Share on other sites More sharing options...
JonnoTheDev Posted March 16, 2009 Share Posted March 16, 2009 You require a language table i.e. language ========= languageId title 1 = english 2 = spanish Your stories table stories ========= storyId languageId title story So the story needs to be entered in both languages. I would run a loop on the languages table so adding a new story requires entry of 2 titles and 2 text. When a user clicks to view the site in spanish then you could set a cookie to the languageId value i.e. 2. You then select the stories where languageId=2 Quote Link to comment https://forums.phpfreaks.com/topic/149662-making-a-website-bilingual/#findComment-785885 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.