Skip to content

Commit

Permalink
Fix using HTML tags in ICU messages (#310) (#325)
Browse files Browse the repository at this point in the history
The `ignoreTag` option was added specifically for this use case.
See also:
- https://formatjs.io/docs/intl-messageformat/#intlmessageformat-constructor
- formatjs/formatjs#1699
  • Loading branch information
sustmi authored Nov 19, 2021
1 parent 6cbaa47 commit 0388881
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Resources/js/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
throw new Error('The dependency "IntlMessageFormat" is required to use ICU MessageFormat but it has not been found. Please read https://github.com/willdurand/BazingaJsTranslationBundle/blob/master/Resources/doc/index.md#using-icu-messageformat')
}

var mf = new IntlMessageFormat.IntlMessageFormat(_message);
var mf = new IntlMessageFormat.IntlMessageFormat(_message, undefined, undefined, {ignoreTag: true});

return mf.format(parameters || {});
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/public/js/translator.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0388881

Please sign in to comment.