t - Liquid Filter Reference - 0.11.2

Filter Name t
Group Theme
Version 0.11.2

Description

Returns the translation for a given key for the current locale

Examples

{{ 'products.general.title' | t }}
All Products
When variables are passed in:
{{ 'products.general.cta' | t: product: 'Whiz Bang 3000' }}
Order a Whiz Bang 3000 Now!
When a liquid variable is used, it uses the variable’s value:
{{ 'products.general.cta' | t: product: product.name }}
Order a Geronimo 9000 Now!
When an expected variable is not supplied, it leaves the placeholder in place:
{{ 'products.general.cta' | t }}
Order a %{product} Now!
When an unknown key is used:
{{ 'unknown.key' | t }}
missing translation: `unknown.key` for locale: `en`
When an unknown variable is used, it ignores the variable:
{{ 'products.general.title' | t: product: 'Whiz Bang 3000' }}
All Products

Back to Filter List

Back to Liquid Reference for 0.11.2

 

 
Back to Documentation