Gets site locale information.
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.
function getLocale(): Promise<GeneralInfoLocale>;
import { Permissions, webMethod } from "wix-web-module";
import wixSiteBackend from "wix-site-backend";
export const getLocale = webMethod(Permissions.Anyone, () => {
return wixSiteBackend.generalInfo.getLocale();
});
/*
* {
* "country": "US",
* "languageCode": "en"
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.