Skip to main content
Build the t() translation function over a fixed set of sources. Resolution order, highest priority first:
  1. externalT – host i18n (e.g. Shopify), unless it echoes the key
  2. designOverrides – live design-mode edits, flat dot-path keys
  3. merchantOverrides – locale overrides from the API, nested
  4. staticContent – the theme’s default locale JSON
  5. the key itself
Design overrides are looked up per-key (own properties only) rather than merged into merchantOverrides: a flat key like cart.title must override exactly that leaf without wiping sibling keys (cart.subtitle), and a per-key own-property lookup never builds nested objects from merchant-controlled keys, so it cannot pollute Object.prototype.

Parameters

Returns

TranslateFunction