0

I use angular-translate and it suggests to use ngSanitize. I just implemented it, but now, characters such as & display as &, and the string Next> now displays as Next> because they are sanitized.

My HTML is very simple such as:

<div>{{"SALES_MKT" | translate}}</div>

and in my translation file, I simply have something like:

var translationsEN = {
    SALES_MKT: 'Sales & Marketing'
}

There must be a way to escape these characters in a safe way? I have tried to use %xx codes, but they are not translated.

Any suggestions?

Oriol
  • 274,082
  • 63
  • 437
  • 513
pierrebo
  • 904
  • 2
  • 10
  • 22
  • Sanitize should display the & properly. Are you having a problem when you use translate ? – Shyju Nov 26 '15 at 17:10
  • 2
    I don't know angular, but I would say either the text is being parsed as text instead of as HTML, so you shouldn't 'sanitize' it; or it is being parsed as HTML but you 'sanitized' it twice. – Oriol Nov 26 '15 at 17:11
  • The text translates just fine, only the special characters. – pierrebo Nov 26 '15 at 18:46

0 Answers0