Enhanced translation function with Trans component support. Extends the basic translation function with a trans method for safe component rendering. Framework-agnostic - works with any UI framework.
trans
Renders a translation with framework components for safe HTML-like content. Returns an array of strings and framework-specific components.
// Framework-agnostic usageconst elements = t.trans('help.message', { components: { link: (children) => createLinkComponent(children) }, vars: { name: 'John' }});// Result: ['Hello ', LinkComponent, ', click here for help.'] Copy
// Framework-agnostic usageconst elements = t.trans('help.message', { components: { link: (children) => createLinkComponent(children) }, vars: { name: 'John' }});// Result: ['Hello ', LinkComponent, ', click here for help.']
Enhanced translation function with Trans component support. Extends the basic translation function with a
transmethod for safe component rendering. Framework-agnostic - works with any UI framework.