About the Locale API

The Locale API lets you read the site's language and regional settings. Use it to format dates, times, and numbers, and to lay out text, so they match the site's settings for every site visitor, both on the server and in the browser.

With the Locale API, you can:

  • Retrieve the site's main language and its text direction.
  • Retrieve the site's regional format.
  • Retrieve the site's time zone.

Every value comes from the site's settings, not the site visitor's browser or device. The values are the same while the page renders on the server and in the browser, so code that formats with them produces the same output in both places.

Before you begin

It's important to note the following points before starting to code:

  • The values can change while the page is open. Read them while a component renders, so the component updates when they change.

Use cases

Terminology

  • Regional format: The site's setting for how to write dates, times, and numbers, such as whether the day comes before the month.
  • Site time zone: The time zone set for the site's business. It's the same for every site visitor, wherever they're located.

SDK setup

@wix/site-service-locale

To use the API, install the @wix/site-service-locale package:

Copy

Import the package

Copy

Import types

Import any type shown in these docs from @wix/site-service-locale/types:

Copy

Resolve the service

In a React component, resolve the service with the useService hook:

Copy

Last updated: 13 October 2026

Did this help?