1463 |
alexandre_ |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Setting a locale
|
|
|
5 |
* ================
|
|
|
6 |
*
|
|
|
7 |
* Because Un*x and Windows use different locale codes, PHPs setLocale() is not
|
|
|
8 |
* easily portable - I18Nv2::setLocale() attempts to provide this portability.
|
|
|
9 |
*
|
|
|
10 |
* With I18Nv2 you can use standard locale codes like 'en_US' on both, Linux
|
|
|
11 |
* and Windows, though the list is far not complete yet, so if you stumble
|
|
|
12 |
* over a not covered locale (I18Nv2::$locales in I18Nv2::_main()), just drop
|
|
|
13 |
* a mail to <mike(@)php.net> with the missing locale and its corresponding
|
|
|
14 |
* Win32 code.
|
|
|
15 |
*
|
|
|
16 |
* $Id: setting_a_locale.php,v 1.1 2007-06-25 09:55:25 alexandre_tb Exp $
|
|
|
17 |
*/
|
|
|
18 |
|
|
|
19 |
require_once 'I18Nv2.php';
|
|
|
20 |
|
|
|
21 |
$locale = 'en_US';
|
|
|
22 |
|
|
|
23 |
if (!I18Nv2::setLocale($locale)) {
|
|
|
24 |
die("Locale '$locale' not available!\n");
|
|
|
25 |
}
|
|
|
26 |
|
|
|
27 |
?>
|