Plugins:i18nAPI
Exploring the i18n Plugin
Overview
This is the i18N plugin based on Paul Hastings cfc. It uses standard Java locale names and has its own storage mechanism via RBundles['Locale']. In order to use the plugin, you must instantiate it and call its setfwLocale() method with the appropriate locale to initialize with. Then you may use its methods.
getSecond
returns second from epoch offset
Returns
- This function returns numeric
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | java epoch offset |
| tz | any | No | [runtime expression] |
Examples
showLanguage
returns display country name for given locale
Returns
- This function returns string
Examples
getServerTZ
returns server TZ
Returns
- This function returns any
Examples
showLocaleCountry
returns display country name for given locale
Returns
- This function returns string
Examples
getLocalizedYear
Returns localized year, probably only useful for BE calendars like in thailand, etc.
Returns
- This function returns string
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisYear | numeric | Yes | --- |
Examples
dateLocaleFormat
locale version of dateFormat. Needs object instantiation. That is your job not mine.
Returns
- This function returns any
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| date | date | Yes | --- | |
| style | string | No | LONG | FULL=0, LONG=1, MEDIUM=2, SHORT=3 |
Examples
getLocalizedDays
Facade to getShortWeedDays. For compatability
Returns
- This function returns any
Examples
showLocaleLanguage
returns display country name for given locale
Returns
- This function returns string
Examples
setfwLocale
Set the default locale to use in the framework for a specific user.
Returns
- This function returns any
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| locale | string | No | [runtime expression] | The locale to change and set. Must be Java Style: en_US |
| dontloadRBFlag | boolean | No | false | Flag to load the resource bundle for the specified locale (If not already loaded) or just change the framework's locale. |
Examples
getVersion
returns version of this CFC and icu4j library it uses.
Returns
- This function returns struct
Examples
getTZByOffset
returns a list of timezones available on this server for a given raw offset
Returns
- This function returns array
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- |
Examples
toEpoch
converts datetime to java epoch offset
Returns
- This function returns numeric
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisDate | date | Yes | --- | datetime to convert to java epoch |
Examples
inDST
determines if a given date in a given timezone is in DST
Returns
- This function returns boolean
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | |
| tzToTest | any | No | [runtime expression] |
Examples
getDay
returns day from epoch offset
Returns
- This function returns numeric
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | java epoch offset |
| tz | any | No | [runtime expression] |
Examples
timeLocaleFormat
locale version of timeFormat. Needs object instantiation. That is your job not mine.
Returns
- This function returns any
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| date | date | Yes | --- | |
| style | string | No | SHORT | FULL=0, LONG=1, MEDIUM=2, SHORT=3 |
Examples
getMonth
returns month from epoch offset
Returns
- This function returns numeric
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | java epoch offset |
| tz | any | No | [runtime expression] |
Examples
isValidLocale
Validate a locale
Returns
- This function returns boolean
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisLocale | string | Yes | --- | Locale to validate |
Examples
i18nDateTimeParse
parses localized datetime string to datetime object or returns blank if it can't parse
Returns
- This function returns numeric
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisDate | string | Yes | --- |
Examples
getTZOffset
returns offset in hours
Returns
- This function returns any
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | |
| thisTZ | any | No | [runtime expression] |
Examples
getYear
returns year from epoch offset
Returns
- This function returns numeric
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | java epoch offset |
| tz | any | No | [runtime expression] |
Examples
getLocalizedMonth
Returns localized month.
Returns
- This function returns string
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| month | numeric | Yes | --- |
Examples
datetimeLocaleFormat
locale date/time format. Needs object instantiation. That is your job not mine.
Returns
- This function returns any
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| date | date | Yes | --- | |
| dateStyle | string | No | SHORT | FULL=0, LONG=1, MEDIUM=2, SHORT=3 |
| timeStyle | string | No | SHORT | FULL=0, LONG=1, MEDIUM=2, SHORT=3 |
Examples
fromEpoch
converts java epoch offset to datetime
Returns
- This function returns date
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | java epoch offset to convert to datetime |
Examples
getDST
returns DST savings in hours
Returns
- This function returns numeric
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisTZ | any | No | [runtime expression] |
Examples
getRawOffset
returns rawoffset in hours
Returns
- This function returns numeric
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| tZ | any | No | [runtime expression] |
Examples
usesDST
determines if a given timezone uses DST
Returns
- This function returns boolean
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| tz | any | No | [runtime expression] |
Examples
getTZQuery
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.
Returns
- This function returns query
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| returnUnique | boolean | Yes | true |
Examples
i18nDateDiff
Returns
- This function returns numeric
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | |
| thatOffset | numeric | Yes | --- | |
| thisDatePart | string | Yes | --- | |
| thisTZ | any | No | [runtime expression] |
Examples
getLocaleNames
returns list of locale names, UNICODE direction char (LRE/RLE) added as required
Returns
- This function returns string
Examples
getLocaleQuery
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
- This function returns query
Examples
getShortWeekDays
returns short day names for this calendar
Returns
- This function returns array
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| calendarOrder | boolean | No | true |
Examples
i18nDateFormat
Returns
- This function returns string
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | java epoch offset |
| thisDateFormat | numeric | No | 1 | FULL=0, LONG=1, MEDIUM=2, SHORT=3 |
| tz | any | No | [runtime expression] |
Examples
showISOCountry
returns 2-letter ISO country name for given locale
Returns
- This function returns string
Examples
getTZDisplayName
returns the display name of the timezone requested in either long, short, or default style
Returns
- This function returns string
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisTZ | any | No | [runtime expression] | |
| dspType | string | No |
Examples
i18nDateTimeFormat
Returns
- This function returns string
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | java epoch offset |
| thisDateFormat | numeric | No | 1 | FULL=0, LONG=1, MEDIUM=2, SHORT=3 |
| thisTimeFormat | numeric | No | 1 | FULL=0, LONG=1, MEDIUM=2, SHORT=3 |
| tz | any | No | [runtime expression] |
Examples
getDecimalSymbols
returns strucure holding decimal format symbols for this locale
Returns
- This function returns struct
Examples
getAvailableTZ
returns an array of timezones available on this server
Returns
- This function returns array
Examples
i18nDateParse
parses localized date string to datetime object or returns blank if it can't parse
Returns
- This function returns numeric
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisDate | string | Yes | --- |
Examples
getHour
returns hour of day, 24 hr format, from epoch offset
Returns
- This function returns numeric
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | java epoch offset |
| tz | any | No | [runtime expression] |
Examples
i18nDateAdd
Returns
- This function returns numeric
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | |
| thisDatePart | string | Yes | --- | |
| dateUnits | numeric | Yes | --- | |
| thisTZ | any | No | [runtime expression] |
Examples
getISOcountries
returns array of 2 letter ISO countries
Returns
- This function returns array
Examples
formatDateTime
formats a date/time to given pattern
Returns
- This function returns string
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | |
| thisPattern | string | Yes | --- | |
| tz | any | No | [runtime expression] |
Examples
isBidi
determines if given locale is BIDI
Returns
- This function returns boolean
Examples
getMinute
returns minute from epoch offset
Returns
- This function returns numeric
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | java epoch offset |
| tz | any | No | [runtime expression] |
Examples
getISOlanguages
returns array of 2 letter ISO languages
Returns
- This function returns array
Examples
i18nTimeFormat
Returns
- This function returns string
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisOffset | numeric | Yes | --- | java epoch offset |
| thisTimeFormat | numeric | No | 1 | FULL=0, LONG=1, MEDIUM=2, SHORT=3 |
| tz | any | No | [runtime expression] |
Examples
weekStarts
Determines the first DOW.
Returns
- This function returns string
Examples
getLocales
returns array of locales
Returns
- This function returns array
Examples
getfwLocale
Get the user's locale
Returns
- This function returns any
Examples
showCountry
returns display country name for given locale
Returns
- This function returns string
Examples
getDateTimePattern
returns locale date/time pattern
Returns
- This function returns string
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| thisDateFormat | numeric | No | 1 | FULL=0, LONG=1, MEDIUM=2, SHORT=3 |
| thisTimeFormat | numeric | No | 3 | FULL=0, LONG=1, MEDIUM=2, SHORT=3 |
Examples
getCurrencySymbol
returns currency symbol for this locale
Returns
- This function returns string
Arguments
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| localized | boolean | No | true | return international (USD, THB, etc.) or localized ($,etc.) symbol |

SideBar
User Login 




Comments (