You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`className`| string | Class name to be added to `<span>` element |
21
-
|`render`| Function(props) -> Element \|`null`| Custom render callback to render translation |
22
-
|`component`| Component \|`null`| Custom component to render translation |
21
+
|`render`| Function(props) -> Element \|`null`| Custom render callback to render translation |
22
+
|`component`| Component \|`null`| Custom component to render translation |
23
+
|`comment`| string | Comment picked up by extractor to provide translation context |
23
24
24
25
`className` is used only for built-in components (when *render* is string).
25
26
@@ -153,7 +154,7 @@ import { Trans } from "@lingui/macro"
153
154
```
154
155
:::
155
156
156
-
It's also possible to use `Trans` component directly without macros. In that case, `id` identifies the message being translated. `values` and `components` are arguments and components used for formatting translation:
157
+
It's also possible to use `Trans` component directly without macros. In that case, `id` identifies the message being translated. `values` and `components` are arguments and components used for formatting translation. `comment` helps add context for translators:
157
158
158
159
```jsx
159
160
<Trans id="my.message" message="Hello World"/>
@@ -164,6 +165,12 @@ It's also possible to use `Trans` component directly without macros. In that cas
164
165
values={{ name:'Arthur' }}
165
166
/>
166
167
168
+
<Trans
169
+
id="hello.world"
170
+
message="Hello world"
171
+
comment="a message that says hi to the world"
172
+
/>
173
+
167
174
// number of tag corresponds to index in `components` prop
0 commit comments