Coder Social home page Coder Social logo

inbox-react-intl's People

Contributors

iam-peekay avatar nerolis avatar ruffle1986 avatar tsriram avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

inbox-react-intl's Issues

internationalize react for Vanilla JS

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.

hot to write translation files

Hi -

Thanks for the great post, it was really clear and helpful. Once thing I don't get though: what would a translated file like? And in the context of this project, where would that file live?

Thanks!

Only get error message

Thanks for providing this sample repo.

When I try to run it, however, I only get this error message:

[BABEL] /Users/waldgeist/Documents/Development/htdocs/tests/inbox-react-intl/src/js/components/Header/SubHeader.js: [React Intl] Line 31: Default messages are not extracted from <FormattedPlural>, use <FormattedMessage> instead.

Getting error message while running your code

Hi,

I am getting following error message while running the code.

Uncaught Error: Cannot find module "!!../../../../node_modules/css-loader/index.js!../../../../node_modules/sass-loader/index.js!./Header.scss"

Could you please provide the steps for run this application?

Thanks,
Prashant

code comment inconsistency

First of all, let me tell you how much I appreciate your article and the sample project on localizing react projects. It was very helpful to make decisions in case of one of my projects to make it available worldwide.

https://github.com/iam-peekay/inbox-react-intl/blob/master/src/js/index.js#L23-L24

While I was looking at your code, I noted that this particular line of code (see above) doesn't do what the comment says in the previous line. It says Try full locale first but you're trying to get the messages by providing the locale code without the region code first.

Since the locale code with the region (full locale code) is more specific, it's better to try it first. So the comment is correct and the code above is supposed to work according to that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.