Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #20 from guillaumevincent/dev
Browse files Browse the repository at this point in the history
Improve doc about HTML rendering in locale
  • Loading branch information
kazupon committed Feb 8, 2016
2 parents 37e42b8 + 0aec032 commit 3d890c6
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,38 @@ Output the following:
```



# Formatting
## HTML formatting
In some cases you might want to rendered your translation as an HTML message and not a static string.

```javascript
var locales = {
en: {
message: {
hello: 'hello <br> world'
}
}
}
```

Template the following (notice the tripple brackets):

```html
<div class="message">
<p>{{{ $t('message.hello') }}}</p>
</div>
```

Output the following (instead of the message pre formatted)

```html
<div class="message">
<p>hello
<!--<br> exists but is rendered as html and not a string-->
world</p>
</div>
```

## Named formatting

Expand Down

0 comments on commit 3d890c6

Please sign in to comment.