Skip to content

getLocales(int items_per_page)

The getLocales method is used to get the LocalesList object that represents a list of active locales.

Input parameters

items_per_page

int Number of items in a page of internal paginator. Parameter is optional. Default value is 100.

Returned value

The LocalesList object.

Example

source
{% set localesList = ObjectApi.getLocales() %}
{% for locale in localesList %}
        <a href="{{ locale.url }}" title="{{ locale.name }}">
            Code: {{ locale.locale }}
        </a>
{% endfor %}
output
<a href="/en_US/index" title="english">
    Code: en_US
</a>
<a href="/pl_PL/index" title="polish">
    Code: pl_PL
</a>