-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Milestone
Description
Issue
Say i have a string:
To buy a shoe,
<a class="external_link" target="_blank" href="https://www.shoe.com/">visit our website</a>
and
<strong class="important">eat a shoe</strong>
According to https://github.com/yahoo/react-intl/wiki/Components#formattedmessage, I need to format my text this way:
<FormattedMessage
defaultMessage='To buy a shoe, { link } and { cta }'
values={{
link: <a class="external_link" target="_blank" href="https://www.shoe.com/">visit our website</a>,
cta: <strong class="important">eat a shoe</strong>
}}
/>
When doing string extraction with https://github.com/yahoo/babel-plugin-react-intl, I would get:
To buy a shoe, { link } and { cta }
to be translated.
This isn't good because I lose the context and texts from the rich content for link
and cta
.
Suggestion
I think we should have some special delimiters to surround rich text content so translators can still translate the text as a whole:
To buy a shoe, @visit our website@ and @eat a shoe@
Thoughts?
chinchang, kopax, mkg0 and blessedsoysapegin