Configure the default locale for a site

By default, when a shopper visits an Oracle Commerce site, it displays in the browser's preferred language if that language supported by the site. You can configure the site to display in the site's default language, even if it is not the browser's preferred language.

Each language Commerce supports matches an ISO locale. A site's default language is specified internally by its defaultLocaleId property. To override the browser's preferred language and display a site in the site's default language, Use the Admin API to set the site object’s useDefaultSiteLocale property to TRUE. (It is set to FALSE by default.)

Use the updateSite endpoint to modify the useDefaultSiteLocale property on an existing site. For example:

PUT /ccadmin/v1/sites/100002  HTTP/1.1
Authorization: Bearer <access_token>
x-ccasset-language: en

{
  "properties":
  {
    "useDefaultSiteLocale": "true"
   }
}

When you set a site's useDefaultSiteLocale property to TRUE, you must also make sure the site is using the most recent version of the Header widget and Language element.

See Configure Sites for more information about using the REST API to work with sites.