The <T> component
Using the <T> component could not be easier. Wrap your content in it, and the content is translated.
<T>This content will be translated</T>
Props
| Prop | Type | Description |
|---|---|---|
formality | 'informal' | 'formal' | Sets the formality of the translation. |
lang | Language | Overrides the language set on the MagicTranslateProvider. |
Limitations
There are very few limitations:
- You cannot put React components inside the
<T>component. Plain HTML elements are fine (see the example below). - The content inside a
<T>component cannot exceed 10 KB, which is about 5,000 characters.
{/* this is OK, since <a> is a plain HTML element */}<T><a href="mailto:info@i42.ch">Please send us an email</a></T>{/* this does NOT work, since <MyButton> is a React component */}<T><MyButton>Click me</MyButton></T>