inbox-react-intl icon indicating copy to clipboard operation
inbox-react-intl copied to clipboard

internationalize react for Vanilla JS

Open cwtuan opened this issue 8 years ago • 0 comments

Try https://github.com/alibaba/react-intl-universal which is developed by Alibaba Group. 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.';
    }
  }
};

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

cwtuan avatar Jul 10 '17 15:07 cwtuan