API Reference / @gtkx/i18n / IcuTransComponent
Interface: IcuTransComponent()
Defined in: node_modules/.pnpm/react-i18next@17.0.12_i18next@26.4.0_typescript@6.0.3__react@19.2.8_typescript@6.0.3/node_modules/react-i18next/index.d.ts:100
IcuTrans component for rendering ICU MessageFormat translations This is the context-aware version that works with I18nextProvider
Example
// Type-safe usage with namespace
<IcuTrans<'welcome.message', 'common'>
i18nKey="welcome.message"
defaultTranslation="Welcome <0>friend</0>!"
content={[{ type: 'strong', props: {} }]}
/>IcuTransComponent<
Key,Ns,KPrefix,TContext,TOpt>(props):ReactElement
Defined in: node_modules/.pnpm/react-i18next@17.0.12_i18next@26.4.0_typescript@6.0.3__react@19.2.8_typescript@6.0.3/node_modules/react-i18next/index.d.ts:101
IcuTrans component for rendering ICU MessageFormat translations This is the context-aware version that works with I18nextProvider
Type Parameters
Key
Key extends string
Ns
Ns extends Namespace = "translation"
KPrefix
KPrefix = undefined
TContext
TContext extends string | undefined = undefined
TOpt
TOpt extends TOptionsBase & $Dictionary & object = { context: TContext; }
Parameters
props
IcuTransProps<Key, Ns, KPrefix, TContext, TOpt>
Returns
ReactElement
Example
// Type-safe usage with namespace
<IcuTrans<'welcome.message', 'common'>
i18nKey="welcome.message"
defaultTranslation="Welcome <0>friend</0>!"
content={[{ type: 'strong', props: {} }]}
/>