Locale
The locale
object describes the language and regional settings for the store or customer, including code, name, endonym, and root URL.
Usage Example
{%- comment -%} Show the current locale code, name, and endonym {%- endcomment -%}
<p>
Language: {{ locale.code }} ({{ locale.name }})<br>
Endonym: {{ locale.endonym_name }}<br>
Root URL: {{ locale.root_url }}
</p>
{% if locale.primary %}
<p>This is the store's primary locale.</p>
{% endif %}
Properties
code
Returns the locale code (e.g., en
, fi
). Alias for iso_code
.
endonym_name
Returns the endonym name for this locale (e.g., Suomi
for Finnish).
iso_code
Returns the ISO code for this locale.
name
Returns the name of the locale (e.g., English
, Finnish
).
primary
Returns true if this locale is the store’s primary locale.
root_url
Returns the root URL for this locale.
Last updated on