PHP Code:
echo '<hr>test UNIX server for locales';
echo "<br>The available 'locale' strings for 'en' on this server are:<br>";
echo '<pre>';
system('locale -a | grep -i en');
echo '</pre>';
// There is no command "locale" (and "grep") on Windows which you can execute with system()
echo '<hr>test WINDOWS server for locales';
/* try different possible locale names for english GB as of PHP 4.3.0 */
echo '<p>';
$loc_en = setlocale(LC_ALL, 'english_gbr', 'english_britain', 'english_england', 'english_great britain', 'english_uk', 'english_united kingdom', 'english_united-kingdom');
echo "Preferred locale for english GB on this system is '$loc_en'";
echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));
/* try different possible locale names for english USA as of PHP 4.3.0 */
echo '<p>';
$loc_enusa = setlocale(LC_ALL, 'english_usa', 'english_america', 'english_united states', 'english_united-states', 'english_us');
echo "Preferred locale for english USA on this system is '$loc_enusa'";
echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));
/* try different possible locale names for german as of PHP 4.3.0 */
echo '<p>';
$loc_de = setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'deu_deu');
echo "Preferred locale for german on this system is '$loc_de'";
echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));
/* try different possible locale names for spanish as of PHP 4.3.0 */
echo '<p>';
$loc_es = setlocale(LC_ALL, 'esp_esp', 'esp_spain', 'spanish_esp', 'spanish_spain');
echo "Preferred locale for spanish on this system is '$loc_es'";
echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));
/* try different possible locale names for dutch as of PHP 4.3.0 */
echo '<p>';
$loc_nl = setlocale(LC_ALL, 'nld_nld');
echo "Preferred locale for dutch on this system is '$loc_nl'";
echo '<br/>' . strftime("%A %d %B %Y", mktime(0, 0, 0, 12, 22, 1978));
and what comes out on a unix server
Bookmarks