Skip to main content

shop_locale

A language in a store.

To learn how to offer localization options in your theme, refer to Support multiple currencies and languages.

Properties

Anchor to
direction
string from a set of values

The text direction of the locale.

Returns rtl for right-to-left locales and ltr for left-to-right locales.

You can use direction to set the dir attribute on the html element, so that the page flows correctly for right-to-left languages.

Possible values
ltr
rtl
Anchor to
endonym_name

The name of the locale in the locale itself.

Anchor to
iso_code

The ISO code of the locale in IETF language tag format.

The name of the locale in the store's primary locale.

Anchor to
primary

Returns true if the locale is the store's primary locale. Returns false if not.

Anchor to
root_url

The relative root URL of the locale.

{
"direction": "ltr",
"endonym_name": "English",
"iso_code": "en",
"name": "English",
"primary": true,
"root_url": "/"
}
Was this section helpful?