angular-translate sanitisation fails with UTF characters

fusio picture fusio · Jun 23, 2015 · Viewed 9.4k times · Source

On Angular 1.3.x with latest version of angular-translate. Using $sanitize it seems there are problems when using filter or service directly, but it works when using the directive.

Suggestions?

Here is an example:

On jsfiddle: http://jsfiddle.net/gnvpo6aa/

Answer

knalli picture knalli · Jul 7, 2015

At the moment, you have two options:

  1. Use the strategy sanitizeParameters which will only sanitize the dynamic parameters, but not the actual translation (template). If you have the translation under control (but not the dynamic values), this will work.
  2. Use the strategy escape (or escapeParameters) which does not use sanitization but escaping.

Disclaimer: I'm co-maintaining angular-translate.

Edit (12.01.2016): I'd created this matrix overview of all variants.