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

Replace yahoo/react-intl with alibaba/react-intl-universal #1359

Closed
cwtuan opened this issue Jul 10, 2017 · 4 comments
Closed

Replace yahoo/react-intl with alibaba/react-intl-universal #1359

cwtuan opened this issue Jul 10, 2017 · 4 comments

Comments

@cwtuan
Copy link

cwtuan commented Jul 10, 2017

yahoo/react-intl can only be applied in view layer such as React.Component. For Vanilla JS file, there’s no way to internationalize it. For example, the following snippet is general form validator used by many React.Component in our apps.

export default const rules = {
  noSpace(value) {
    if (value.includes(' ')) {
      return 'Space is not allowed.';
    }
  }
};

https://github.com/alibaba/react-intl-universal is simple but powerful. It doesn’t change behavior of components. And can used in JSX and normal JS file.

@langpavel
Copy link
Collaborator

Hmmm very interesting! Can you provide more resources, arguments whatever? If I adopt this, I should create new branch for it or can it be backward compatible?

@langpavel
Copy link
Collaborator

langpavel commented Oct 7, 2017

Hmmm, I'm not sure that all what alibaba/react-intl-universal says about yahoo/react-intl is true.
I have a way to get message from intl after I can decide language on server.
I did not publish this in react-intl branch yet, but it's really possible...
On the client it's really easier because client can use globals easier :-)

@cwtuan
Copy link
Author

cwtuan commented Oct 7, 2017

@langpavel
alibaba/react-intl-universal has compatible APIs with yahoo/react-intl.

It resolve the problem mentioned in How to use imperative API in a non-component script.

@ulani
Copy link
Member

ulani commented May 27, 2021

@cwtuan thank you very much for crating this issue! Unfortunately, we have close it due to inactivity. Feel free to re-open it or join our Discord channel for discussion.

NOTE: The main branch has been updated with React Starter Kit v2, using JAM-style architecture.

@ulani ulani closed this as completed May 27, 2021
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

3 participants