Class CLocale
CLocale represents the data relevant to a locale.
The data includes the number formatting information and date formatting information.
- CComponent
- CLocale
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/i18n/CLocale.php
public static
|
#
getInstance( string $id )
Returns the instance of the specified locale. Since the constructor of CLocale is protected, you can only use this method to obtain an instance of the specified locale. |
public static
array
|
|
protected
|
#
__construct( string $id )
Constructor. Since the constructor is protected, please use |
public static
string
|
#
getCanonicalID( string $id )
Converts a locale ID to its canonical form. In canonical form, a locale ID consists of only underscores and lower-case letters. |
public
string
|
|
public
|
|
public
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
array
|
#
getMonthNames( string $width = 'wide', boolean $standAlone = false )
Returns the month names in the specified width. |
public
string
|
|
public
array
|
#
getWeekDayNames( string $width = 'wide', boolean $standAlone = false )
Returns the week day names in the specified width. |
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
array
|
|
public
string
|
#
getLanguageID( string $id )
Converts a locale ID to a language ID. A language ID consists of only the first group of letters before an underscore or dash. |
public
string
|
#
getScriptID( string $id )
Converts a locale ID to a script ID. A script ID consists of only the last four characters after an underscore or dash. |
public
string
|
#
getTerritoryID( string $id )
Converts a locale ID to a territory ID. A territory ID consists of only the last two to three letter or digits after an underscore or dash. |
public
string
|
#
getLocaleDisplayName( string $id = null, string $category = 'languages' )
Gets a localized name from i18n data file (one of framework/i18n/data/ files). |
public
string
|
|
public
string
|
|
public
string
|
public static
string
|
$dataPath |
|
#
the directory that contains the locale data. If this property is not set, the locale data will be loaded from 'framework/i18n/data'. |
public
string
|
$id |
#
The locale ID (in canonical form). |
public
|
$numberFormatter |
#
The number formatter for this locale. |
public
|
$dateFormatter |
#
The date formatter for this locale. |
public
string
|
$decimalFormat |
#
The decimal format. |
public
string
|
$currencyFormat |
#
The currency format. |
public
string
|
$percentFormat |
#
The percent format. |
public
string
|
$scientificFormat |
#
The scientific format. |
public
array
|
$monthNames |
#
Month names indexed by month values (1-12). |
public
array
|
$weekDayNames |
#
The weekday names indexed by weekday values (0-6, 0 means Sunday, 1 Monday, etc.). |
public
string
|
$aMName |
#
The AM name. |
public
string
|
$pMName |
#
The PM name. |
public
string
|
$dateFormat |
#
Date format. |
public
string
|
$timeFormat |
#
Date format. |
public
string
|
$dateTimeFormat |
#
Datetime format, i.e., the order of date and time. |
public
string
|
$orientation |
#
The character orientation, which is either 'ltr' (left-to-right) or 'rtl' (right-to-left). |
public
array
|
$pluralRules |
#
Plural forms expressions. |