Skip to content
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

Add ability to use gettext/code inside markup string (eg PreviewButton's "Please wait") #7725

Closed
tofumatt opened this issue Jul 5, 2018 · 2 comments
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Code Quality Issues or PRs that relate to code quality

Comments

@tofumatt
Copy link
Member

tofumatt commented Jul 5, 2018

As mentioned in #3301, PreviewButton has untranslated strings (https://github.com/WordPress/gutenberg/blob/master/editor/components/post-preview-button/index.js#L75), but we can't just put __() in there because we don't have React escaping.

https://github.com/WordPress/gutenberg/pull/3301/files#r148514197

@noisysocks
Copy link
Member

Using Lodash's escape utility should be fine for this.

- <p>Please wait&hellip;</p>
+ ${ escape( __( 'Please wait…' ) ) }

@noisysocks noisysocks added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Oct 23, 2018
@swissspidy
Copy link
Member

Note that there's an existing PR: #10880

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

No branches or pull requests

3 participants