No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
$Locale
The $Locale global
value provider gives you information about the browser's locale.
| Attribute | Description | Sample Value |
|---|---|---|
| language | Returns the language code. | "en", "de", "zh" |
| country | Returns the ISO 3166 representation of the country code. | "US", "DE", "GB" |
| variant | Returns the vendor and browser specific code. | "WIN", "MAC", "POSIX" |
| timezone | Returns the time zone ID based on Java's java.util.TimeZone package. | "EST", "PST", "GMT", "America/New_York" |
| numberformat | Returns the number formatting based on Java's DecimalFormat class. | "#,##0.###" # represents a digit, the comma is a placeholder for the grouping seperator, and the period is a placeholder for the decimal separator. Zero (0) replace # to represent trailing zeros. |
| decimal | Returns the decimal seperator. | "." |
| grouping | Returns the grouping separator. | "," |
| percentformat | Returns the percent formatting. | "#,##0%" |
| currencyformat | Returns the currency formatting. | "¤#,##0.00;(¤#,##0.00)" ¤ represents the currency sign, which is replaced by the currency symbol. |
| currency_code | Returns the ISO 4217 representation of the currency code. | "USD" |
| currency | Returns the currency symbol. | "$" |
Example
This example shows how to get some $Locale attributes.
Component source
1swfobject.registerObject("clippy.codeblock-0", "9");<aura:component>
2<pre>
3[language={!$Locale.language}]
4[timezone={!$Locale.timezone}]
5[numberformat={!$Locale.numberFormat}]
6[currencyformat={!$Locale.currencyFormat}]
7</pre>
8</aura:component>
9The framework also provides localization support for input and output components.