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

merge leading/trailing standalone elements into wrappers #4

Closed
jenseng opened this issue Apr 3, 2015 · 0 comments
Closed

merge leading/trailing standalone elements into wrappers #4

jenseng opened this issue Apr 3, 2015 · 0 comments

Comments

@jenseng
Copy link
Owner

jenseng commented Apr 3, 2015

Another thing for nicer translation strings... Consider:

<button onClick={this.close}>
  <Icon className="i-close" />
  <span translate="yes">Close</span>
</button>

The span is superfluous, but if we put translate="yes" on the <button /> then translators will see a placeholder for the <Icon />, which is not helpful.

If a wrapper has leading or trailing elements with no text content, we should absorb them into the wrapper. Then you can safely do:

<button onClick={this.close} translate="yes">
  <Icon className="i-close" />
  Close
</button>

an the extracted string will just be:

"Close"

i18nliner-handlebars and canvas_react_i18n both do this, we should too.

jenseng added a commit that referenced this issue Apr 6, 2015
refs #3, #4

ensure that leading/trailing standalone elements in wrappers and in the
top-level interpolator are preserved

also ensure that nested tags in wrappers area applied correctly
@jenseng jenseng closed this as completed in 8afa37e Apr 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant