No, there isn't an error.
It's rilated to gettext. Here is page.php:
Code: Select all
<?php require_once("../local.php"); ?>
<?php
echo _("Hello world");
?>
And here is main.php:
Code: Select all
<?php
$locale = "es_ES.utf8";
if (isSet($_GET["locale"])) $locale = $_GET["locale"];
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale);
bindtextdomain("messages", "./locale");
textdomain("messages");
?>
So, if I open page.php with my browser, it should show the text in Spanish, and by writing ?locale=en_GB, it's in original version. This works if both files are in the same folder, but not when they are in different folders, because it only shows the original version, not the translated one.
Of course, there is also the "locale" folder, with .mo and .po, etc.