Methods to handle locale selection and retrieve localized content when multi-language is enabled.

Returns an array of enabled locales. Result will be empty if multi-language has not been configured on the store.

List enabled locales
[
  {
    "code": "en",
    "name": "English"
  },
  {
    "code": "fr",
    "name": "French"
  },
  {
    "code": "es",
    "name": "Spanish"
  }
]

Sets a browser cookie and updates the user's session and cart to the selected locale.

In a multi-language setup, call the select() method to change settings used to retrieve all types of content (products, pages, etc.)

If a cart exists in the user's session, this method also updates the cart to reflect the user's locale preference

The store default or user-selected locale is used automatically when retrieving content with this library.

Retrieve localized content
{
  ...
  "name": "Producto de prueba"
  ...
}

Results will have the same shape as non-localized values, with localized fields overwriting default ones.

Returns the selected locale code. Defaults to the store's default locale.