You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 5, 2020. It is now read-only.
I do not know what that is - the one thing a single link component makes easy is localisation, as you'd only need one place in which to detect and process localisation.
I was on my phone when I commented, so I didn't bother to copy and paste links as reference.
A better explanation why component based links are hard because of l10n:
Say I have a string like this Click <a href="https://findoutmore.com">here</a> to find out more I need to localize. I can:
Add the string Click <a href="https://findoutmore.com">here</a> to find out more to a .properties file and use <FormattedHTMLMessage>https://github.com/yahoo/react-intl/wiki/Components#formattedhtmlmessage which allows the HTML to exist inside the string and be used in react-intl. Tricky bit here is components cannot live in that string, that I know of, and have it still render in <FormattedHTMLMessage>
You also have this issue if you want a single link component. You probably want to keep this as a simple <a> tag.
You can fairly easily build localized links though, if you change the string to Click <a href="{link}">here</a> to find out more Then build the link with this.context.intl.locale and pass it into <FormattedHTMLMessage> as a variable.
If there is a way to render components in strings living in a .properties file though, that would be ideal, I just don't know how to do it without being way more complex than a simple <a>
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It's only used in a handful of places, it might be worth reengineering it out of existence...
The text was updated successfully, but these errors were encountered: