lucee.Componentmodels.i18n
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- Internationalization and localization support for ColdBox
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
controller
|
true
|
false
|
|
any
|
defaultLocale
The default locale configured for the application.
|
true
|
false
|
|
any
|
defaultResourceBundle
The default resource bundle for the application, if any.
|
true
|
false
|
|
any
|
localeStorage
The wirebox id of the storage provider.
|
true
|
false
|
|
any
|
resourceService
|
true
|
false
|
|
any
|
settings
|
true
|
false
|
|
any
|
wirebox
|
true
|
false
|
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
private any
|
buildLocale([string thisLocale='en_US'])
creates valid core java locale from java style locale ID. |
numeric
|
dateAdd(numeric thisOffset, string thisDatePart, numeric dateUnits, [any thisTZ='[runtime expression]'])
DateAdd. |
numeric
|
dateDiff(numeric thisOffset, numeric thatOffset, string thisDatePart, [any thisTZ='[runtime expression]'])
DateDiff. |
string
|
dateFormat(numeric thisOffset, [numeric thisDateFormat='1'], [any tz='[runtime expression]'])
Date format. |
any
|
dateLocaleFormat(date date, [string style='LONG'])
locale version of dateFormat. |
numeric
|
dateParse(string thisDate)
parses localized date string to datetime object or returns blank if it can't parse. |
string
|
dateTimeFormat(numeric thisOffset, [numeric thisDateFormat='1'], [numeric thisTimeFormat='1'], [any tz='[runtime expression]'])
DateTime format. |
numeric
|
dateTimeParse(string thisDate)
parses localized datetime string to datetime object or returns blank if it can't parse. |
any
|
datetimeLocaleFormat(date date, [string dateStyle='SHORT'], [string timeStyle='SHORT'])
locale date/time format. |
string
|
formatDateTime(numeric thisOffset, string thisPattern, [any tz='[runtime expression]'])
formats a date/time to given pattern. |
models.datetime
|
fromEpoch(numeric thisOffset)
converts java epoch offset to datetime. |
array
|
getAvailableTZ()
returns an array of timezones available on this server. |
string
|
getController()
|
string
|
getCurrencySymbol([boolean localized='true'])
returns currency symbol for this locale. |
numeric
|
getDST([any thisTZ='[runtime expression]'])
returns DST savings in hours. |
string
|
getDateTimePattern([numeric thisDateFormat='1'], [numeric thisTimeFormat='3'])
returns locale date/time pattern. |
numeric
|
getDay(numeric thisOffset, [any tz='[runtime expression]'])
returns day from epoch offset. |
struct
|
getDecimalSymbols()
returns structure holding decimal format symbols for this locale. |
string
|
getDefaultLocale()
|
string
|
getDefaultResourceBundle()
|
string
|
getFWCountry()
returns a human readable country name for the chosen application locale. |
string
|
getFWCountryCode()
returns 2-letter ISO country name for the chosen application locale. |
string
|
getFWISO3CountryCode()
returns 3-letter ISO country name for the chosen application locale. |
string
|
getFWISO3LanguageCode()
Returns the ISO 3 code for the locale's language. |
string
|
getFWLanguage()
Returns a human readable name for the locale's language. |
string
|
getFWLanguageCode()
Returns the two digit code for the locale's language. |
string
|
getFWLocaleDisplay()
Returns a name for the locale that is appropriate for display to the user. |
string
|
getFwLocale()
Get the user's locale. |
numeric
|
getHour(numeric thisOffset, [any tz='[runtime expression]'])
returns hour of day, 24 hr format, from epoch offset. |
array
|
getIsoCountries()
returns array of 2 letter ISO countries. |
array
|
getIsoLanguages()
returns array of 2 letter ISO languages. |
string
|
getLocaleNames()
returns list of locale names, UNICODE direction char (LRE/RLE) added as required. |
query
|
getLocaleQuery()
returns a sorted query of locales (locale,country,language,dspName,localname. |
string
|
getLocaleStorage()
|
array
|
getLocales()
returns array of locales. |
any
|
getLocalizedDays()
Facade to getShortWeedDays. |
string
|
getLocalizedMonth(numeric month)
Returns localized month. |
string
|
getLocalizedYear(numeric thisYear)
Returns localized year, probably only useful for BE calendars like in thailand, etc. |
numeric
|
getMinute(numeric thisOffset, [any tz='[runtime expression]'])
returns minute from epoch offset. |
numeric
|
getMonth(numeric thisOffset, [any tz='[runtime expression]'])
returns month from epoch offset. |
numeric
|
getRawOffset([any tz='[runtime expression]'])
returns rawoffset in hours. |
string
|
getResourceService()
|
numeric
|
getSecond(numeric thisOffset, [any tz='[runtime expression]'])
returns second from epoch offset. |
any
|
getServerTZ()
returns server TZ. |
string
|
getSettings()
|
array
|
getShortWeekDays([boolean calendarOrder='true'])
returns short day names for this calendar. |
array
|
getTZByOffset(numeric thisOffset)
returns a list of timezones available on this server for a given raw offset. |
string
|
getTZDisplayName([any thisTZ='[runtime expression]'], [string dspType=''])
returns the display name of the timezone requested in either long, short, or default style. |
any
|
getTZOffset(date thisDate, [any thisTZ='[runtime expression]'])
returns the offset in hours for the given datetime in the specified timezone. |
query
|
getTZQuery(boolean returnUnique)
returns a sorted query of timezones, optionally filters for only unique display names (fields:id,offset,dspName,longname,shortname,usesDST). |
string
|
getWirebox()
|
numeric
|
getYear(numeric thisOffset, [any tz='[runtime expression]'])
returns year from epoch offset. |
boolean
|
inDST([models.requred numeric], [any tzToTest='[runtime expression]'])
determines if a given date in a given timezone is in DST. |
boolean
|
isBidi()
determines if given locale is BIDI. |
boolean
|
isValidLocale(string thisLocale)
Validate a locale. |
void
|
onDIComplete()
Reads,parses,saves the locale and resource bundles defined in the config. |
any
|
setController(any controller)
|
any
|
setDefaultLocale(any defaultLocale)
|
any
|
setDefaultResourceBundle(any defaultResourceBundle)
|
i18n
|
setFwLocale([string locale=''])
Set the default locale to use in the framework for a specific user. |
any
|
setLocaleStorage(any localeStorage)
|
any
|
setResourceService(any resourceService)
|
any
|
setSettings(any settings)
|
any
|
setWirebox(any wirebox)
|
string
|
timeFormat(numeric thisOffset, [numeric thisTimeFormat='1'], [any tz='[runtime expression]'])
Time Format. |
any
|
timeLocaleFormat(date date, [string style='SHORT'])
locale version of timeFormat. |
numeric
|
toEpoch(date thisDate)
converts datetime to java epoch offset. |
boolean
|
usesDST([any tz='[runtime expression]'])
determines if a given timezone uses DST. |
string
|
weekStarts()
Determines the first DOW. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Property Detail |
---|
access
- publicrequired
- falsereturntype
- anyinject
- coldboxserializable
- trueThe default locale configured for the application
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe default resource bundle for the application, if any
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe wirebox id of the storage provider
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- resourceService@cbi18nserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- coldbox:moduleSettings:cbi18nserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- wireboxserializable
- trueMethod Detail |
---|
creates valid core java locale from java style locale ID
thisLocale
- trueDateAdd
thisOffset
- truethisDatePart
- truedateUnits
- truethisTZ
- trueDateDiff
thisOffset
- truethatOffset
- truethisDatePart
- truethisTZ
- trueDate format
thisOffset
- java epoch offsetthisDateFormat
- FULL=0, LONG=1, MEDIUM=2, SHORT=3tz
- timezonelocale version of dateFormat. Needs object instantiation. That is your job not mine.
date
- truestyle
- FULL=0, LONG=1, MEDIUM=2, SHORT=3parses localized date string to datetime object or returns blank if it can't parse
thisDate
- trueDateTime format
thisOffset
- java epoch offsetthisDateFormat
- FULL=0, LONG=1, MEDIUM=2, SHORT=3thisTimeFormat
- FULL=0, LONG=1, MEDIUM=2, SHORT=3tz
- timezoneparses localized datetime string to datetime object or returns blank if it can't parse
thisDate
- truelocale date/time format. Needs object instantiation. That is your job not mine.
date
- truedateStyle
- FULL=0, LONG=1, MEDIUM=2, SHORT=3timeStyle
- FULL=0, LONG=1, MEDIUM=2, SHORT=3formats a date/time to given pattern
thisOffset
- truethisPattern
- truetz
- trueconverts java epoch offset to datetime
thisOffset
- java epoch offset to convert to datetimereturns an array of timezones available on this server
returns currency symbol for this locale
localized
- return international (USD, THB, etc.) or localized ($,etc.) symbolreturns DST savings in hours
thisTZ
returns locale date/time pattern
thisDateFormat
- FULL=0, LONG=1, MEDIUM=2, SHORT=3thisTimeFormat
- FULL=0, LONG=1, MEDIUM=2, SHORT=3returns day from epoch offset
thisOffset
- java epoch offsettz
- truereturns structure holding decimal format symbols for this locale
returns a human readable country name for the chosen application locale. Eg: United States
returns 2-letter ISO country name for the chosen application locale. Eg: us
returns 3-letter ISO country name for the chosen application locale. Eg: USA
Returns the ISO 3 code for the locale's language. Eg: eng
Returns a human readable name for the locale's language. Eg: English
Returns the two digit code for the locale's language. Eg: en
Returns a name for the locale that is appropriate for display to the user. Eg: English (United States)
Get the user's locale
returns hour of day, 24 hr format, from epoch offset
thisOffset
- java epoch offsettz
- truereturns array of 2 letter ISO countries
returns array of 2 letter ISO languages
returns list of locale names, UNICODE direction char (LRE/RLE) added as required
returns a sorted query of locales (locale,country,language,dspName,localname. 'localname' will contain the locale's name in its native characters). Suitable for use in creating select lists.
returns array of locales
Facade to getShortWeedDays. For compatability
Returns localized month.
month
- trueReturns localized year, probably only useful for BE calendars like in thailand, etc.
thisYear
- truereturns minute from epoch offset
thisOffset
- java epoch offsettz
- truereturns month from epoch offset
thisOffset
- java epoch offsettz
- truereturns rawoffset in hours
tz
- truereturns second from epoch offset
thisOffset
- java epoch offsettz
- truereturns server TZ
returns short day names for this calendar
calendarOrder
- truereturns a list of timezones available on this server for a given raw offset
thisOffset
- truereturns the display name of the timezone requested in either long, short, or default style
thisTZ
- truedspType
- truereturns the offset in hours for the given datetime in the specified timezone
thisDate
- truethisTZ
- truereturns a sorted query of timezones, optionally filters for only unique display names (fields:id,offset,dspName,longname,shortname,usesDST). Suitable for use in creating select lists.
returnUnique
- truereturns year from epoch offset
thisOffset
- java epoch offsettz
- truedetermines if a given date in a given timezone is in DST
numeric
tzToTest
- truedetermines if given locale is BIDI. core java uses 'iw' for hebrew, leaving 'he' just in case this is a version thing
Validate a locale
thisLocale
- Locale to validateReads,parses,saves the locale and resource bundles defined in the config.
controller
defaultLocale
defaultResourceBundle
Set the default locale to use in the framework for a specific user.
locale
- The locale to change and set. Must be Java Style: en_US. If none passed, then we default to default locale from configuration settingslocaleStorage
resourceService
settings
wirebox
Time Format
thisOffset
- java epoch offsetthisTimeFormat
- FULL=0, LONG=1, MEDIUM=2, SHORT=3tz
- timezonelocale version of timeFormat. Needs object instantiation. That is your job not mine.
date
- truestyle
- FULL=0, LONG=1, MEDIUM=2, SHORT=3converts datetime to java epoch offset
thisDate
- datetime to convert to java epochdetermines if a given timezone uses DST
tz
- trueDetermines the first DOW.