";
// Or use the alias _() for gettext()
echo "Sidebar translates to $lang as " . _("Sidebar") . "
";
exit;
putenv('LC_ALL=de_DE');
setlocale(LC_ALL, 'de_DE');
// Specify location of translation tables
bindtextdomain("messages", "/home/rjmprogr/public_html/PHP/gettext/locale/de_DE/LC_MESSAGES");
// Choose domain
textdomain("messages");
// Translation is looking for in ./locale/de_DE/LC_MESSAGES/messages.mo now
// Print a test message
echo gettext("Sidebar");
// Or use the alias _() for gettext()
echo _("Sidebar");
exit;
require_once("localization.php");
$results = gettext("Sidebar");
if ($results === "Sidebar") {
echo "Original English was returned. Something wrong ... \n";
}
echo $results . "\n";
$results = gettext("Similar Meaning");
if ($results === "Similar Meaning") {
echo "Original English was returned. Something wrong ... \n";
}
echo $results . "\n";
echo "
";
echo gettext("via");
echo "
";
$n = 3;
printf(ngettext("%d comment", "%d comments", $n), $n);
?>