Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow raw HTML in i18n message? #24

Open
gigix opened this issue Jan 24, 2015 · 4 comments
Open

Allow raw HTML in i18n message? #24

gigix opened this issue Jan 24, 2015 · 4 comments

Comments

@gigix
Copy link

gigix commented Jan 24, 2015

For example, if I have a multi-paragraph message need to be translated, I'll have this in my i18n.js:

i18n.map('en', {
  great_text: '<p>paragraph 1</p><p>paragraph 2</p>'
});

But then {{i18n "great_text"}} will escape html tags and display following to user:

<p>paragraph 1</p><p>paragraph 2</p>

Is it possible to disable html escaping and just insert raw html into page?

@rekomat
Copy link

rekomat commented Feb 23, 2015

👍

Would be a great feature for entities too (ie. soft&shy;hyphen)

@TPXP
Copy link

TPXP commented Mar 7, 2015

Just tell Handlebars you don't want it to replace html tags, using three brackets instead of two :
{{{i18n "great_text"}}}
And it should give you the expected result.

@rekomat
Copy link

rekomat commented Mar 9, 2015

Thanks for the hint, Thomas. Works perfectly fine for me.

@jm4r7in
Copy link

jm4r7in commented Jun 30, 2015

👍
Great package and great hint !
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants