Jump to content

Making a website bilingual


ann86

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/149662-making-a-website-bilingual/
Share on other sites

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

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.