This is more of an analytical question.
I need to know how best to make a multilingual system, a.k.a. a system where the user can change the language. The language will be stored in a cookie or a database.
I've worked in the past with different files for each language, for example:
nl.php
$lang['hi'] = 'Hoi';
$lang['howareyou'] = 'Hoe gaat het?';
en.php
$lang['hi'] = 'Hi'];
$lang['howareyou'] = 'How are you?';
index.php
include($language . '.php');
As you can see, this system is both inefficient and insecure. Is there a better way to do it? I can think of a few ways to do this this instant, but I don't really know which one would be good.
Can anyone help me with this? Please don't just say "Do it like this!", also tell me why it is a good way to do it.