WEB-INF.cftags.component coldbox.system.FrameworkSupertype coldbox.system.Plugin coldbox.system.plugins.i18n
Internationalization and localization support for ColdBox
Constructor Summary | |
---|---|
init(any controller)
Constructor. |
Method Summary | |
---|---|
private any
|
buildLocale([string thisLocale='en_US'])
creates valid core java locale from java style locale ID. |
any
|
dateLocaleFormat(date date, [string style='LONG'])
locale version of dateFormat. |
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. |
date
|
fromEpoch(numeric thisOffset)
converts java epoch offset to datetime. |
array
|
getAvailableTZ()
returns an array of timezones available on this server. |
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 strucure holding decimal format symbols for this locale. |
any
|
getDefaultLocale()
Get the default locale string. |
any
|
getDefaultResourceBundle()
Get the default resource bundle path. |
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. |
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. |
any
|
getLocaleStorage()
Get the locale storage string. |
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. |
struct
|
getRBundles()
Get a reference to the loaded language keys. |
numeric
|
getRawOffset([any tZ='[runtime expression]'])
returns rawoffset in hours. |
numeric
|
getSecond(numeric thisOffset, [any tz='[runtime expression]'])
returns second from epoch offset. |
any
|
getServerTZ()
returns server TZ. |
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(numeric thisOffset, [any thisTZ='[runtime expression]'])
returns offset in hours. |
query
|
getTZQuery(boolean returnUnique='true')
returns a sorted query of timezones, optionally filters for only unique display names (fields:id,offset,dspName,longname,shortname,usesDST). |
struct
|
getVersion()
returns version of this CFC and icu4j library it uses. |
numeric
|
getYear(numeric thisOffset, [any tz='[runtime expression]'])
returns year from epoch offset. |
any
|
getfwLocale()
Get the user's locale. |
numeric
|
i18nDateAdd(numeric thisOffset, string thisDatePart, numeric dateUnits, [any thisTZ='[runtime expression]'])
|
numeric
|
i18nDateDiff(numeric thisOffset, numeric thatOffset, string thisDatePart, [any thisTZ='[runtime expression]'])
|
string
|
i18nDateFormat(numeric thisOffset, [numeric thisDateFormat='1'], [any tz='[runtime expression]'])
|
numeric
|
i18nDateParse(string thisDate)
parses localized date string to datetime object or returns blank if it can't parse. |
string
|
i18nDateTimeFormat(numeric thisOffset, [numeric thisDateFormat='1'], [numeric thisTimeFormat='1'], [any tz='[runtime expression]'])
|
numeric
|
i18nDateTimeParse(string thisDate)
parses localized datetime string to datetime object or returns blank if it can't parse. |
string
|
i18nTimeFormat(numeric thisOffset, [numeric thisTimeFormat='1'], [any tz='[runtime expression]'])
|
boolean
|
inDST(numeric thisOffset, [any tzToTest='[runtime expression]'])
determines if a given date in a given timezone is in DST. |
void
|
init_i18N()
Reads,parses,saves the locale and resource bundles defined in the config. |
boolean
|
isBidi()
determines if given locale is BIDI. |
boolean
|
isValidLocale(string thisLocale)
Validate a locale. |
any
|
setDefaultLocale(any defaultLocale)
Set the default locale. |
any
|
setDefaultResourceBundle(any defaultResourceBundle)
Set the default resource bundle. |
any
|
setLocaleStorage(any localeStorage)
Set the locale storage. |
any
|
setfwLocale([string locale=''], [boolean dontloadRBFlag='false'])
Set the default locale to use in the framework for a specific user. |
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 WEB-INF.cftags.component |
---|
None |
Constructor Detail |
---|
Constructor
controller
Method Detail |
---|
creates valid core java locale from java style locale ID
thisLocale
locale version of dateFormat. Needs object instantiation. That is your job not mine.
date
style
- FULL=0, LONG=1, MEDIUM=2, SHORT=3locale date/time format. Needs object instantiation. That is your job not mine.
date
dateStyle
- FULL=0, LONG=1, MEDIUM=2, SHORT=3timeStyle
- FULL=0, LONG=1, MEDIUM=2, SHORT=3formats a date/time to given pattern
thisOffset
thisPattern
tz
converts 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
returns strucure holding decimal format symbols for this locale
Get the default locale string
Get the default resource bundle path
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)
returns hour of day, 24 hr format, from epoch offset
thisOffset
- java epoch offsettz
returns 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.
Get the locale storage string
returns array of locales
Facade to getShortWeedDays. For compatability
Returns localized month.
month
Returns localized year, probably only useful for BE calendars like in thailand, etc.
thisYear
returns minute from epoch offset
thisOffset
- java epoch offsettz
returns month from epoch offset
thisOffset
- java epoch offsettz
Get a reference to the loaded language keys
returns rawoffset in hours
tZ
returns second from epoch offset
thisOffset
- java epoch offsettz
returns server TZ
returns short day names for this calendar
calendarOrder
returns a list of timezones available on this server for a given raw offset
thisOffset
returns the display name of the timezone requested in either long, short, or default style
thisTZ
dspType
returns offset in hours
thisOffset
thisTZ
returns 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
returns version of this CFC and icu4j library it uses.
returns year from epoch offset
thisOffset
- java epoch offsettz
Get the user's locale
getfwLocale
in class
FrameworkSupertype
thisOffset
thisDatePart
dateUnits
thisTZ
thisOffset
thatOffset
thisDatePart
thisTZ
thisOffset
- java epoch offsetthisDateFormat
- FULL=0, LONG=1, MEDIUM=2, SHORT=3tz
parses localized date string to datetime object or returns blank if it can't parse
thisDate
thisOffset
- java epoch offsetthisDateFormat
- FULL=0, LONG=1, MEDIUM=2, SHORT=3thisTimeFormat
- FULL=0, LONG=1, MEDIUM=2, SHORT=3tz
parses localized datetime string to datetime object or returns blank if it can't parse
thisDate
thisOffset
- java epoch offsetthisTimeFormat
- FULL=0, LONG=1, MEDIUM=2, SHORT=3tz
determines if a given date in a given timezone is in DST
thisOffset
tzToTest
Reads,parses,saves the locale and resource bundles defined in the config. Called only internally by the framework. Use at your own risk
determines if given locale is BIDI
Validate a locale
thisLocale
- Locale to validateSet the default locale
defaultLocale
Set the default resource bundle
defaultResourceBundle
Set the locale storage
localeStorage
Set the default locale to use in the framework for a specific user.
setfwLocale
in class
FrameworkSupertype
locale
- The locale to change and set. Must be Java Style: en_US. If none passed, then we default to default locale from configuration settingsdontloadRBFlag
- Flag to load the resource bundle for the specified locale (If not already loaded) or just change the framework's locale.locale version of timeFormat. Needs object instantiation. That is your job not mine.
date
style
- 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
Determines the first DOW.