Skip to content

t

A translation from the theme’s locale files.

Keys are dotted paths in locales/<language>.json. Pass variables as key: value; count picks the plural form (Arabic has zero, one, two, few, many and other). Keys ending in _html may contain markup; other values are escaped. Missing keys fall back to the default locale, then to the key itself.

'section.key' | t: name: value, count: n

string

locales/en.default.json
{"cart":{"count":{"one":"{{ count }} item","other":"{{ count }} items"}}}
locales/ar.json
{"cart":{"count":{"zero":"لا منتجات","one":"منتج واحد","two":"منتجان","few":"{{ count }} منتجات","many":"{{ count }} منتجاً","other":"{{ count }} منتج"}}}
Liquid
{{ 'cart.count' | t: count: 3 }}
Output
3 items
locales/en.default.json
{"cart":{"count":{"one":"{{ count }} item","other":"{{ count }} items"}}}
locales/ar.json
{"cart":{"count":{"zero":"لا منتجات","one":"منتج واحد","two":"منتجان","few":"{{ count }} منتجات","many":"{{ count }} منتجاً","other":"{{ count }} منتج"}}}
Liquid (Arabic page)
{{ 'cart.count' | t: count: 2 }} · {{ 'cart.count' | t: count: 3 }} · {{ 'cart.count' | t: count: 11 }}
Output
منتجان · 3 منتجات · 11 منتجاً

Since theme platform 1.0.

Was this page helpful?