Localization Filters
Localization filters let you adjust the language and style of elements based on the user’s location.
currency_selector
font | font_url: string
Creates an HTML <select> element containing options for each currency listed in the store.
The currency selector
filter needs to be applied to the form object within a currency form.
class
form | currency_selector: class: string
Specify the class attribute of the <select> element.
id
form | currency_selector: id: string
Specify the id attribute of the <select> element.
format_address
Generates an HTML address display, organizing each part of the address based on its location.
translate
Returns a string of translated text for a given translation key from a locale file.
The translate filter has an alias of t, which is more commonly used.
Note: To understand more about using the t
filter, please consult the storefront locale file usage or schema locale file usage.
Section locales vs. theme locales
The t
filter can use keys from the locales object in a section file's schema tag. Content defined under locales in the schema is exclusive to that section, making it useful for standalone sections shared between themes.
Global theme content should go in the theme's locales directory. For instance, you might store "See more" in locales for a single translation across blog posts and product details.
Note: Translations within the section's schema
tag that are not included in the locales
object are utilized for text visible to merchants in the theme editor. These translations do not employ the t
filter.