ZurmoLocale Class Reference

Public Member Functions

 getId ()
 getNumberFormatter ()
 getDateFormatter ()
 getCurrencySymbol ($currency)
 getNumberSymbol ($name)
 getDecimalFormat ()
 getCurrencyFormat ()
 getPercentFormat ()
 getScientificFormat ()
 getMonthName ($month, $width= 'wide', $standAlone=false)
 getMonthNames ($width= 'wide', $standAlone=false)
 getWeekDayName ($day, $width= 'wide', $standAlone=false)
 getWeekDayNames ($width= 'wide', $standAlone=false)
 getEraName ($era, $width= 'wide')
 getAMName ()
 getPMName ()
 getDateFormat ($width= 'medium')
 getDateFormatForInput ($width= 'medium')
 getTimeFormat ($width= 'medium')
 getDateTimeFormat ()
 getOrientation ()
 getPluralRules ()
 getLocaleDisplayName ($id=null, $category= 'languages')

Static Public Member Functions

static getInstance ($id)
static getLocaleIDs ()
static getSelectableLocaleIds ()

Static Public Attributes

static $dataPath

Protected Member Functions

 __construct ($id)

Detailed Description

Improved Locale class to overcome some issues in Yii's CLocale. Needed to override almost the entire class as the CLocale's constructor and variables are protected. Any of the parent functions that uses the private attributes are overriden.

Definition at line 42 of file ZurmoLocale.php.


Constructor & Destructor Documentation

__construct ( id  )  [protected]

Constructor. Since the constructor is protected, please use getInstance to obtain an instance of the specified locale.

Parameters:
string $id the locale ID (e.g. en_US)

Definition at line 117 of file ZurmoLocale.php.


Member Function Documentation

static getInstance ( id  )  [static]

Returns the instance of the specified locale. Since the constructor of ZurmoLocale is protected, you can only use this method to obtain an instance of the specified locale.

Parameters:
string $id the locale ID (e.g. en_US)
Returns:
ZurmoLocale the locale instance

Definition at line 63 of file ZurmoLocale.php.

static getLocaleIDs (  )  [static]
Returns:
array IDs of the locales which the framework can recognize

Definition at line 79 of file ZurmoLocale.php.

static getSelectableLocaleIds (  )  [static]

Currently returns some english based ids since they are needed to support proper date/time/number formatting for users

Returns:
array of IDs that Zurmo accepts for locale

Definition at line 106 of file ZurmoLocale.php.

getId (  ) 
Returns:
string the locale ID (in canonical form)

Definition at line 135 of file ZurmoLocale.php.

getNumberFormatter (  ) 
Returns:
CNumberFormatter the number formatter for this locale

Definition at line 143 of file ZurmoLocale.php.

getDateFormatter (  ) 
Returns:
CDateFormatter the date formatter for this locale

Definition at line 155 of file ZurmoLocale.php.

getCurrencySymbol ( currency  ) 
Parameters:
string $currency 3-letter ISO 4217 code. For example, the code "USD" represents the US Dollar and "EUR" represents the Euro currency.
Returns:
string the localized currency symbol. Null if the symbol does not exist.

Definition at line 168 of file ZurmoLocale.php.

getNumberSymbol ( name  ) 
Parameters:
string $name symbol name
Returns:
string symbol

Definition at line 177 of file ZurmoLocale.php.

getDecimalFormat (  ) 
Returns:
string the decimal format

Definition at line 185 of file ZurmoLocale.php.

getCurrencyFormat (  ) 
Returns:
string the currency format

Definition at line 193 of file ZurmoLocale.php.

getPercentFormat (  ) 
Returns:
string the percent format

Definition at line 201 of file ZurmoLocale.php.

getScientificFormat (  ) 
Returns:
string the scientific format

Definition at line 209 of file ZurmoLocale.php.

getMonthName ( month,
width = 'wide',
standAlone = false 
)
Parameters:
integer $month month (1-12)
string $width month name width. It can be 'wide', 'abbreviated' or 'narrow'.
boolean $standAlone whether the month name should be returned in stand-alone format
Returns:
string the month name

Definition at line 220 of file ZurmoLocale.php.

getMonthNames ( width = 'wide',
standAlone = false 
)

Returns the month names in the specified width.

Parameters:
string $width month name width. It can be 'wide', 'abbreviated' or 'narrow'.
boolean $standAlone whether the month names should be returned in stand-alone format
Returns:
array month names indexed by month values (1-12)

Definition at line 238 of file ZurmoLocale.php.

getWeekDayName ( day,
width = 'wide',
standAlone = false 
)
Parameters:
integer $day weekday (0-6, 0 means Sunday)
string $width weekday name width. It can be 'wide', 'abbreviated' or 'narrow'.
boolean $standAlone whether the week day name should be returned in stand-alone format
Returns:
string the weekday name

Definition at line 256 of file ZurmoLocale.php.

getWeekDayNames ( width = 'wide',
standAlone = false 
)

Returns the week day names in the specified width.

Parameters:
string $width weekday name width. It can be 'wide', 'abbreviated' or 'narrow'.
boolean $standAlone whether the week day name should be returned in stand-alone format
Returns:
array the weekday names indexed by weekday values (0-6, 0 means Sunday, 1 Monday, etc.)

Definition at line 274 of file ZurmoLocale.php.

getEraName ( era,
width = 'wide' 
)
Parameters:
integer $era era (0,1)
string $width era name width. It can be 'wide', 'abbreviated' or 'narrow'.
Returns:
string the era name

Definition at line 291 of file ZurmoLocale.php.

getAMName (  ) 
Returns:
string the AM name

Definition at line 299 of file ZurmoLocale.php.

getPMName (  ) 
Returns:
string the PM name

Definition at line 307 of file ZurmoLocale.php.

getDateFormat ( width = 'medium'  ) 
Parameters:
string $width date format width. It can be 'full', 'long', 'medium' or 'short'.
Returns:
string date format

Definition at line 316 of file ZurmoLocale.php.

getDateFormatForInput ( width = 'medium'  ) 
Parameters:
string $width date format width. It can be 'full', 'long', 'medium' or 'short'.
Returns:
string date format for input fields

Definition at line 325 of file ZurmoLocale.php.

getTimeFormat ( width = 'medium'  ) 
Parameters:
string $width time format width. It can be 'full', 'long', 'medium' or 'short'.
Returns:
string date format

Definition at line 339 of file ZurmoLocale.php.

getDateTimeFormat (  ) 
Returns:
string datetime format, i.e., the order of date and time.

Definition at line 347 of file ZurmoLocale.php.

getOrientation (  ) 
Returns:
string the character orientation, which is either 'ltr' (left-to-right) or 'rtl' (right-to-left)
Since:
1.1.2

Definition at line 360 of file ZurmoLocale.php.

getPluralRules (  ) 
Returns:
array plural forms expressions

Definition at line 368 of file ZurmoLocale.php.

getLocaleDisplayName ( id = null,
category = 'languages' 
)

Gets a localized name from i18n data file (one of framework/i18n/data/ files).

Parameters:
string $id array key from an array named by $category.
string $category data category. One of 'languages', 'scripts' or 'territories'.
Returns:
string the localized name for the id specified. Null if data does not exist.
Since:
1.1.9

Definition at line 381 of file ZurmoLocale.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Thu Sep 21 07:10:30 2017