note 11734 added to gettext
| From: | iguy at ionsphere dot org | Date: | Mon, 05 Mar 2001 01:18:59 +0000 |
| Subject: | note 11734 added to gettext | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11862@lists.php.net to get a copy of this message | ||
Depending on the implementation of gettext used you might have to call the setlocale(LC_ALL,
"") command.
So your example code would be
<br>
<?php
// Set language to German
putenv ("LANG=de");
// set the locale into the instance of gettext
setlocale(LC_ALL, "");
// Specify location of translation tables
bindtextdomain ("myPHPApp", "./locale");
// Choose domain
textdomain ("myPHPApp");
// Print a test message
print (gettext ("Welcome to My PHP Application"));
?>
NOTE: If setlocale returns NULL the LANG specified is invalid and "not supported".
http://www.php.net/manual/en/function.gettext.php