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

feat(annotations): Send react-intl strings to annotations #1174

Merged
merged 8 commits into from
Feb 10, 2020

Conversation

mickr
Copy link
Contributor

@mickr 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
@boxcla
Copy link

boxcla commented Feb 7, 2020

Verified that @mickr has signed the CLA. Thanks for the pull request!

src/lib/viewers/BaseViewer.js Outdated Show resolved Hide resolved
src/lib/viewers/BaseViewer.js Outdated Show resolved Hide resolved
src/lib/viewers/BaseViewer.js Outdated Show resolved Hide resolved
src/lib/viewers/BaseViewer.js Show resolved Hide resolved
src/lib/viewers/BaseViewer.js Outdated Show resolved Hide resolved
src/lib/viewers/BaseViewer.js Show resolved Hide resolved
@mickr mickr marked this pull request as ready for review February 7, 2020 23:05
@mickr mickr requested a review from a team as a code owner February 7, 2020 23:05
src/lib/viewers/BaseViewer.js Outdated Show resolved Hide resolved
src/lib/viewers/BaseViewer.js Outdated Show resolved Hide resolved
jstoffan
jstoffan previously approved these changes Feb 8, 2020
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
Copy link
Collaborator

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].

Copy link
Contributor Author

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.

build/webpack.common.config.js Show resolved Hide resolved
src/lib/intl.js Outdated
*/
const createAnnotatorIntl = () => {
addLocaleData(intlLocaleData);
const locale = language && language.substr(0, language.indexOf('-'));
Copy link
Collaborator

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?

@jstoffan
Copy link
Collaborator

jstoffan commented Feb 8, 2020

Tests?

jstoffan
jstoffan previously approved these changes Feb 8, 2020
src/lib/i18n.js Outdated
locale: language.substr(0, language.indexOf('-')),
messages: annotationMessages,
},
{},
Copy link
Collaborator

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 = () => {
Copy link
Collaborator

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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetize?

@mickr mickr merged commit 715d77e into box:master Feb 10, 2020
mickr added a commit that referenced this pull request Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants