$Locale

The $Locale global value provider returns information about the current user’s preferred locale.

AttributeDescriptionSample Value
countryThe ISO 3166 representation of the country code based on the language locale.”US”, “DE”, “GB”
currencyThe currency symbol.”$“
currencyCodeThe ISO 4217 representation of the currency code.”USD”
decimalThe decimal separator.”.”
firstDayOfWeekThe first day of the week, where 1 is Sunday.1
groupingThe grouping separator.”,“
isEasternNameStyleSpecifies if a name is based on eastern style, for example, last name first name [middle] [suffix].false
labelForTodayThe label for the Today link on the date picker.“Today”
languageThe language code based on the language locale.”en”, “de”, “zh”
langLocaleThe locale ID.“en_US”, “en_GB”
nameOfMonthsThe full and short names of the calendar months{ fullName: “January”, shortName: “Jan” }
nameOfWeekdaysThe full and short names of the calendar weeks{ fullName: “Sunday”, shortName: “SUN” }
timezoneThe time zone ID.”America/Los_Angeles”
userLocaleCountryThe country based on the current user’s locale“US”
userLocaleLangThe language based on the current user’s locale“en”
variantDeprecated. The variation for a language dialect. 

Number and Date Formatting 

AttributeDescriptionSample Value
currencyFormatThe currency format.”¤#,##0.00;(¤#,##0.00)” ¤ represents the currency sign, which is replaced by the currency symbol.
dateFormatThe date format.”MMM d, yyyy”
datetimeFormatThe date time format.”MMM d, yyyy h:mm:ss a”
longDateFormatThe long date format.”MMMM d, yyyy”
numberFormatThe number format.”#,##0.###” # represents a digit, the comma is a placeholder for the grouping separator, and the period is a placeholder for the decimal separator. Zero (0) replaces # to represent trailing zeros.
percentFormatThe percentage format.”#,##0%“
shortDateFormatThe short date format.”M/d/yyyy”
shortDatetimeFormatThe short date time format.”M/d/yyyy h:mm a”
shortTimeFormatThe short time format.”h:mm a”
showJapaneseCalendarSpecifies whether to show dates in the Japanese Imperial calendar formatfalse
timeFormatThe time format.”h:mm:ss a”
zeroThe character for the zero digit.“0”

Example 

This example shows how to retrieve different $Locale attributes.

Component source

1<aura:component>
2    {!$Locale.language}
3    {!$Locale.timezone}
4    {!$Locale.numberFormat}
5    {!$Locale.currencyFormat}
6</aura:component>

Similarly, you can check locale information in JavaScript using $A.get().

1({
2    checkDevice: function(component) {
3        var locale = $A.get("$Locale.language");
4        alert("You are using " + locale);
5    }
6})

See Also