I´m working on a project of about 10 pages. The site needs to be available in several languages from the start and adding other languages afterwards must also be easy.
What I´ve decided so far is that the user is able to decide in his settings page what language he wants to browse the site in. That is then stored in the database and every time he logs in his language choice is stored in his session data.
Content (such as longer text) will of course be stored in the database to and thereby theres really no problem to fetch the right content in the right language for each page the visitor browses.
However, what I just can´t seem to decide is how I should store short strings, such as those used in the interface, forms, links etc...
I could of course hard code them on each page using a IF- or SWITCH-statement to decide what language they should be echoed in, but that´s hardly flexible.
So, I see two other alternatives:
I store all short strings in variables or arrays in a inc-file and just call the variables from some evaluating function in my main scripts.
I store all the short strings in the DB to.
Now, what I need help with is to determine if I should go with alternative 1 or 2 ? What is the fastest and least serverdemading solution ?
Or is there anyone who can give me a third and better alternative ?