Skip to content

support html tags in translations#98

Open
jelhan wants to merge 2 commits into
DavyJonesLocker:masterfrom
jelhan:support-html-tags
Open

support html tags in translations#98
jelhan wants to merge 2 commits into
DavyJonesLocker:masterfrom
jelhan:support-html-tags

Conversation

@jelhan

@jelhan jelhan commented Apr 4, 2015

Copy link
Copy Markdown
Contributor

Adding support for html tags in translation as it was discussed in #97. It's disabled by default as it could be a security risk. Could be enabled by configuration:

var ENV = {
  APP: {
    defaultLocale: 'en',
    htmlLocales: true
  }
};

@jelhan

jelhan commented Apr 4, 2015

Copy link
Copy Markdown
Contributor Author

I'm not sure if we have to escape values used in interpolation or pluralization. They could be entered by users and should therefore not be treated as safe. Not sure if Ember.String.fmt already does this. We should definitely investigate this before merging.

@jelhan

jelhan commented Apr 4, 2015

Copy link
Copy Markdown
Contributor Author

Interpolation values are mapped through Handlebars.Utils.escapeExpression() if htmlLocales is enabled in last commit. Should be safe now.

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

Successfully merging this pull request may close these issues.

1 participant