How can i support multiple language on my project ?
atm in my index file language is load like this
include 'language/'.$setting['language'].'.php';`
P.S my php knowledge are base i hope with your help and my knowledge we can do it !
You won't be able to auto-detect the location of people. Well at least that is not that easy. But you can easily retrieve the browser language and that is way more important as that is the actively used language by the user.
The following code contains the information about the browser language.
$_SERVER['HTTP_ACCEPT_LANGUAGE']
With this you don't need sessions or cookies at all. If the value doesn't fit one of your supported languages, simply use the english file.
As it is stated in the PHP documentation, this variable contains a two-letter language code. en for English, de for German, etc. You can then do this:
if ($_SERVER['HTTP_ACCEPT_LANGUAGE'] == 'bg')
{
// deliver the bg file
}
else
{
// deliver the en file
}