I am trying to translate a webpage to several languages. However, I can only make gettext work for spanish.
I am using this code:
$lang = "de_DE";
if (isset($_GET['lang'])) $lang = $_GET['lang'];
putenv("LC_ALL=$lang");
setlocale(LC_ALL, $lang);
bindtextdomain("messages", "locale");
bind_textdomain_codeset('messages', 'UTF-8');
textdomain("messages");
If I set $lang="es_ES" the strings get translated to spanish, but if I set $lang="de_DE" the translation doesn't work, I only see the default english version.
I think it may be something about my computer locale (I use Windows in spanish). I am working on Windows (using Wamp localhost) and I don't know whether I have to install something more and, if so, how to do it.
In case I have to do it, will it work in my online hosting without installing anything there?
Thank you! :)