Package Exports
- @tutorbook/intl
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tutorbook/intl) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@tutorbook/translations
This package contains all of the translations for Tutorbook's new web
app. We're using
react-intl for the i18n of our website.
Take a look at this blog post for some examples that are similar to how we're localizing our website.
Setup
To install the formatjs CLI (to automatically extract new defaultMessages
defined using the defineMessages React hook and the FormattedMessage React
component) run the following:
$ npm i -g formatjsUsage
To automatically extract new defaultMessages defined using the
defineMessages React hook and the FormattedMessage React component run the
following (from the root of the repository):
$ formatjs extract --out-file src/intl/locales/en.json src/*/lib/*.tsx