Class Mage_Core_Model_Locale

Description

Locale model

Located in /Core/Model/Locale.php (line 32)


	
			
Class Constant Summary
DEFAULT_LOCALE = 'en_US'
FORMAT_TYPE_FULL = 'full'
FORMAT_TYPE_LONG = 'long'
FORMAT_TYPE_MEDIUM = 'medium'
FORMAT_TYPE_SHORT = 'short'
XML_PATH_ALLOW_CODES = 'global/locale/allow/codes'
XML_PATH_ALLOW_CURRENCIES = 'global/locale/allow/currencies'
XML_PATH_ALLOW_CURRENCIES_INSTALLED = 'system/currency/installed'
XML_PATH_DEFAULT_COUNTRY = 'general/country/default'
XML_PATH_DEFAULT_LOCALE = 'general/locale/code'
XML_PATH_DEFAULT_TIMEZONE = 'general/locale/timezone'
Variable Summary
static mixed $_currencyCache
Zend_Locale $_locale
string $_localeCode
Method Summary
Zend_Currency currency (string $currency)
Zend_Date date ([mixed $date = null], [string $part = null], [ $locale = null], [ $useTimezone = true])
void emulate (int $storeId)
Mage_Core_Model_Locale __construct ([ $locale = null])
unknown getAllowCurrencies ()
array getAllowLocales ()
array getCountryTranslation (string $value)
string getCurrency ()
string getDateFormat ([string $type = null])
string getDateStrFormat (string $type)
string getDateTimeFormat (string $type)
string getDefaultLocale ()
array getJsPriceFormat ()
Zend_Locale getLocale ()
string getLocaleCode ()
float getNumber (string|int $value)
unknown getOptionCurrencies ()
array getOptionLocales ()
string getTimeFormat ([string $type = null])
string getTimeStrFormat (string $type)
string getTimezone ()
string|false getTranslation ([string $value = null], [string $path = null])
array getTranslationList ([string $path = null], [string $value = null])
bool isStoreDateInInterval (int|string|Mage_Core_Model_Store $store, [string|null $dateFrom = null], [string|null $dateTo = null])
void revert ()
Mage_Core_Model_Locale setLocale ([string $locale = null])
Zend_Date storeDate ([mixed $store = null], [string|integer|Zend_Date|array|null $date = null], [boolean $includeTime = false])
int storeTimeStamp ([mixed $store = null])
Zend_Date utcDate ([mixed $store = null], string|integer|Zend_Date|array|null $date, [boolean $includeTime = false], [null|string $format = null])
array _getOptionLocales ([bool $translatedName = false])
void _sortOptionArray ( $option)
Variables
static mixed $_currencyCache = array() (line 90)
  • access: protected
string $_defaultLocale (line 67)

Default locale code

  • access: protected
array $_emulatedLocales = array() (line 88)

Emulated locales stack

  • access: protected
Zend_Locale $_locale (line 74)

Locale object

  • access: protected
string $_localeCode (line 81)

Locale code

  • access: protected
Methods
currency (line 552)

Create Zend_Currency object for current locale

  • access: public
Zend_Currency currency (string $currency)
  • string $currency
date (line 471)

Create Zend_Date object for current locale

  • exception: Zend_Date_Exception
  • access: public
Zend_Date date ([mixed $date = null], [string $part = null], [ $locale = null], [ $useTimezone = true])
  • mixed $date
  • string $part
  • $locale
  • $useTimezone
emulate (line 681)

Push current locale to stack and replace with locale from specified store Event is not dispatched.

  • access: public
void emulate (int $storeId)
  • int $storeId
Constructor __construct (line 92)
  • access: public
Mage_Core_Model_Locale __construct ([ $locale = null])
  • $locale
getAllowCurrencies (line 396)

Retrieve array of allowed currencies

  • access: public
unknown getAllowCurrencies ()
getAllowLocales (line 386)

Retrieve array of allowed locales

  • access: public
array getAllowLocales ()
getCountryTranslation (line 740)

Returns the localized country name

  • access: public
array getCountryTranslation (string $value)
  • string $value: Name to get detailed information about
getCountryTranslationList (line 750)

Returns an array with the name of all countries translated to the given language

  • access: public
array getCountryTranslationList ()
getCurrency (line 158)

Retrieve currency code

  • access: public
string getCurrency ()
getDateFormat (line 414)

Retrieve ISO date format

  • access: public
string getDateFormat ([string $type = null])
  • string $type
getDateStrFormat (line 447)

Retrieve date format by strftime function

  • access: public
string getDateStrFormat (string $type)
  • string $type
getDateTimeFormat (line 436)

Retrieve ISO datetime format

  • access: public
string getDateTimeFormat (string $type)
  • string $type
getDefaultLocale (line 114)

REtrieve default locale code

  • access: public
string getDefaultLocale ()
getJsPriceFormat (line 631)

Functions returns array with price formating info for js function formatCurrency in js/varien/js.js

  • access: public
array getJsPriceFormat ()
getLocale (line 168)

Retrieve locale object

  • access: public
Zend_Locale getLocale ()
getLocaleCode (line 185)

Retrieve locale code

  • access: public
string getLocaleCode ()
getNumber (line 591)

Returns the first found number from an string Parsing depends on given locale (grouping and decimal)

Examples for input: ' 2345.4356,1234' = 23455456.1234 '+23,3452.123' = 233452.123 ' 12343 ' = 12343 '-9456km' = -9456 '0' = 0 '2 054,10' = 2054.1 '2'054.52' = 2054.52 '2,46 GB' = 2.46

  • access: public
float getNumber (string|int $value)
  • string|int $value
getOptionAllCurrencies (line 351)

Retrieve all currency option list

  • access: public
unknown getOptionAllCurrencies ()
getOptionCountries (line 308)

Retrieve country option list

  • access: public
array getOptionCountries ()
getOptionCurrencies (line 327)

Retrieve currency option list

  • access: public
unknown getOptionCurrencies ()
getOptionLocales (line 211)

Get options array for locale dropdown in currunt locale

  • access: public
array getOptionLocales ()
getOptionTimezones (line 270)

Retrieve timezone option list

  • access: public
array getOptionTimezones ()
getOptionWeekdays (line 290)

Retrieve days of week option list

  • access: public
array getOptionWeekdays ()
getTimeFormat (line 425)

Retrieve ISO time format

  • access: public
string getTimeFormat ([string $type = null])
  • string $type
getTimeStrFormat (line 458)

Retrieve time format by strftime function

  • access: public
string getTimeStrFormat (string $type)
  • string $type
getTimezone (line 148)

Retrieve timezone code

  • access: public
string getTimezone ()
getTranslatedOptionLocales (line 221)

Get translated to original locale options array for locale dropdown

  • access: public
array getTranslatedOptionLocales ()
getTranslation (line 729)

Returns a localized information string, supported are several types of informations.

For detailed information about the types look into the documentation

  • return: The wished information in the given language
  • access: public
string|false getTranslation ([string $value = null], [string $path = null])
  • string $value: Name to get detailed information about
  • string $path: (Optional) Type of information to return
getTranslationList (line 716)

Returns localized informations as array, supported are several types of informations.

For detailed information about the types look into the documentation

  • return: Array with the wished information in the given language
  • access: public
array getTranslationList ([string $path = null], [string $value = null])
  • string $path: (Optional) Type of information to return
  • string $value: (Optional) Value for detail list
isStoreDateInInterval (line 763)

Checks if current date of the given store (in the store timezone) is within the range

  • access: public
bool isStoreDateInInterval (int|string|Mage_Core_Model_Store $store, [string|null $dateFrom = null], [string|null $dateTo = null])
revert (line 698)

Get last locale, used before last emulation

  • access: public
void revert ()
setDefaultLocale (line 103)

Set default locale code

  • access: public
Mage_Core_Model_Locale setDefaultLocale (string $locale)
  • string $locale
setLocale (line 132)

Set locale

  • access: public
Mage_Core_Model_Locale setLocale ([string $locale = null])
  • string $locale
setLocaleCode (line 199)

Specify current locale code

  • access: public
Mage_Core_Model_Locale setLocaleCode (string $code)
  • string $code
storeDate (line 497)

Create Zend_Date object with date converted to store timezone and store Locale

  • access: public
Zend_Date storeDate ([mixed $store = null], [string|integer|Zend_Date|array|null $date = null], [boolean $includeTime = false])
  • mixed $store: Information about store
  • string|integer|Zend_Date|array|null $date: date in UTC
  • boolean $includeTime: flag for including time to date
storeTimeStamp (line 536)

Get store timestamp Timstamp will be builded with store timezone settings

  • access: public
int storeTimeStamp ([mixed $store = null])
  • mixed $store
utcDate (line 521)

Create Zend_Date object with date converted from store's timezone to UTC time zone. Date can be passed in format of store's locale or in format which was passed as parameter.

  • access: public
Zend_Date utcDate ([mixed $store = null], string|integer|Zend_Date|array|null $date, [boolean $includeTime = false], [null|string $format = null])
  • mixed $store: Information about store
  • string|integer|Zend_Date|array|null $date: date in store's timezone
  • boolean $includeTime: flag for including time to date
  • null|string $format
_getOptionLocales (line 232)

Get options array for locale dropdown

  • access: protected
array _getOptionLocales ([bool $translatedName = false])
  • bool $translatedName: translation flag
_sortOptionArray (line 364)
  • access: protected
void _sortOptionArray ( $option)
  • $option
Class Constants
DEFAULT_CURRENCY = 'USD' (line 39)
DEFAULT_LOCALE = 'en_US' (line 37)

Default locale name

DEFAULT_TIMEZONE = 'UTC' (line 38)
FORMAT_TYPE_FULL = 'full' (line 57)

Date and time format codes

FORMAT_TYPE_LONG = 'long' (line 58)
FORMAT_TYPE_MEDIUM = 'medium' (line 59)
FORMAT_TYPE_SHORT = 'short' (line 60)
XML_PATH_ALLOW_CODES = 'global/locale/allow/codes' (line 50)
XML_PATH_ALLOW_CURRENCIES = 'global/locale/allow/currencies' (line 51)
XML_PATH_ALLOW_CURRENCIES_INSTALLED = 'system/currency/installed' (line 52)
XML_PATH_DEFAULT_COUNTRY = 'general/country/default' (line 49)
  • deprecated: since 1.4.1.0
XML_PATH_DEFAULT_LOCALE = 'general/locale/code' (line 44)

XML path constants

XML_PATH_DEFAULT_TIMEZONE = 'general/locale/timezone' (line 45)

Documentation generated on Fri, 11 Feb 2011 17:08:06 +0200 by phpDocumentor 1.4.3