Skip to content

getLocale(int locale_id)

The getLocale method is used to get a Locale object that represents locale in the storefront.

Input parameters

locale_id

int Numeric identifier of the locale.

Returned value

The Locale object. If the locale is inactive or does not exist, the method returns null.

Example

source
{% set locale = ObjectApi.getLocale(locale_id) %}
{{ locale.name }}
output
english