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

Need <FormattedReactMessage /> #905

Closed
kud opened this issue Mar 16, 2017 · 6 comments
Closed

Need <FormattedReactMessage /> #905

kud opened this issue Mar 16, 2017 · 6 comments

Comments

@kud
Copy link

kud commented Mar 16, 2017

The more I use this lib, the more I think we should have a <FormattedReactMessage /> to be able to use strings like <Link to="/">. :)

@langpavel
Copy link

This is really bad idea. Possible solution will be too much opinionated and probably not performant.
But if you have idea, you can create your own package.
What you think it should look like? Can you provide piece of code? I'm curious..

@kud
Copy link
Author

kud commented Mar 16, 2017

I need this to do that: #902 (comment) do you see a better way?

@langpavel
Copy link

Have you an idea how to implement this?
Have you an idea how it can looks like when using this?

@kud
Copy link
Author

kud commented Mar 16, 2017

For the moment, no, I must admit.

I thought about this:

<FormattedMessage id="noMatch.text" />

{
  "locale": "fr",
  "messages": {
    "noMatch.text": "Il n'y a malheureusement rien ici. Retournez à l'<Link to=\"/\">accueil</Link>.",
  }
}

@langpavel
Copy link

This is realy bad idea. You must parse string, then there is another problem, that you have no context so you cannot instantiate proper react component, so simply, this is not possible.
Use approach from your second issue and close this one. Thanks!

@kud kud closed this as completed Mar 16, 2017
@ghostd
Copy link
Contributor

ghostd commented Mar 17, 2017

@kud you need this #513

Meanwhile, you can check out and test my PR #878

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants