I am developing a site using php and mysql. I want to know… what’s a good way to deal with multi-lingual support? I want a user to be able to select from a drop down and select their language. Then everything (content, buttons, links) except the user-written content is in their language.
What’s a good way to approach this? Use a cookie? Session?
Something like this works fine:
Langs.php
LANG GBR FILE (gbr.php)
METHOD TO CHANGE LANGUAGE (url sample)
Basically, you have PHP files with constants, each file with a lang.
On click you set a url var (ex: lang_change = lang).
That will force page reload, and the langs.php file include at top of your index.php will load the selected language…
If you need more explanation about this, leave a comment and I’ll send you a working sample!
Ps: session variables shown in this code is usefully for interaction with login systems, or just to avoid having the url parameters…