Locale settings
The following code reads some locale settings for the nor-NO locale.
include_once( "lib/ezlocale/classes/ezlocale.php" );
$locale =& eZLocale::instance( "nor-NO" );
$infoList = array( 'LanguageCode' => $locale->languageCode(),
'Language' => $locale->languageName(),
'LanguageComment' => $locale->languageComment(),
'Content-Language' => $locale->httpLocaleCode(),
'CountryCode' => $locale->countryCode(),
'CountryVariation' => $locale->countryVariation(),
'Country' => $locale->countryName(),
'CountryComment' => $locale->countryComment(),
'Time' => $locale->formatTime(),
'ShortTime' => $locale->formatShortTime(),
'Date' => $locale->formatDate(),
'ShortDate' => $locale->formatShortDate(),
'DateTime' => $locale->formatDateTime(),
'ShortDateTime' => $locale->formatShortDateTime(),
'MondayFirst' => ( $locale->isMondayFirst() ? "Yes" : "No" ),
'Number' => ( $locale->formatNumber( 1234567.89 ) . " / " . $locale->formatNumber( -1234567.89 ) ),
'Currency' => ( $locale->formatCurrency( 123456789.00 ) . " / " . $locale->formatCurrency( -123456789.00 ) ) );
print( "<table><tr><th>Type</th><th>Result</th></tr>
<tr><td colspan="2"><b>Locale</b></td></tr>" );
foreach( $infoList as $infoName => $infoText )
{
print( "<tr><td>$infoName</td><td>$infoText</td></tr>\n" );
}
print( "</table>" );
This will produce something like this:
| Type | Result |
| Locale |
| LanguageCode | nor |
| Language | Norsk (Bokm�l) |
| LanguageComment | |
| Content-Language | no-bokmaal |
| CountryCode | NO |
| CountryVariation | |
| Country | Norway |
| CountryComment | |
| Time | 16:11:24 |
| ShortTime | 16:11 |
| Date | 07. februar 2003 |
| ShortDate | 07.02.2003 |
| DateTime | 07. februar 2003 16:11:24 |
| ShortDateTime | 07.02.2003 16:11 |
| MondayFirst | Yes |
| Number | 1.234.567,89 / -1.234.567,89 |
| Currency | kr 123.456.789,00 / kr -123.456.789,00 |
|