Skip to main content

Localization

Localization filters enable you to customize the language and format of elements according to the customer’s locale.

t

string | t
returns  string

Returns a string of translated text for a given translation key from a locale file.

📘 Tip

To learn more about using the t filter, refer to Storefront locale file usage.

The translation key must be prefixed with i18n., followed by the key's path in the locale file.

{{ 'i18n.products.product.sold_out' | t }}

Pass named arguments to interpolate variables into the translated string:

{{ 'i18n.products.product.save' | t: amount: 18.88 }}

🚧 Caution

Count-based plural forms (such as one/other value objects) aren't supported. Use a flat string for each key, and handle pluralization in Liquid if you need it.