t() function.
Must be used inside a component wrapped by withWeaverse or TranslationProvider.
Keys are dot paths into the theme’s text (cart.title reads
{ "cart": { "title": "..." } }), and t() replaces {{name}}
placeholders with the matching variables value. It does not handle plurals
or number formatting. t(key) returns the first value it finds, highest
priority first:
- The external
tpassed towithWeaverse(Layout, { t })orTranslationProvider, unless it returns an empty string or the key unchanged. - Unsaved edits the merchant is making in Studio’s design mode.
- The merchant’s translations for the active locale (
merchantOverrides). - The theme’s default copy (
staticContent, fromi18n.staticContentin the theme schema). - The key itself.
withWeaverse reads staticContent and merchantOverrides
from the root loader’s weaverseTheme (the loadThemeSettings() result).
Throws when no TranslationProvider is above it.
Returns
TranslationValue