-
Notifications
You must be signed in to change notification settings - Fork 116
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
feat(annotations): Send react-intl strings to annotations #1174
Conversation
mickr
commented
Feb 7, 2020
- Requires version upgrade of box-annotations
- Send react-intl strings to annotations
- Add shim for Intl and Karma
- Add resolver for lang files for annotations
- Remove redundant tags from index.html in test directory
- Use passed in language from ENV when building for dev
* Requires version upgrade of box-annotations * Add shim for Intl and Karma * Add resolver for lang files for annotations * Remove redundant tags from index.html in test directory * Use passed in language from ENV when building for dev
Verified that @mickr has signed the CLA. Thanks for the pull request! |
src/lib/intl.js
Outdated
@@ -0,0 +1,37 @@ | |||
import { IntlProvider, addLocaleData } from 'react-intl'; | |||
import intlLocaleData from 'react-intl-locale-data'; // eslint-disable-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI, this doesn't exist in [email protected].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, I have created the stories to upgrade to [email protected] for Preview and Annotations.
src/lib/intl.js
Outdated
*/ | ||
const createAnnotatorIntl = () => { | ||
addLocaleData(intlLocaleData); | ||
const locale = language && language.substr(0, language.indexOf('-')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the first identity check needed? Can this be inlined with the provider options?
Tests? |
src/lib/i18n.js
Outdated
locale: language.substr(0, language.indexOf('-')), | ||
messages: annotationMessages, | ||
}, | ||
{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this second object is required.
* Send over messages from Preview
* @private | ||
* @return {Object} | ||
*/ | ||
const createAnnotatorIntl = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be a .ts
file?
*/ | ||
const createAnnotatorIntl = () => { | ||
return { | ||
messages: annotationMessages, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alphabetize?