Skip to content

Commit 8a88e1d

Browse files
committed
docs: document markup
1 parent 40b8096 commit 8a88e1d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Web/Documentation/content/main/2-features/11-localization.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,18 @@ cart:
134134
* * {{Masz {$count} elementów w koszyku.}}
135135
```
136136

137+
### Using markup
138+
139+
Markup may be added to translation messages using a [dedicated syntax](https://messageformat.unicode.org/docs/reference/markup/) defined in the MessageFormat specification. Tempest provides a markup implementation that renders HTML tags and Iconify icons.
140+
141+
```yaml
142+
bold_text: 'This is {#strong}bold{/strong}.'
143+
ui:
144+
open_menu: '{#icon-tabler-menu/} Open menu'
145+
```
146+
147+
It is possible to implement your own markup by implementing the {b`Tempest\Intl\MessageFormat\MarkupFormatter`} or {b`Tempest\Intl\MessageFormat\StandaloneMarkupFormatter`} interfaces. Classes implementing these interfaces are automatically discovered by Tempest.
148+
137149
### Custom formatting functions
138150

139151
The [MessageFormat 2.0](https://messageformat.unicode.org/) specification allows for defining custom formatting functions that can be used in translation messages. By default, Tempest provides formatting functions for strings, numbers and dates.

0 commit comments

Comments
 (0)