Wiki  |   Blog  |   Sitemap  |   Search  
Home
JavaScript UI FrameworkReference

Class Locale

Provides APIs for localizing applications. You can set or change current locale in your application by setting locale configuration property.

Members Table

The following table lists the members exposed by the Locale object.

Show:
Properties
Methods

Remarks

Date formats. When more specific control is needed over the formatting, you may create custom formats using custom tokens.

  • f - Long Date, Short Time
  • F - Long Date, Long Time
  • t - Short Time
  • T - Long Time
  • d - Short Date
  • D - Long Date
  • Y - Month/Year
  • M - Month/Day
  • S - Sortable date format "yyyy-MM-ddTHH:mm:ss"

Number formats. For number formats you can also use number next to format identifier to give output string length. For example ample.locale.format(0.12345, "p4") will output 12.3450 % in default en-US locale.

  • n - number
  • d - decimal digits
  • p - percentage
  • c - currency

Examples

Setting application locale to South-African Afrikaans language:
ample.config("locale", "af-ZA");