Skip to content

support html tags in translations#98

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

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

Conversation

@jelhan
Copy link
Copy Markdown
Contributor

@jelhan jelhan commented Apr 4, 2015

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
Copy link
Copy Markdown
Contributor Author

jelhan commented Apr 4, 2015

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
Copy link
Copy Markdown
Contributor Author

jelhan commented Apr 4, 2015

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