Hi,
My vision was to have a small home page with two flags (images) at the top right of the page. For example a German and British flag. THe user clicks each flag and the text in the body of the page changes.
My dilema is I dont know where to go from here. This is what I have done so far:
Setup POEDIT to create the translations.
Installed PHP-gettext on the webserver.
Enclosed the necessary text in the webpage with the following:
<?php echo _("This is my example text"); ?>
- Setup the folder structure for the "locale" as below:
/locale/de_DE/LC_MESSAGES/
- Placed the following code at the top of the web page:
<?php
$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");
?>
I have made a couple of translations to make sure the above works. Unfortunately it doesn't.
So my question is:
- What can I do to the above to make sure it does work?
- How can I achieve the flag system described in the example above. I thought calling a function but I dont know how to do that?
- Are there any good tutorials available? or can some one give me some good detailed advice here?
Many thanks in advance