Search...
locale
Deprecated. The locale
property is being deprecated. Use the
browserLocale
property instead.
Description
Gets the locale of the current environment.
Migration Instructions
If this property is already in your code, it will continue to work. To stay compatible with future changes, migrate to
wixWindow.browserLocale
.To migrate to the new property:
Look for any code that uses
wixWindow.locale
and replace it withwixWindow.browserLocale
.Test your changes to make sure your code behaves as expected.
A locale, also known as an IETF language tag, is an abbreviated code that defines the user's language, country, and other aspects of the user interface such as number format and date format.
Some common locales include:
"en-US"
: English, United States"en-GB"
: English, British"es-ES"
: Spanish, Spain"de-DE"
: German, Germany"ja-JP"
: Japanese, Japan"fr-CH"
: French, Switzerland"it-IT"
: Italian, Italy
Type:
stringRead Only
Was this helpful?
Get an environment's locale
Copy Code
1// NOTE: This example uses the new wixWindow.browserLocale2// property, which replaces wixWindow.locale.3// See line 13 for the deprecated example.45import wixWindow from 'wix-window';67// ...89let browserLocale = wixWindow.browserLocale; // "en-US"10111213// NOTE: This example uses the deprecated14// wixWindow.locale property.1516import wixWindow from 'wix-window';1718// ...1920let locale = wixWindow.locale; // "en-US"