-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I18n: Make preview popup loader strings translateable #3301
Conversation
@@ -76,8 +76,8 @@ export class PreviewButton extends Component { | |||
|
|||
const markup = ` | |||
<div> | |||
<p>Please wait…</p> | |||
<p>Generating preview.</p> | |||
<p>${ __( 'Please wait…' ) }</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlike with React, we don't get string escaping for free here, so there is a potential risk with inserting this into raw markup.
https://codex.wordpress.org/I18n_for_WordPress_Developers#HTML
We may need to consider patterns for sanitization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related: WordPress/packages#12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also generate this with wp.element.renderToStaticMarkup
as an element.
Or just Lodash _.escape
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Soean Are you able to revisit this one? Should we just close it?
@@ -76,8 +76,8 @@ export class PreviewButton extends Component { | |||
|
|||
const markup = ` | |||
<div> | |||
<p>Please wait…</p> | |||
<p>Generating preview.</p> | |||
<p>${ __( 'Please wait…' ) }</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also generate this with wp.element.renderToStaticMarkup
as an element.
Or just Lodash _.escape
Looks like this PR has got stale, so closing it for now. If you can revisit it feel free to re-open this PR or open a new PR. |
Closed this but filed #7725 to track this issue. |
Description
Adds translate functions to the text strings in the preview popup loader.