Installation
formatjs is a set of libraries that help you setup internationalization in any project whether it's React or not.
#
Installation- npm
- yarn
#
Minimal ApplicationAfter following the step above, you should be able to get a minimal application like this running:
- Node
- React
- Vue3
Output
Output
#
Adding our babel-plugin/TypeScript Transformer for compilationOur tooling supports babel
, ts-loader
, ts-jest
, rollup-plugin-typescript2
& ttypescript
for message compilation:
#
BabelIf you're using babel
, add babel-plugin-formatjs
to your dependencies:
- npm
- yarn
and add it to your babel.config.js
or .babelrc
:
ts-loader
#
- npm
- yarn
ts-jest
in jest.config.js
#
- npm
- yarn
Take a look at ts-jest
guide on how to incorporate custom AST Transformers.
ttypescript
#
- npm
- yarn
rollup-plugin-typescript2
#
- npm
- yarn