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
If you want to use the same tag across your app, you can configure it via the [default translation values](/docs/usage/configuration#default-translation-values).
277
+
Tags can be arbitrarily nested (e.g. `This is <important><very>very</very> important</important>`).
279
278
280
-
Note that the ICU parser doesn't support self-closing tags at this point, therefore you have to use syntax like `<br></br>` if your rich text function doesn't intend to receive any `chunks` (e.g. `br: () => <br />`).
279
+
<details>
280
+
<summary>How can I reuse a tag across my app?</summary>
281
+
282
+
If you want to use the same tag across your app, you can configure it via [default translation values](/docs/configuration#default-translation-values).
283
+
284
+
</details>
285
+
286
+
<details>
287
+
<summary>How can I use "self-closing" tags without any chunks?</summary>
288
+
289
+
Messages can use tags without any chunks as children, but syntax-wise, a closing tag is required by the ICU parser:
290
+
291
+
```json filename="en.json"
292
+
{
293
+
"message": "Hello,<br></br>how are you?"
294
+
}
295
+
```
296
+
297
+
```js
298
+
t.rich('message', {
299
+
br: (chunks) =><br />
300
+
});
301
+
```
302
+
303
+
</details>
304
+
305
+
<details>
306
+
<summary>How can I pass attributes to tags?</summary>
307
+
308
+
Attributes can only be set on the call site, not within messages:
For the use case of localizing pathnames, consider using [`createLocalizedPathnamesNavigation`](/docs/routing/navigation#localized-pathnames).
323
+
324
+
In case you have attribute values that are required to be configured as part of your messages, you can retrieve them from a separate message and pass them to another one as an attribute:
325
+
326
+
```json filename="en.json"
327
+
{
328
+
"message": "See this <partner>partner website</partner>.",
0 commit comments