Search.../

getLocale( )

Gets site locale information.

Description

The getLocale() function returns a Promise that resolves to the site's locale information.

The retrieved locale information is the information that has been entered in the General Info section of your site's Dashboard.

Syntax

function getLocale(): Promise<GeneralInfoLocale>

getLocale Parameters

This function does not take any parameters.

Returns

Fulfilled - An object containing the site locale information. Rejected - Error message.

Return Type:

Promise<GeneralInfoLocale>

Was this helpful?

Get site locale information

Code Example

Copy Code
1import wixSiteBackend from 'wix-site-backend';
2
3export function getLocale() {
4 return wixSiteBackend.generalInfo.getLocale();
5}
6
7/*
8 * {
9 * "country": "US",
10 * "languageCode": "en"
11 * }
12 */