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
[HowTo] Format attributes like input placeholders #205
Comments
Here's some details on upgrading to v2, the full guide hasn't been written yet: #193 (comment) There is still an imperative API to format things like input placeholders, but the signature is now different: formatMessage(messageDescriptor, values); Where a message descriptor looks like: {
id: 'greeting',
defaultMessage: 'Hello, {name}',
description: 'A note to explain the context to the translator'
} You can see an example here: https://github.com/yahoo/react-intl/blob/master/examples/translations/src/client/components/locales-menu.js |
Thanks, that's a lot of API change indeed. I am not sure the new What was the reason/idea behind to remove the mixin? Also as a bonus question I wonder why the |
The name of the lib is "react-intl", the name of the JavaScript APIs that it builds on are injectIntl(Component, {intlPropName: 'i18n'});
Mixins don't work with components defined as ES6 classes without some user-land solution, nor stateless arrow function components. The move away from mixins is inline with React's functional nature. Mixins are an OOP concept, with |
Thanks for the explanations. Being new to the whole react world and skimming the eco-system at the moment. Have a lot to learn.
That's cool! |
The main page states, that
ReactIntl.formatMessage
will be deprecated in 2.0 and replaced by another API. How should we translate element attributes for the time being?The text was updated successfully, but these errors were encountered: